當前位置: 首頁>>代碼示例>>Java>>正文


Java ExecutionEngine類代碼示例

本文整理匯總了Java中com.microsoft.azure.storage.core.ExecutionEngine的典型用法代碼示例。如果您正苦於以下問題:Java ExecutionEngine類的具體用法?Java ExecutionEngine怎麽用?Java ExecutionEngine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExecutionEngine類屬於com.microsoft.azure.storage.core包,在下文中一共展示了ExecutionEngine類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Creates the share using the specified options and operation context.
 * 
 * @param options
 *            A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudFileClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * 
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public void create(FileRequestOptions options, OperationContext opContext) throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    assertNoSnapshot();
    if (this.properties != null && this.properties.getShareQuota() != null) {
        Utility.assertInBounds("Share Quota", this.properties.getShareQuota(), 1, FileConstants.MAX_SHARE_QUOTA);
    }

    opContext.initialize();
    options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);

    ExecutionEngine.executeWithRetry(this.fileServiceClient, this, createImpl(options),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:33,代碼來源:CloudFileShare.java

示例2: downloadRange

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads the contents of a blob to a stream using the specified request options and operation context.
 *
 * @param offset
 *            A <code>long</code> which represents the offset to use as the starting point for the source.
 * @param length
 *            A <code>Long</code> which represents the number of bytes to read or <code>null</code>.
 * @param outStream
 *            An <code>{@link OutputStream}</code> object that represents the target stream.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public final void downloadRange(final long offset, final Long length, final OutputStream outStream,
        final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
        throws StorageException {
    if (offset < 0 || (length != null && length <= 0)) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = BlobRequestOptions.applyDefaults(options, this.properties.getBlobType(), this.blobServiceClient);

    if (options.getUseTransactionalContentMD5() && (length != null && length > 4 * Constants.MB)) {
        throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
    }

    ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
            this.downloadToStreamImpl(offset, length, outStream, accessCondition, options, opContext),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:46,代碼來源:CloudBlob.java

示例3: downloadRangeInternal

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads a range of bytes from the blob to the given byte buffer.
 *
 * @param blobOffset
 *            A <code>long</code> which represents the offset within the blob to begin downloading.
 * @param length
 *            A <code>Long</code> which represents the number of bytes to read.
 * @param buffer
 *            A <code>byte</code> array which represents the buffer to write to.
 * @param bufferOffset
 *            An <code>int</code> which represents the offset in the byte buffer to begin writing.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request.
 * @param opContext
 *            An {@link OperationContext} object used to track the execution of the operation.
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 */
@DoesServiceRequest
protected final int downloadRangeInternal(final long blobOffset, final Long length, final byte[] buffer,
        final int bufferOffset, final AccessCondition accessCondition, BlobRequestOptions options,
        OperationContext opContext) throws StorageException {

    if (bufferOffset < 0 || blobOffset < 0 || (length != null && length <= 0)) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    options = BlobRequestOptions.applyDefaults(options, this.properties.getBlobType(), this.blobServiceClient);

    if (options.getUseTransactionalContentMD5() && (length != null && length > 4 * Constants.MB)) {
        throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
    }

    return ExecutionEngine.executeWithRetry(this.blobServiceClient, this, this.downloadToByteArrayImpl(blobOffset,
            length, buffer, bufferOffset, accessCondition, options, opContext), options.getRetryPolicyFactory(),
            opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:44,代碼來源:CloudBlob.java

示例4: uploadServiceProperties

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Uploads a new {@link ServiceProperties} configuration to the given storage service. This includes Logging,
 * HourMetrics, MinuteMetrics and CORS configurations.
 * 
 * @param properties
 *            The {@link ServiceProperties} to upload.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public void uploadServiceProperties(final ServiceProperties properties, TableRequestOptions options,
        OperationContext opContext) throws StorageException {
    if (!Utility.isNullOrEmpty(properties.getDefaultServiceVersion())) {
        throw new IllegalArgumentException(SR.DEFAULT_SERVICE_VERSION_ONLY_SET_FOR_BLOB_SERVICE);
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = TableRequestOptions.populateAndApplyDefaults(options, this);

    Utility.assertNotNull("properties", properties);

    ExecutionEngine.executeWithRetry(this, null,
            this.uploadServicePropertiesImpl(properties, options, opContext, true),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:38,代碼來源:CloudTableClient.java

示例5: downloadRangeInternal

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads a range of bytes from the blob to the given byte buffer.
 *
 * @param blobOffset
 *            A <code>long</code> which represents the offset within the blob to begin downloading.
 * @param length
 *            A <code>Long</code> which represents the number of bytes to read.
 * @param buffer
 *            A <code>byte</code> array which represents the buffer to write to.
 * @param bufferOffset
 *            An <code>int</code> which represents the offset in the byte buffer to begin writing.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request.
 * @param opContext
 *            An {@link OperationContext} object used to track the execution of the operation.
 * @returns The total number of bytes read into the buffer.
 * 
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 */
@DoesServiceRequest
protected final int downloadRangeInternal(final long blobOffset, final Long length, final byte[] buffer,
        final int bufferOffset, final AccessCondition accessCondition, BlobRequestOptions options,
        OperationContext opContext) throws StorageException {

    if (bufferOffset < 0 || blobOffset < 0 || (length != null && length <= 0)) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    options = BlobRequestOptions.populateAndApplyDefaults(options, this.properties.getBlobType(), this.blobServiceClient);

    if (options.getUseTransactionalContentMD5() && (length != null && length > 4 * Constants.MB)) {
        throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
    }

    WrappedByteArrayOutputStream outputStream = new WrappedByteArrayOutputStream(buffer, bufferOffset);
    ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
            this.downloadToStreamImpl(blobOffset, length, outputStream, accessCondition, options, opContext),
            options.getRetryPolicyFactory(), opContext);
    return outputStream.getPosition();
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:48,代碼來源:CloudBlob.java

示例6: downloadToByteArray

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads a range of bytes from the file to the given byte buffer, using the specified request options and
 * operation context.
 * 
 * @param buffer
 *            A <code>byte</code> array which represents the buffer to which the file bytes are downloaded.
 * @param bufferOffet
 *            A <code>long</code> which represents the byte offset to use as the starting point for the target.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the file.
 * @param options
 *            A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudFileClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * 
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public final int downloadToByteArray(final byte[] buffer, final int bufferOffset,
        final AccessCondition accessCondition, FileRequestOptions options, OperationContext opContext)
        throws StorageException {

    Utility.assertNotNull("buffer", buffer);
    if (bufferOffset < 0) {
        throw new IndexOutOfBoundsException();
    }

    if (bufferOffset >= buffer.length) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = FileRequestOptions.applyDefaults(options, this.fileServiceClient);

    return ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
            this.downloadToByteArrayImpl(null, null, buffer, bufferOffset, accessCondition, options, opContext),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:48,代碼來源:CloudFile.java

示例7: uploadServiceProperties

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Uploads a new {@link ServiceProperties} configuration to the given storage service. This includes Logging,
 * HourMetrics, MinuteMetrics and CORS configurations.
 * 
 * @param properties
 *            The {@link ServiceProperties} to upload.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public void uploadServiceProperties(final ServiceProperties properties, QueueRequestOptions options,
        OperationContext opContext) throws StorageException {
    if (!Utility.isNullOrEmpty(properties.getDefaultServiceVersion())) {
        throw new IllegalArgumentException(SR.DEFAULT_SERVICE_VERSION_ONLY_SET_FOR_BLOB_SERVICE);
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = QueueRequestOptions.populateAndApplyDefaults(options, this);

    Utility.assertNotNull("properties", properties);

    ExecutionEngine.executeWithRetry(this, null,
            this.uploadServicePropertiesImpl(properties, options, opContext, false),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:38,代碼來源:CloudQueueClient.java

示例8: downloadRange

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads the contents of a blob to a stream using the specified request options and operation context.
 *
 * @param offset
 *            A <code>long</code> which represents the offset to use as the starting point for the source.
 * @param length
 *            A <code>Long</code> which represents the number of bytes to read or <code>null</code>.
 * @param outStream
 *            An <code>{@link OutputStream}</code> object that represents the target stream.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public final void downloadRange(final long offset, final Long length, final OutputStream outStream,
        final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
        throws StorageException {
    if (offset < 0 || (length != null && length <= 0)) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = BlobRequestOptions.populateAndApplyDefaults(options, this.properties.getBlobType(), this.blobServiceClient);

    if (options.getUseTransactionalContentMD5() && (length != null && length > 4 * Constants.MB)) {
        throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
    }

    ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
            this.downloadToStreamImpl(offset, length, outStream, accessCondition, options, opContext),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:46,代碼來源:CloudBlob.java

示例9: uploadPremiumPageBlobTier

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Sets the tier on a page blob on a premium storage account.
 * @param premiumBlobTier
 *            A {@link PremiumPageBlobTier} object which represents the tier of the blob.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object which represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public void uploadPremiumPageBlobTier(final PremiumPageBlobTier premiumBlobTier, BlobRequestOptions options,
        OperationContext opContext) throws StorageException {
    assertNoWriteOperationForSnapshot();
    Utility.assertNotNull("premiumBlobTier", premiumBlobTier);

    if (opContext == null) {
        opContext = new OperationContext();
    }

    options = BlobRequestOptions.populateAndApplyDefaults(options, BlobType.PAGE_BLOB, this.blobServiceClient);

    ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
            this.uploadBlobTierImpl(premiumBlobTier.toString(), options), options.getRetryPolicyFactory(), opContext);
    this.properties.setPremiumPageBlobTier(premiumBlobTier);
    this.properties.setBlobTierInferred(false);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:33,代碼來源:CloudPageBlob.java

示例10: downloadRangeInternal

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Downloads a range of bytes from the file to the given byte buffer.
 * 
 * @param fileOffset
 *            A <code>long</code> which represents the offset within the file to begin downloading.
 * @param length
 *            A <code>Long</code> which represents the number of bytes to read.
 * @param buffer
 *            A <code>byte</code> array which represents the buffer to write to.
 * @param bufferOffset
 *            An <code>int</code> which represents the offset in the byte buffer to begin writing.
 * @param accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the file.
 * @param options
 *            A {@link FileRequestOptions} object that specifies any additional options for the request.
 * @param opContext
 *            An {@link OperationContext} object used to track the execution of the operation.
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 */
@DoesServiceRequest
protected final int downloadRangeInternal(final long fileOffset, final Long length, final byte[] buffer,
        final int bufferOffset, final AccessCondition accessCondition, FileRequestOptions options,
        OperationContext opContext) throws StorageException {

    if (bufferOffset < 0 || fileOffset < 0 || (length != null && length <= 0)) {
        throw new IndexOutOfBoundsException();
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);
    
    WrappedByteArrayOutputStream outputStream = new WrappedByteArrayOutputStream(buffer, bufferOffset);
    ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
            this.downloadToStreamImpl(fileOffset, length, outputStream, accessCondition, options, opContext),
            options.getRetryPolicyFactory(), opContext);
    return outputStream.getPosition();
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:42,代碼來源:CloudFile.java

示例11: uploadServiceProperties

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
/**
 * Uploads a new {@link ServiceProperties} configuration to the given storage service. This includes Logging,
 * HourMetrics, MinuteMetrics and CORS configurations.
 * 
 * @param properties
 *            The {@link ServiceProperties} to upload.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudBlobClient}).
 * @param opContext
 *            An {@link OperationContext} object that represents the context for the current operation. This object
 *            is used to track requests to the storage service, and to provide additional runtime information about
 *            the operation.
 * @throws StorageException
 *             If a storage service error occurred.
 */
@DoesServiceRequest
public void uploadServiceProperties(final ServiceProperties properties, TableRequestOptions options,
        OperationContext opContext) throws StorageException {
    if (!Utility.isNullOrEmpty(properties.getDefaultServiceVersion())) {
        throw new IllegalArgumentException(SR.DEFAULT_SERVICE_VERSION_ONLY_SET_FOR_BLOB_SERVICE);
    }

    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = TableRequestOptions.applyDefaults(options, this);

    Utility.assertNotNull("properties", properties);

    ExecutionEngine.executeWithRetry(this, null,
            this.uploadServicePropertiesImpl(properties, options, opContext, true),
            options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:38,代碼來源:CloudTableClient.java

示例12: exists

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
@DoesServiceRequest
private final boolean exists(final boolean primaryOnly, final AccessCondition accessCondition,
        FileRequestOptions options, OperationContext opContext) throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);

    return ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
            this.existsImpl(primaryOnly, accessCondition, options), options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:14,代碼來源:CloudFile.java

示例13: exists

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
@DoesServiceRequest
private boolean exists(final boolean primaryOnly, final AccessCondition accessCondition,
        BlobRequestOptions options, OperationContext opContext) throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = BlobRequestOptions.applyDefaults(options, BlobType.UNSPECIFIED, this.blobServiceClient);

    return ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
            this.existsImpl(primaryOnly, accessCondition, options), options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:14,代碼來源:CloudBlobContainer.java

示例14: exists

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
@DoesServiceRequest
private boolean exists(final boolean primaryOnly, final AccessCondition accessCondition,
        FileRequestOptions options, OperationContext opContext) throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);

    return ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
            this.existsImpl(primaryOnly, accessCondition, options), options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:Azure,項目名稱:azure-storage-android,代碼行數:14,代碼來源:CloudFileDirectory.java

示例15: exists

import com.microsoft.azure.storage.core.ExecutionEngine; //導入依賴的package包/類
@DoesServiceRequest
private final boolean exists(final boolean primaryOnly, final AccessCondition accessCondition,
        FileRequestOptions options, OperationContext opContext) throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = FileRequestOptions.applyDefaults(options, this.fileServiceClient);

    return ExecutionEngine.executeWithRetry(this.fileServiceClient, this,
            this.existsImpl(primaryOnly, accessCondition, options), options.getRetryPolicyFactory(), opContext);
}
 
開發者ID:horizon-institute,項目名稱:runspotrun-android-client,代碼行數:14,代碼來源:CloudFile.java


注:本文中的com.microsoft.azure.storage.core.ExecutionEngine類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。