Search in sources :

Example 6 with StorageCredentials

use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.

the class BlobServiceUtil method createBlockBlobClient.

public static CloudBlockBlob createBlockBlobClient(BlobServiceConfiguration cfg) throws Exception {
    CloudBlockBlob client = (CloudBlockBlob) getConfiguredClient(cfg);
    if (client == null) {
        URI uri = prepareStorageBlobUri(cfg);
        StorageCredentials creds = getAccountCredentials(cfg);
        client = new CloudBlockBlob(uri, creds);
    }
    return client;
}
Also used : StorageCredentials(com.microsoft.azure.storage.StorageCredentials) CloudBlockBlob(com.microsoft.azure.storage.blob.CloudBlockBlob) URI(java.net.URI)

Example 7 with StorageCredentials

use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.

the class BlobServiceUtil method createPageBlobClient.

public static CloudPageBlob createPageBlobClient(BlobServiceConfiguration cfg) throws Exception {
    CloudPageBlob client = (CloudPageBlob) getConfiguredClient(cfg);
    if (client == null) {
        URI uri = prepareStorageBlobUri(cfg);
        StorageCredentials creds = getAccountCredentials(cfg);
        client = new CloudPageBlob(uri, creds);
    }
    return client;
}
Also used : StorageCredentials(com.microsoft.azure.storage.StorageCredentials) URI(java.net.URI) CloudPageBlob(com.microsoft.azure.storage.blob.CloudPageBlob)

Example 8 with StorageCredentials

use of com.microsoft.azure.storage.StorageCredentials in project camel by apache.

the class QueueServiceComponent method checkCredentials.

private void checkCredentials(QueueServiceConfiguration cfg) {
    CloudQueue client = cfg.getAzureQueueClient();
    StorageCredentials creds = client == null ? cfg.getCredentials() : client.getServiceClient().getCredentials();
    if (creds == null) {
        throw new IllegalArgumentException("Credentials must be specified.");
    }
}
Also used : StorageCredentials(com.microsoft.azure.storage.StorageCredentials) CloudQueue(com.microsoft.azure.storage.queue.CloudQueue)

Example 9 with StorageCredentials

use of com.microsoft.azure.storage.StorageCredentials in project hadoop by apache.

the class AzureNativeFileSystemStore method connectUsingConnectionStringCredentials.

/**
   * Connect to Azure storage using account key credentials.
   */
private void connectUsingConnectionStringCredentials(final String accountName, final String containerName, final String accountKey) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
    // If the account name is "acc.blob.core.windows.net", then the
    // rawAccountName is just "acc"
    String rawAccountName = accountName.split("\\.")[0];
    StorageCredentials credentials = new StorageCredentialsAccountAndKey(rawAccountName, accountKey);
    connectUsingCredentials(accountName, credentials, containerName);
}
Also used : StorageCredentials(com.microsoft.azure.storage.StorageCredentials) StorageCredentialsAccountAndKey(com.microsoft.azure.storage.StorageCredentialsAccountAndKey)

Example 10 with StorageCredentials

use of com.microsoft.azure.storage.StorageCredentials in project hadoop by apache.

the class AzureNativeFileSystemStore method connectUsingSASCredentials.

/**
   * Connect to Azure storage using shared access signature credentials.
   */
private void connectUsingSASCredentials(final String accountName, final String containerName, final String sas) throws InvalidKeyException, StorageException, IOException, URISyntaxException {
    StorageCredentials credentials = new StorageCredentialsSharedAccessSignature(sas);
    connectingUsingSAS = true;
    connectUsingCredentials(accountName, credentials, containerName);
}
Also used : StorageCredentialsSharedAccessSignature(com.microsoft.azure.storage.StorageCredentialsSharedAccessSignature) StorageCredentials(com.microsoft.azure.storage.StorageCredentials)

Aggregations

StorageCredentials (com.microsoft.azure.storage.StorageCredentials)10 URI (java.net.URI)5 StorageCredentialsAccountAndKey (com.microsoft.azure.storage.StorageCredentialsAccountAndKey)2 CloudQueue (com.microsoft.azure.storage.queue.CloudQueue)2 StorageCredentialsAnonymous (com.microsoft.azure.storage.StorageCredentialsAnonymous)1 StorageCredentialsSharedAccessSignature (com.microsoft.azure.storage.StorageCredentialsSharedAccessSignature)1 CloudAppendBlob (com.microsoft.azure.storage.blob.CloudAppendBlob)1 CloudBlob (com.microsoft.azure.storage.blob.CloudBlob)1 CloudBlobContainer (com.microsoft.azure.storage.blob.CloudBlobContainer)1 CloudBlockBlob (com.microsoft.azure.storage.blob.CloudBlockBlob)1 CloudPageBlob (com.microsoft.azure.storage.blob.CloudPageBlob)1 JndiRegistry (org.apache.camel.impl.JndiRegistry)1