
software.amazon.awssdk.services.backup.DefaultBackupAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.backup;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.backup.model.AlreadyExistsException;
import software.amazon.awssdk.services.backup.model.BackupException;
import software.amazon.awssdk.services.backup.model.BackupRequest;
import software.amazon.awssdk.services.backup.model.CancelLegalHoldRequest;
import software.amazon.awssdk.services.backup.model.CancelLegalHoldResponse;
import software.amazon.awssdk.services.backup.model.ConflictException;
import software.amazon.awssdk.services.backup.model.CreateBackupPlanRequest;
import software.amazon.awssdk.services.backup.model.CreateBackupPlanResponse;
import software.amazon.awssdk.services.backup.model.CreateBackupSelectionRequest;
import software.amazon.awssdk.services.backup.model.CreateBackupSelectionResponse;
import software.amazon.awssdk.services.backup.model.CreateBackupVaultRequest;
import software.amazon.awssdk.services.backup.model.CreateBackupVaultResponse;
import software.amazon.awssdk.services.backup.model.CreateFrameworkRequest;
import software.amazon.awssdk.services.backup.model.CreateFrameworkResponse;
import software.amazon.awssdk.services.backup.model.CreateLegalHoldRequest;
import software.amazon.awssdk.services.backup.model.CreateLegalHoldResponse;
import software.amazon.awssdk.services.backup.model.CreateReportPlanRequest;
import software.amazon.awssdk.services.backup.model.CreateReportPlanResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupPlanRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupPlanResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupSelectionRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupSelectionResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultAccessPolicyRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultAccessPolicyResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultLockConfigurationRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultLockConfigurationResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultNotificationsRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultNotificationsResponse;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultRequest;
import software.amazon.awssdk.services.backup.model.DeleteBackupVaultResponse;
import software.amazon.awssdk.services.backup.model.DeleteFrameworkRequest;
import software.amazon.awssdk.services.backup.model.DeleteFrameworkResponse;
import software.amazon.awssdk.services.backup.model.DeleteRecoveryPointRequest;
import software.amazon.awssdk.services.backup.model.DeleteRecoveryPointResponse;
import software.amazon.awssdk.services.backup.model.DeleteReportPlanRequest;
import software.amazon.awssdk.services.backup.model.DeleteReportPlanResponse;
import software.amazon.awssdk.services.backup.model.DependencyFailureException;
import software.amazon.awssdk.services.backup.model.DescribeBackupJobRequest;
import software.amazon.awssdk.services.backup.model.DescribeBackupJobResponse;
import software.amazon.awssdk.services.backup.model.DescribeBackupVaultRequest;
import software.amazon.awssdk.services.backup.model.DescribeBackupVaultResponse;
import software.amazon.awssdk.services.backup.model.DescribeCopyJobRequest;
import software.amazon.awssdk.services.backup.model.DescribeCopyJobResponse;
import software.amazon.awssdk.services.backup.model.DescribeFrameworkRequest;
import software.amazon.awssdk.services.backup.model.DescribeFrameworkResponse;
import software.amazon.awssdk.services.backup.model.DescribeGlobalSettingsRequest;
import software.amazon.awssdk.services.backup.model.DescribeGlobalSettingsResponse;
import software.amazon.awssdk.services.backup.model.DescribeProtectedResourceRequest;
import software.amazon.awssdk.services.backup.model.DescribeProtectedResourceResponse;
import software.amazon.awssdk.services.backup.model.DescribeRecoveryPointRequest;
import software.amazon.awssdk.services.backup.model.DescribeRecoveryPointResponse;
import software.amazon.awssdk.services.backup.model.DescribeRegionSettingsRequest;
import software.amazon.awssdk.services.backup.model.DescribeRegionSettingsResponse;
import software.amazon.awssdk.services.backup.model.DescribeReportJobRequest;
import software.amazon.awssdk.services.backup.model.DescribeReportJobResponse;
import software.amazon.awssdk.services.backup.model.DescribeReportPlanRequest;
import software.amazon.awssdk.services.backup.model.DescribeReportPlanResponse;
import software.amazon.awssdk.services.backup.model.DescribeRestoreJobRequest;
import software.amazon.awssdk.services.backup.model.DescribeRestoreJobResponse;
import software.amazon.awssdk.services.backup.model.DisassociateRecoveryPointFromParentRequest;
import software.amazon.awssdk.services.backup.model.DisassociateRecoveryPointFromParentResponse;
import software.amazon.awssdk.services.backup.model.DisassociateRecoveryPointRequest;
import software.amazon.awssdk.services.backup.model.DisassociateRecoveryPointResponse;
import software.amazon.awssdk.services.backup.model.ExportBackupPlanTemplateRequest;
import software.amazon.awssdk.services.backup.model.ExportBackupPlanTemplateResponse;
import software.amazon.awssdk.services.backup.model.GetBackupPlanFromJsonRequest;
import software.amazon.awssdk.services.backup.model.GetBackupPlanFromJsonResponse;
import software.amazon.awssdk.services.backup.model.GetBackupPlanFromTemplateRequest;
import software.amazon.awssdk.services.backup.model.GetBackupPlanFromTemplateResponse;
import software.amazon.awssdk.services.backup.model.GetBackupPlanRequest;
import software.amazon.awssdk.services.backup.model.GetBackupPlanResponse;
import software.amazon.awssdk.services.backup.model.GetBackupSelectionRequest;
import software.amazon.awssdk.services.backup.model.GetBackupSelectionResponse;
import software.amazon.awssdk.services.backup.model.GetBackupVaultAccessPolicyRequest;
import software.amazon.awssdk.services.backup.model.GetBackupVaultAccessPolicyResponse;
import software.amazon.awssdk.services.backup.model.GetBackupVaultNotificationsRequest;
import software.amazon.awssdk.services.backup.model.GetBackupVaultNotificationsResponse;
import software.amazon.awssdk.services.backup.model.GetLegalHoldRequest;
import software.amazon.awssdk.services.backup.model.GetLegalHoldResponse;
import software.amazon.awssdk.services.backup.model.GetRecoveryPointRestoreMetadataRequest;
import software.amazon.awssdk.services.backup.model.GetRecoveryPointRestoreMetadataResponse;
import software.amazon.awssdk.services.backup.model.GetSupportedResourceTypesRequest;
import software.amazon.awssdk.services.backup.model.GetSupportedResourceTypesResponse;
import software.amazon.awssdk.services.backup.model.InvalidParameterValueException;
import software.amazon.awssdk.services.backup.model.InvalidRequestException;
import software.amazon.awssdk.services.backup.model.InvalidResourceStateException;
import software.amazon.awssdk.services.backup.model.LimitExceededException;
import software.amazon.awssdk.services.backup.model.ListBackupJobsRequest;
import software.amazon.awssdk.services.backup.model.ListBackupJobsResponse;
import software.amazon.awssdk.services.backup.model.ListBackupPlanTemplatesRequest;
import software.amazon.awssdk.services.backup.model.ListBackupPlanTemplatesResponse;
import software.amazon.awssdk.services.backup.model.ListBackupPlanVersionsRequest;
import software.amazon.awssdk.services.backup.model.ListBackupPlanVersionsResponse;
import software.amazon.awssdk.services.backup.model.ListBackupPlansRequest;
import software.amazon.awssdk.services.backup.model.ListBackupPlansResponse;
import software.amazon.awssdk.services.backup.model.ListBackupSelectionsRequest;
import software.amazon.awssdk.services.backup.model.ListBackupSelectionsResponse;
import software.amazon.awssdk.services.backup.model.ListBackupVaultsRequest;
import software.amazon.awssdk.services.backup.model.ListBackupVaultsResponse;
import software.amazon.awssdk.services.backup.model.ListCopyJobsRequest;
import software.amazon.awssdk.services.backup.model.ListCopyJobsResponse;
import software.amazon.awssdk.services.backup.model.ListFrameworksRequest;
import software.amazon.awssdk.services.backup.model.ListFrameworksResponse;
import software.amazon.awssdk.services.backup.model.ListLegalHoldsRequest;
import software.amazon.awssdk.services.backup.model.ListLegalHoldsResponse;
import software.amazon.awssdk.services.backup.model.ListProtectedResourcesRequest;
import software.amazon.awssdk.services.backup.model.ListProtectedResourcesResponse;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByBackupVaultRequest;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByBackupVaultResponse;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByLegalHoldRequest;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByLegalHoldResponse;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceRequest;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceResponse;
import software.amazon.awssdk.services.backup.model.ListReportJobsRequest;
import software.amazon.awssdk.services.backup.model.ListReportJobsResponse;
import software.amazon.awssdk.services.backup.model.ListReportPlansRequest;
import software.amazon.awssdk.services.backup.model.ListReportPlansResponse;
import software.amazon.awssdk.services.backup.model.ListRestoreJobsRequest;
import software.amazon.awssdk.services.backup.model.ListRestoreJobsResponse;
import software.amazon.awssdk.services.backup.model.ListTagsRequest;
import software.amazon.awssdk.services.backup.model.ListTagsResponse;
import software.amazon.awssdk.services.backup.model.MissingParameterValueException;
import software.amazon.awssdk.services.backup.model.PutBackupVaultAccessPolicyRequest;
import software.amazon.awssdk.services.backup.model.PutBackupVaultAccessPolicyResponse;
import software.amazon.awssdk.services.backup.model.PutBackupVaultLockConfigurationRequest;
import software.amazon.awssdk.services.backup.model.PutBackupVaultLockConfigurationResponse;
import software.amazon.awssdk.services.backup.model.PutBackupVaultNotificationsRequest;
import software.amazon.awssdk.services.backup.model.PutBackupVaultNotificationsResponse;
import software.amazon.awssdk.services.backup.model.ResourceNotFoundException;
import software.amazon.awssdk.services.backup.model.ServiceUnavailableException;
import software.amazon.awssdk.services.backup.model.StartBackupJobRequest;
import software.amazon.awssdk.services.backup.model.StartBackupJobResponse;
import software.amazon.awssdk.services.backup.model.StartCopyJobRequest;
import software.amazon.awssdk.services.backup.model.StartCopyJobResponse;
import software.amazon.awssdk.services.backup.model.StartReportJobRequest;
import software.amazon.awssdk.services.backup.model.StartReportJobResponse;
import software.amazon.awssdk.services.backup.model.StartRestoreJobRequest;
import software.amazon.awssdk.services.backup.model.StartRestoreJobResponse;
import software.amazon.awssdk.services.backup.model.StopBackupJobRequest;
import software.amazon.awssdk.services.backup.model.StopBackupJobResponse;
import software.amazon.awssdk.services.backup.model.TagResourceRequest;
import software.amazon.awssdk.services.backup.model.TagResourceResponse;
import software.amazon.awssdk.services.backup.model.UntagResourceRequest;
import software.amazon.awssdk.services.backup.model.UntagResourceResponse;
import software.amazon.awssdk.services.backup.model.UpdateBackupPlanRequest;
import software.amazon.awssdk.services.backup.model.UpdateBackupPlanResponse;
import software.amazon.awssdk.services.backup.model.UpdateFrameworkRequest;
import software.amazon.awssdk.services.backup.model.UpdateFrameworkResponse;
import software.amazon.awssdk.services.backup.model.UpdateGlobalSettingsRequest;
import software.amazon.awssdk.services.backup.model.UpdateGlobalSettingsResponse;
import software.amazon.awssdk.services.backup.model.UpdateRecoveryPointLifecycleRequest;
import software.amazon.awssdk.services.backup.model.UpdateRecoveryPointLifecycleResponse;
import software.amazon.awssdk.services.backup.model.UpdateRegionSettingsRequest;
import software.amazon.awssdk.services.backup.model.UpdateRegionSettingsResponse;
import software.amazon.awssdk.services.backup.model.UpdateReportPlanRequest;
import software.amazon.awssdk.services.backup.model.UpdateReportPlanResponse;
import software.amazon.awssdk.services.backup.paginators.ListBackupJobsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListBackupPlanTemplatesPublisher;
import software.amazon.awssdk.services.backup.paginators.ListBackupPlanVersionsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListBackupPlansPublisher;
import software.amazon.awssdk.services.backup.paginators.ListBackupSelectionsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListBackupVaultsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListCopyJobsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListFrameworksPublisher;
import software.amazon.awssdk.services.backup.paginators.ListLegalHoldsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListProtectedResourcesPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByBackupVaultPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByLegalHoldPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByResourcePublisher;
import software.amazon.awssdk.services.backup.paginators.ListReportJobsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListReportPlansPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRestoreJobsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListTagsPublisher;
import software.amazon.awssdk.services.backup.transform.CancelLegalHoldRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateBackupPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateBackupSelectionRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateFrameworkRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateLegalHoldRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.CreateReportPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupSelectionRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultAccessPolicyRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultLockConfigurationRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultNotificationsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteFrameworkRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteReportPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeBackupJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeCopyJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeFrameworkRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeGlobalSettingsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeProtectedResourceRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeRegionSettingsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeReportJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeReportPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeRestoreJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DisassociateRecoveryPointFromParentRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DisassociateRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ExportBackupPlanTemplateRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupPlanFromJsonRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupPlanFromTemplateRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupSelectionRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupVaultAccessPolicyRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetBackupVaultNotificationsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetLegalHoldRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetRecoveryPointRestoreMetadataRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.GetSupportedResourceTypesRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupJobsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupPlanTemplatesRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupPlanVersionsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupPlansRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupSelectionsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListBackupVaultsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListCopyJobsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListFrameworksRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListLegalHoldsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListProtectedResourcesRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRecoveryPointsByBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRecoveryPointsByLegalHoldRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRecoveryPointsByResourceRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListReportJobsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListReportPlansRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRestoreJobsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListTagsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.PutBackupVaultAccessPolicyRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.PutBackupVaultLockConfigurationRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.PutBackupVaultNotificationsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StartBackupJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StartCopyJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StartReportJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StartRestoreJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StopBackupJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateBackupPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateFrameworkRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateGlobalSettingsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateRecoveryPointLifecycleRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateRegionSettingsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.UpdateReportPlanRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link BackupAsyncClient}.
*
* @see BackupAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultBackupAsyncClient implements BackupAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultBackupAsyncClient.class);
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultBackupAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* This action removes the specified legal hold on a recovery point. This action can only be performed by a user
* with sufficient permissions.
*
*
* @param cancelLegalHoldRequest
* @return A Java Future containing the result of the CancelLegalHold operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - InvalidResourceStateException Backup is already performing an action on this recovery point. It can't
* perform the action you requested until the first action finishes. Try again later.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CancelLegalHold
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture cancelLegalHold(CancelLegalHoldRequest cancelLegalHoldRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelLegalHoldRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelLegalHold");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CancelLegalHoldResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CancelLegalHold")
.withMarshaller(new CancelLegalHoldRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(cancelLegalHoldRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a backup plan using a backup plan name and backup rules. A backup plan is a document that contains
* information that Backup uses to schedule tasks that create recovery points for resources.
*
*
* If you call CreateBackupPlan
with a plan that already exists, you receive an
* AlreadyExistsException
exception.
*
*
* @param createBackupPlanRequest
* @return A Java Future containing the result of the CreateBackupPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - AlreadyExistsException The required resource already exists.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateBackupPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createBackupPlan(CreateBackupPlanRequest createBackupPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createBackupPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBackupPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateBackupPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateBackupPlan")
.withMarshaller(new CreateBackupPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createBackupPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a JSON document that specifies a set of resources to assign to a backup plan. For examples, see Assigning resources programmatically.
*
*
* @param createBackupSelectionRequest
* @return A Java Future containing the result of the CreateBackupSelection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - AlreadyExistsException The required resource already exists.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateBackupSelection
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createBackupSelection(
CreateBackupSelectionRequest createBackupSelectionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createBackupSelectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBackupSelection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateBackupSelectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateBackupSelection")
.withMarshaller(new CreateBackupSelectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createBackupSelectionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a logical container where backups are stored. A CreateBackupVault
request includes a name,
* optionally one or more resource tags, an encryption key, and a request ID.
*
*
*
* Do not include sensitive data, such as passport numbers, in the name of a backup vault.
*
*
*
* @param createBackupVaultRequest
* @return A Java Future containing the result of the CreateBackupVault operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - AlreadyExistsException The required resource already exists.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateBackupVault
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createBackupVault(CreateBackupVaultRequest createBackupVaultRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createBackupVaultRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBackupVault");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateBackupVaultResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateBackupVault")
.withMarshaller(new CreateBackupVaultRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createBackupVaultRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a framework with one or more controls. A framework is a collection of controls that you can use to
* evaluate your backup practices. By using pre-built customizable controls to define your policies, you can
* evaluate whether your backup practices comply with your policies and which resources are not yet in compliance.
*
*
* @param createFrameworkRequest
* @return A Java Future containing the result of the CreateFramework operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - AlreadyExistsException The required resource already exists.
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateFramework
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createFramework(CreateFrameworkRequest createFrameworkRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFrameworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFramework");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateFrameworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFramework")
.withMarshaller(new CreateFrameworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createFrameworkRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* This action creates a legal hold on a recovery point (backup). A legal hold is a restraint on altering or
* deleting a backup until an authorized user cancels the legal hold. Any actions to delete or disassociate a
* recovery point will fail with an error if one or more active legal holds are on the recovery point.
*
*
* @param createLegalHoldRequest
* @return A Java Future containing the result of the CreateLegalHold operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateLegalHold
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createLegalHold(CreateLegalHoldRequest createLegalHoldRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createLegalHoldRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLegalHold");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateLegalHoldResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateLegalHold")
.withMarshaller(new CreateLegalHoldRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createLegalHoldRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a report plan. A report plan is a document that contains information about the contents of the report and
* where Backup will deliver it.
*
*
* If you call CreateReportPlan
with a plan that already exists, you receive an
* AlreadyExistsException
exception.
*
*
* @param createReportPlanRequest
* @return A Java Future containing the result of the CreateReportPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - AlreadyExistsException The required resource already exists.
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.CreateReportPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createReportPlan(CreateReportPlanRequest createReportPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReportPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReportPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReportPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateReportPlan")
.withMarshaller(new CreateReportPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createReportPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a backup plan. A backup plan can only be deleted after all associated selections of resources have been
* deleted. Deleting a backup plan deletes the current version of a backup plan. Previous versions, if any, will
* still exist.
*
*
* @param deleteBackupPlanRequest
* @return A Java Future containing the result of the DeleteBackupPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteBackupPlan(DeleteBackupPlanRequest deleteBackupPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBackupPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteBackupPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupPlan")
.withMarshaller(new DeleteBackupPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the resource selection associated with a backup plan that is specified by the SelectionId
.
*
*
* @param deleteBackupSelectionRequest
* @return A Java Future containing the result of the DeleteBackupSelection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupSelection
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteBackupSelection(
DeleteBackupSelectionRequest deleteBackupSelectionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBackupSelectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupSelection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteBackupSelectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupSelection")
.withMarshaller(new DeleteBackupSelectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupSelectionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the backup vault identified by its name. A vault can be deleted only if it is empty.
*
*
* @param deleteBackupVaultRequest
* @return A Java Future containing the result of the DeleteBackupVault operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupVault
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteBackupVault(DeleteBackupVaultRequest deleteBackupVaultRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBackupVaultRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupVault");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteBackupVaultResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupVault")
.withMarshaller(new DeleteBackupVaultRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupVaultRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the policy document that manages permissions on a backup vault.
*
*
* @param deleteBackupVaultAccessPolicyRequest
* @return A Java Future containing the result of the DeleteBackupVaultAccessPolicy operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupVaultAccessPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteBackupVaultAccessPolicy(
DeleteBackupVaultAccessPolicyRequest deleteBackupVaultAccessPolicyRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteBackupVaultAccessPolicyRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupVaultAccessPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteBackupVaultAccessPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupVaultAccessPolicy")
.withMarshaller(new DeleteBackupVaultAccessPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupVaultAccessPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes Backup Vault Lock from a backup vault specified by a backup vault name.
*
*
* If the Vault Lock configuration is immutable, then you cannot delete Vault Lock using API operations, and you
* will receive an InvalidRequestException
if you attempt to do so. For more information, see Vault Lock in the Backup
* Developer Guide.
*
*
* @param deleteBackupVaultLockConfigurationRequest
* @return A Java Future containing the result of the DeleteBackupVaultLockConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupVaultLockConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteBackupVaultLockConfiguration(
DeleteBackupVaultLockConfigurationRequest deleteBackupVaultLockConfigurationRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteBackupVaultLockConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupVaultLockConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteBackupVaultLockConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupVaultLockConfiguration")
.withMarshaller(new DeleteBackupVaultLockConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupVaultLockConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes event notifications for the specified backup vault.
*
*
* @param deleteBackupVaultNotificationsRequest
* @return A Java Future containing the result of the DeleteBackupVaultNotifications operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteBackupVaultNotifications
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteBackupVaultNotifications(
DeleteBackupVaultNotificationsRequest deleteBackupVaultNotificationsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteBackupVaultNotificationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBackupVaultNotifications");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteBackupVaultNotificationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteBackupVaultNotifications")
.withMarshaller(new DeleteBackupVaultNotificationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteBackupVaultNotificationsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the framework specified by a framework name.
*
*
* @param deleteFrameworkRequest
* @return A Java Future containing the result of the DeleteFramework operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ConflictException Backup can't perform the action that you requested until it finishes performing a
* previous action. Try again later.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteFramework
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteFramework(DeleteFrameworkRequest deleteFrameworkRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFrameworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFramework");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFrameworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFramework")
.withMarshaller(new DeleteFrameworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFrameworkRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the recovery point specified by a recovery point ID.
*
*
* If the recovery point ID belongs to a continuous backup, calling this endpoint deletes the existing continuous
* backup and stops future continuous backup.
*
*
* When an IAM role's permissions are insufficient to call this API, the service sends back an HTTP 200 response
* with an empty HTTP body, but the recovery point is not deleted. Instead, it enters an EXPIRED
state.
*
*
* EXPIRED
recovery points can be deleted with this API once the IAM role has the
* iam:CreateServiceLinkedRole
action. To learn more about adding this role, see
* Troubleshooting manual deletions.
*
*
* If the user or role is deleted or the permission within the role is removed, the deletion will not be successful
* and will enter an EXPIRED
state.
*
*
* @param deleteRecoveryPointRequest
* @return A Java Future containing the result of the DeleteRecoveryPoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidResourceStateException Backup is already performing an action on this recovery point. It can't
* perform the action you requested until the first action finishes. Try again later.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteRecoveryPoint
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteRecoveryPoint(
DeleteRecoveryPointRequest deleteRecoveryPointRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecoveryPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecoveryPoint");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteRecoveryPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteRecoveryPoint")
.withMarshaller(new DeleteRecoveryPointRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteRecoveryPointRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the report plan specified by a report plan name.
*
*
* @param deleteReportPlanRequest
* @return A Java Future containing the result of the DeleteReportPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - ConflictException Backup can't perform the action that you requested until it finishes performing a
* previous action. Try again later.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DeleteReportPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteReportPlan(DeleteReportPlanRequest deleteReportPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReportPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReportPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReportPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReportPlan")
.withMarshaller(new DeleteReportPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteReportPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns backup job details for the specified BackupJobId
.
*
*
* @param describeBackupJobRequest
* @return A Java Future containing the result of the DescribeBackupJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - DependencyFailureException A dependent Amazon Web Services service or resource returned an error to
* the Backup service, and the action cannot be completed.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeBackupJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeBackupJob(DescribeBackupJobRequest describeBackupJobRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBackupJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBackupJob");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeBackupJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeBackupJob")
.withMarshaller(new DescribeBackupJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeBackupJobRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata about a backup vault specified by its name.
*
*
* @param describeBackupVaultRequest
* @return A Java Future containing the result of the DescribeBackupVault operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeBackupVault
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeBackupVault(
DescribeBackupVaultRequest describeBackupVaultRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeBackupVaultRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeBackupVault");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeBackupVaultResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeBackupVault")
.withMarshaller(new DescribeBackupVaultRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeBackupVaultRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata associated with creating a copy of a resource.
*
*
* @param describeCopyJobRequest
* @return A Java Future containing the result of the DescribeCopyJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeCopyJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeCopyJob(DescribeCopyJobRequest describeCopyJobRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCopyJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCopyJob");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeCopyJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeCopyJob")
.withMarshaller(new DescribeCopyJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeCopyJobRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the framework details for the specified FrameworkName
.
*
*
* @param describeFrameworkRequest
* @return A Java Future containing the result of the DescribeFramework operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeFramework
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeFramework(DescribeFrameworkRequest describeFrameworkRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFrameworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFramework");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeFrameworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeFramework")
.withMarshaller(new DescribeFrameworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeFrameworkRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes whether the Amazon Web Services account is opted in to cross-account backup. Returns an error if the
* account is not a member of an Organizations organization. Example:
* describe-global-settings --region us-west-2
*
*
* @param describeGlobalSettingsRequest
* @return A Java Future containing the result of the DescribeGlobalSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeGlobalSettings
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeGlobalSettings(
DescribeGlobalSettingsRequest describeGlobalSettingsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeGlobalSettingsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeGlobalSettings");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeGlobalSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeGlobalSettings")
.withMarshaller(new DescribeGlobalSettingsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeGlobalSettingsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about a saved resource, including the last time it was backed up, its Amazon Resource Name
* (ARN), and the Amazon Web Services service type of the saved resource.
*
*
* @param describeProtectedResourceRequest
* @return A Java Future containing the result of the DescribeProtectedResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeProtectedResource
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeProtectedResource(
DescribeProtectedResourceRequest describeProtectedResourceRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProtectedResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProtectedResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeProtectedResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeProtectedResource")
.withMarshaller(new DescribeProtectedResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeProtectedResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata associated with a recovery point, including ID, status, encryption, and lifecycle.
*
*
* @param describeRecoveryPointRequest
* @return A Java Future containing the result of the DescribeRecoveryPoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeRecoveryPoint
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeRecoveryPoint(
DescribeRecoveryPointRequest describeRecoveryPointRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRecoveryPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRecoveryPoint");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRecoveryPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRecoveryPoint")
.withMarshaller(new DescribeRecoveryPointRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeRecoveryPointRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the current service opt-in settings for the Region. If service opt-in is enabled for a service, Backup
* tries to protect that service's resources in this Region, when the resource is included in an on-demand backup or
* scheduled backup plan. Otherwise, Backup does not try to protect that service's resources in this Region.
*
*
* @param describeRegionSettingsRequest
* @return A Java Future containing the result of the DescribeRegionSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeRegionSettings
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeRegionSettings(
DescribeRegionSettingsRequest describeRegionSettingsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRegionSettingsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRegionSettings");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRegionSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRegionSettings")
.withMarshaller(new DescribeRegionSettingsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeRegionSettingsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the details associated with creating a report as specified by its ReportJobId
.
*
*
* @param describeReportJobRequest
* @return A Java Future containing the result of the DescribeReportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeReportJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeReportJob(DescribeReportJobRequest describeReportJobRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeReportJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeReportJob");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeReportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeReportJob")
.withMarshaller(new DescribeReportJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeReportJobRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of all report plans for an Amazon Web Services account and Amazon Web Services Region.
*
*
* @param describeReportPlanRequest
* @return A Java Future containing the result of the DescribeReportPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeReportPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeReportPlan(DescribeReportPlanRequest describeReportPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeReportPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeReportPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeReportPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeReportPlan")
.withMarshaller(new DescribeReportPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeReportPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata associated with a restore job that is specified by a job ID.
*
*
* @param describeRestoreJobRequest
* @return A Java Future containing the result of the DescribeRestoreJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - DependencyFailureException A dependent Amazon Web Services service or resource returned an error to
* the Backup service, and the action cannot be completed.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DescribeRestoreJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeRestoreJob(DescribeRestoreJobRequest describeRestoreJobRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRestoreJobRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRestoreJob");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRestoreJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRestoreJob")
.withMarshaller(new DescribeRestoreJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(describeRestoreJobRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified continuous backup recovery point from Backup and releases control of that continuous backup
* to the source service, such as Amazon RDS. The source service will continue to create and retain continuous
* backups using the lifecycle that you specified in your original backup plan.
*
*
* Does not support snapshot backup recovery points.
*
*
* @param disassociateRecoveryPointRequest
* @return A Java Future containing the result of the DisassociateRecoveryPoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - InvalidResourceStateException Backup is already performing an action on this recovery point. It can't
* perform the action you requested until the first action finishes. Try again later.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DisassociateRecoveryPoint
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateRecoveryPoint(
DisassociateRecoveryPointRequest disassociateRecoveryPointRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateRecoveryPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateRecoveryPoint");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateRecoveryPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateRecoveryPoint")
.withMarshaller(new DisassociateRecoveryPointRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(disassociateRecoveryPointRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* This action to a specific child (nested) recovery point removes the relationship between the specified recovery
* point and its parent (composite) recovery point.
*
*
* @param disassociateRecoveryPointFromParentRequest
* @return A Java Future containing the result of the DisassociateRecoveryPointFromParent operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.DisassociateRecoveryPointFromParent
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateRecoveryPointFromParent(
DisassociateRecoveryPointFromParentRequest disassociateRecoveryPointFromParentRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
disassociateRecoveryPointFromParentRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateRecoveryPointFromParent");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DisassociateRecoveryPointFromParentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateRecoveryPointFromParent")
.withMarshaller(new DisassociateRecoveryPointFromParentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(disassociateRecoveryPointFromParentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the backup plan that is specified by the plan ID as a backup template.
*
*
* @param exportBackupPlanTemplateRequest
* @return A Java Future containing the result of the ExportBackupPlanTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.ExportBackupPlanTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture exportBackupPlanTemplate(
ExportBackupPlanTemplateRequest exportBackupPlanTemplateRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, exportBackupPlanTemplateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ExportBackupPlanTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ExportBackupPlanTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ExportBackupPlanTemplate")
.withMarshaller(new ExportBackupPlanTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(exportBackupPlanTemplateRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns BackupPlan
details for the specified BackupPlanId
. The details are the body of
* a backup plan in JSON format, in addition to plan metadata.
*
*
* @param getBackupPlanRequest
* @return A Java Future containing the result of the GetBackupPlan operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getBackupPlan(GetBackupPlanRequest getBackupPlanRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupPlanRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupPlan");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetBackupPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetBackupPlan")
.withMarshaller(new GetBackupPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getBackupPlanRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a valid JSON document specifying a backup plan or an error.
*
*
* @param getBackupPlanFromJsonRequest
* @return A Java Future containing the result of the GetBackupPlanFromJSON operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LimitExceededException A limit in the request has been exceeded; for example, a maximum number of
* items allowed in a request.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - InvalidRequestException Indicates that something is wrong with the input to the request. For example,
* a parameter is of the wrong type.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupPlanFromJSON
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getBackupPlanFromJSON(
GetBackupPlanFromJsonRequest getBackupPlanFromJsonRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupPlanFromJsonRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupPlanFromJSON");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBackupPlanFromJsonResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetBackupPlanFromJSON")
.withMarshaller(new GetBackupPlanFromJsonRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getBackupPlanFromJsonRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the template specified by its templateId
as a backup plan.
*
*
* @param getBackupPlanFromTemplateRequest
* @return A Java Future containing the result of the GetBackupPlanFromTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupPlanFromTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture getBackupPlanFromTemplate(
GetBackupPlanFromTemplateRequest getBackupPlanFromTemplateRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupPlanFromTemplateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupPlanFromTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBackupPlanFromTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetBackupPlanFromTemplate")
.withMarshaller(new GetBackupPlanFromTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getBackupPlanFromTemplateRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns selection metadata and a document in JSON format that specifies a list of resources that are associated
* with a backup plan.
*
*
* @param getBackupSelectionRequest
* @return A Java Future containing the result of the GetBackupSelection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupSelection
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getBackupSelection(GetBackupSelectionRequest getBackupSelectionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupSelectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupSelection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBackupSelectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetBackupSelection")
.withMarshaller(new GetBackupSelectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getBackupSelectionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the access policy document that is associated with the named backup vault.
*
*
* @param getBackupVaultAccessPolicyRequest
* @return A Java Future containing the result of the GetBackupVaultAccessPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupVaultAccessPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture getBackupVaultAccessPolicy(
GetBackupVaultAccessPolicyRequest getBackupVaultAccessPolicyRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupVaultAccessPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupVaultAccessPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBackupVaultAccessPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetBackupVaultAccessPolicy")
.withMarshaller(new GetBackupVaultAccessPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getBackupVaultAccessPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns event notifications for the specified backup vault.
*
*
* @param getBackupVaultNotificationsRequest
* @return A Java Future containing the result of the GetBackupVaultNotifications operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException A resource that is required for the action doesn't exist.
* - InvalidParameterValueException Indicates that something is wrong with a parameter's value. For
* example, the value is out of range.
* - MissingParameterValueException Indicates that a required parameter is missing.
* - ServiceUnavailableException The request failed due to a temporary failure of the server.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - BackupException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample BackupAsyncClient.GetBackupVaultNotifications
* @see AWS API Documentation
*/
@Override
public CompletableFuture getBackupVaultNotifications(
GetBackupVaultNotificationsRequest getBackupVaultNotificationsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBackupVaultNotificationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Backup");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBackupVaultNotifications");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBackupVaultNotificationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams