CloudAnalyticsClient Class

  • java.lang.Object
    • com.microsoft.azure.storage.analytics.CloudAnalyticsClient

public class CloudAnalyticsClient

Provides a client-side logical representation for Microsoft Azure Storage Analytics. This client is used to configure and execute storage analytics requests.

The service client encapsulates the endpoint or endpoints for the blob and table service. It also encapsulates the credentials for accessing the storage account.

Field Summary

Modifier and Type Field and Description
final CloudBlobClient blobClient

The blob client for logging features.

String LogContainer

The container in which to look for logs.

final CloudTableClient tableClient

The table client for metrics features.

Constructor Summary

Constructor Description
CloudAnalyticsClient(StorageUri blobStorageUri, StorageUri tableStorageUri, StorageCredentials credentials)

Initializes a new instance of the class using the specified blob and table service endpoints and account credentials.

Method Summary

Modifier and Type Method and Description
CloudTable getCapacityTable()

Gets the capacity metrics table for the blob service.

CloudTable getHourMetricsTable(StorageService service)

Gets the hour metrics table for a specific storage service.

CloudTable getHourMetricsTable(StorageService service, StorageLocation location)

Gets the hour metrics table for a specific storage service.

CloudBlobDirectory getLogDirectory(StorageService service)

Gets the CloudBlobDirectory object for the logs for a specific storage service.

CloudTable getMinuteMetricsTable(StorageService service)

Gets the minute metrics table for a specific storage service.

CloudTable getMinuteMetricsTable(StorageService service, StorageLocation location)

Gets the minute metrics table for a specific storage service.

Iterable<ListBlobItem> listLogBlobs(StorageService service)

Returns an enumerable collection of log blobs, retrieved lazily.

Iterable<ListBlobItem> listLogBlobs(StorageService service, Date startTime, Date endTime, EnumSet<LoggingOperations> operations, BlobListingDetails details, BlobRequestOptions options, OperationContext operationContext)

Returns an enumerable collection of log blobs, retrieved lazily.

Iterable<LogRecord> listLogRecords(StorageService service)

Returns an enumerable collection of log records, retrieved lazily.

Iterable<LogRecord> listLogRecords(StorageService service, Date startTime, Date endTime, BlobRequestOptions options, OperationContext operationContext)

Returns an enumerable collection of log records, retrieved lazily.

Iterable<LogRecord> parseLogBlob(ListBlobItem logBlob)

Returns an enumerable collection of log records, retrieved lazily.

Iterable<LogRecord> parseLogBlobs(Iterable<ListBlobItem> logBlobs)

Returns an enumerable collection of log records, retrieved lazily.

Field Details

blobClient

protected final CloudBlobClient blobClient

The blob client for logging features.

LogContainer

protected String LogContainer= Constants.AnalyticsConstants.LOGS_CONTAINER

The container in which to look for logs.

tableClient

protected final CloudTableClient tableClient

The table client for metrics features.

Constructor Details

CloudAnalyticsClient

public CloudAnalyticsClient(StorageUri blobStorageUri, StorageUri tableStorageUri, StorageCredentials credentials)

Initializes a new instance of the class using the specified blob and table service endpoints and account credentials.

Parameters:

blobStorageUri - A StorageUri object containing the Blob service endpoint to use to create the client.
tableStorageUri - A StorageUri object containing the Table service endpoint to use to create the client.
credentials - A StorageCredentials object.

Method Details

getCapacityTable

public CloudTable getCapacityTable()

Gets the capacity metrics table for the blob service.

Returns:

A CloudTable object.

Throws:

URISyntaxException
StorageException

getHourMetricsTable

public CloudTable getHourMetricsTable(StorageService service)

Gets the hour metrics table for a specific storage service.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.

Returns:

The CloudTable object for the storage service.

Throws:

URISyntaxException
StorageException

getHourMetricsTable

public CloudTable getHourMetricsTable(StorageService service, StorageLocation location)

Gets the hour metrics table for a specific storage service.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.
location - A StorageLocation enumeration value that indicates which storage location to use.

Returns:

The CloudTable object for the storage service.

Throws:

URISyntaxException
StorageException

getLogDirectory

public CloudBlobDirectory getLogDirectory(StorageService service)

Gets the CloudBlobDirectory object for the logs for a specific storage service.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.

Returns:

A CloudBlobDirectory object.

Throws:

URISyntaxException
StorageException

getMinuteMetricsTable

public CloudTable getMinuteMetricsTable(StorageService service)

Gets the minute metrics table for a specific storage service.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.

Returns:

The CloudTable object for the storage service.

Throws:

URISyntaxException
StorageException

getMinuteMetricsTable

public CloudTable getMinuteMetricsTable(StorageService service, StorageLocation location)

Gets the minute metrics table for a specific storage service.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.
location - A StorageLocation enumeration value that indicates which storage location to use.

Returns:

The CloudTable object for the storage service.

Throws:

URISyntaxException
StorageException

listLogBlobs

public Iterable listLogBlobs(StorageService service)

Returns an enumerable collection of log blobs, retrieved lazily.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.

Returns:

An enumerable collection of objects that implement ListBlobItem and are retrieved lazily.

Throws:

URISyntaxException
StorageException

listLogBlobs

public Iterable listLogBlobs(StorageService service, Date startTime, Date endTime, EnumSet operations, BlobListingDetails details, BlobRequestOptions options, OperationContext operationContext)

Returns an enumerable collection of log blobs, retrieved lazily.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.
startTime - A java.util.Date object representing the start of the time range for which logs should be retrieved.
endTime - A java.util.Date object representing the end of the time range for which logs should be retrieved.
operations - A LoggingOperations enumeration set that indicates which log types to return.
details - A BlobListingDetails enumeration set that indicates whether or not blob metadata should be returned. None or METADATA are the only valid values.
options - A BlobRequestOptions object that specifies additional options for the request.
operationContext - An OperationContext object that represents the context for the current operation.

Returns:

An enumerable collection of objects that implement ListBlobItem and are retrieved lazily.

Throws:

StorageException
URISyntaxException

listLogRecords

public Iterable listLogRecords(StorageService service)

Returns an enumerable collection of log records, retrieved lazily.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.

Returns:

An enumerable collection of objects that implement ListBlobItem and are retrieved lazily.

Throws:

URISyntaxException
StorageException

listLogRecords

public Iterable listLogRecords(StorageService service, Date startTime, Date endTime, BlobRequestOptions options, OperationContext operationContext)

Returns an enumerable collection of log records, retrieved lazily.

Parameters:

service - A StorageService enumeration value that indicates which storage service to use.
startTime - A java.util.Date object representing the start of the time range for which logs should be retrieved.
endTime - A java.util.Date object representing the end of the time range for which logs should be retrieved.
options - A BlobRequestOptions object that specifies additional options for the request.
operationContext - An OperationContext object that represents the context for the current operation.

Returns:

An enumerable collection of objects that implement ListBlobItem and are retrieved lazily.

Throws:

StorageException
URISyntaxException

parseLogBlob

public static Iterable parseLogBlob(ListBlobItem logBlob)

Returns an enumerable collection of log records, retrieved lazily.

Parameters:

logBlob - A single blob to parse LogRecords from.

Returns:

An enumerable collection of objects that implement LogRecord and are retrieved lazily.

parseLogBlobs

public static Iterable parseLogBlobs(Iterable logBlobs)

Returns an enumerable collection of log records, retrieved lazily.

Parameters:

logBlobs - An Iterable of blobs to parse LogRecords from.

Returns:

An enumerable collection of objects that implement LogRecord and are retrieved lazily.

Applies to