/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
/** * Creates a ServiceCall from a Single object and a callback. * * @param single the single to create from * @param callback the callback to call when events happen * @param <T> the type of the response * @return the created ServiceCall */ public static <T> ServiceFuture<T> fromBody(final Single<T> single, final ServiceCallback<T> callback) { final ServiceFuture<T> serviceFuture = new ServiceFuture<>(); serviceFuture.subscription = single .subscribe(new Consumer<T>() { @Override public void accept(T t) { if (callback != null) { callback.success(t); } serviceFuture.complete(t); } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { if (callback != null) { callback.failure(throwable); } serviceFuture.completeExceptionally(throwable); } }); return serviceFuture; }
@Override public void run() { if (callback != null) { callback.success(value); } serviceFuture.complete(value); } }, new Consumer<Throwable>() {
@Override public void accept(Throwable throwable) { if (callback != null) { callback.failure(throwable); } serviceFuture.completeExceptionally(throwable); } }, new Action() {
@Override public void accept(Throwable throwable) { if (callback != null) { callback.failure(throwable); } serviceFuture.completeExceptionally(throwable); } });
/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
@Override public void accept(T t) { if (callback != null) { callback.success(t); } serviceFuture.complete(t); } }, new Consumer<Throwable>() {
@Override public void accept(Throwable throwable) { if (callback != null) { callback.failure(throwable); } serviceFuture.completeExceptionally(throwable); } });
/** * Creates a ServiceFuture from an Completable object and a callback. * * @param completable the completable to create from * @param callback the callback to call when event happen * @return the created ServiceFuture */ public static ServiceFuture<Void> fromBody(final Completable completable, final ServiceCallback<Void> callback) { final ServiceFuture<Void> serviceFuture = new ServiceFuture<>(); completable.subscribe(new Action() { Void value = null; @Override public void run() { if (callback != null) { callback.success(value); } serviceFuture.complete(value); } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { if (callback != null) { callback.failure(throwable); } serviceFuture.completeExceptionally(throwable); } }); return serviceFuture; };
/** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. * * @param context The context to associate with this operation. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<StorageServiceProperties> getPropertiesAsync(Context context, Integer timeout, String requestId, ServiceCallback<StorageServiceProperties> serviceCallback) { return ServiceFuture.fromBody(getPropertiesAsync(context, timeout, requestId), serviceCallback); }
@Override public void accept(T t) { if (callback != null) { callback.success(t); } serviceFuture.complete(t); } }, new Consumer<Throwable>() {
final ServiceFuture<T> serviceFuture = new ServiceFuture<>(); serviceFuture.subscription = maybe .subscribe(new Consumer<T>() {
/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
@Override public void run() throws Exception { if (callback != null) { callback.success(null); } serviceFuture.complete(null); } });
/** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account. * * @param context The context to associate with this operation. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<StorageServiceStats> getStatisticsAsync(Context context, Integer timeout, String requestId, ServiceCallback<StorageServiceStats> serviceCallback) { return ServiceFuture.fromBody(getStatisticsAsync(context, timeout, requestId), serviceCallback); }
/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
/** * Returns the sku name and account kind. * * @param context The context to associate with this operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getAccountInfoAsync(Context context, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getAccountInfoAsync(context), serviceCallback); }
/** * Undelete a blob that was previously soft deleted. * * @param context The context to associate with this operation. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> undeleteAsync(Context context, Integer timeout, String requestId, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(undeleteAsync(context, timeout, requestId), serviceCallback); }
/** * returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs. * * @param context The context to associate with this operation. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. * @param leaseAccessConditions Additional parameters for the operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ public ServiceFuture<Void> getPropertiesAsync(Context context, Integer timeout, String requestId, LeaseAccessConditions leaseAccessConditions, ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromBody(getPropertiesAsync(context, timeout, requestId, leaseAccessConditions), serviceCallback); }