
software.amazon.awssdk.services.backup.DefaultBackupAsyncClient Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.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.client.config.SdkClientConfiguration;
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.util.VersionInfo;
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.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.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.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.DeleteRecoveryPointRequest;
import software.amazon.awssdk.services.backup.model.DeleteRecoveryPointResponse;
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.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.DescribeRestoreJobRequest;
import software.amazon.awssdk.services.backup.model.DescribeRestoreJobResponse;
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.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.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.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.ListRecoveryPointsByResourceRequest;
import software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceResponse;
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.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.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.UpdateRecoveryPointLifecycleRequest;
import software.amazon.awssdk.services.backup.model.UpdateRecoveryPointLifecycleResponse;
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.ListProtectedResourcesPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByBackupVaultPublisher;
import software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByResourcePublisher;
import software.amazon.awssdk.services.backup.paginators.ListRestoreJobsPublisher;
import software.amazon.awssdk.services.backup.paginators.ListTagsPublisher;
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.DeleteBackupPlanRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupSelectionRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultAccessPolicyRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultNotificationsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DeleteRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeBackupJobRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeProtectedResourceRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.DescribeRestoreJobRequestMarshaller;
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.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.ListProtectedResourcesRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRecoveryPointsByBackupVaultRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.ListRecoveryPointsByResourceRequestMarshaller;
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.PutBackupVaultNotificationsRequestMarshaller;
import software.amazon.awssdk.services.backup.transform.StartBackupJobRequestMarshaller;
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.UpdateRecoveryPointLifecycleRequestMarshaller;
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;
}
/**
*
* Backup plans are documents that contain information that AWS Backup uses to schedule tasks that create recovery
* points of resources.
*
*
* If you call CreateBackupPlan
with a plan that already exists, the existing backupPlanId
* is returned.
*
*
* @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) {
try {
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)
.withInput(createBackupPlanRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a JSON document that specifies a set of resources to assign to a backup plan. Resources can be included
* by specifying patterns for a ListOfTags
and selected Resources
.
*
*
* For example, consider the following patterns:
*
*
* -
*
* Resources: "arn:aws:ec2:region:account-id:volume/volume-id"
*
*
* -
*
* ConditionKey:"department"
*
*
* ConditionValue:"finance"
*
*
* ConditionType:"StringEquals"
*
*
* -
*
* ConditionKey:"importance"
*
*
* ConditionValue:"critical"
*
*
* ConditionType:"StringEquals"
*
*
*
*
* Using these patterns would back up all Amazon Elastic Block Store (Amazon EBS) volumes that are tagged as
* "department=finance"
, "importance=critical"
, in addition to an EBS volume with the
* specified volume Id.
*
*
* Resources and conditions are additive in that all resources that match the pattern are selected. This shouldn't
* be confused with a logical AND, where all conditions must match. The matching patterns are logically 'put
* together using the OR operator. In other words, all patterns that match are selected for backup.
*
*
* @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) {
try {
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)
.withInput(createBackupSelectionRequest));
return executeFuture;
} catch (Throwable t) {
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.
*
*
*
* Sensitive data, such as passport numbers, should not be included 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) {
try {
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)
.withInput(createBackupVaultRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(deleteBackupPlanRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(deleteBackupSelectionRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(deleteBackupVaultRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(deleteBackupVaultAccessPolicyRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(deleteBackupVaultNotificationsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the recovery point specified by a recovery point ID.
*
*
* @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.
* - 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) {
try {
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)
.withInput(deleteRecoveryPointRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata associated with creating a backup of a resource.
*
*
* @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 AWS service or resource returned an error to the AWS 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) {
try {
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)
.withInput(describeBackupJobRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(describeBackupVaultRequest));
return executeFuture;
} catch (Throwable t) {
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 AWS 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) {
try {
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)
.withInput(describeProtectedResourceRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(describeRecoveryPointRequest));
return executeFuture;
} catch (Throwable t) {
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 AWS service or resource returned an error to the AWS 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) {
try {
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)
.withInput(describeRestoreJobRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(exportBackupPlanTemplateRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns 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) {
try {
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)
.withInput(getBackupPlanRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(getBackupPlanFromJsonRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(getBackupPlanFromTemplateRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(getBackupSelectionRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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)
.withInput(getBackupVaultAccessPolicyRequest));
return executeFuture;
} catch (Throwable t) {
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) {
try {
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()
.withOperationName("GetBackupVaultNotifications")
.withMarshaller(new GetBackupVaultNotificationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(getBackupVaultNotificationsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns two sets of metadata key-value pairs. The first set lists the metadata that the recovery point was
* created with. The second set lists the metadata key-value pairs that are required to restore the recovery point.
*
*
* These sets can be the same, or the restore metadata set can contain different values if the target service to be
* restored has changed since the recovery point was created and now requires additional or different information in
* order to be restored.
*
*
* @param getRecoveryPointRestoreMetadataRequest
* @return A Java Future containing the result of the GetRecoveryPointRestoreMetadata 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.GetRecoveryPointRestoreMetadata
* @see AWS API Documentation
*/
@Override
public CompletableFuture getRecoveryPointRestoreMetadata(
GetRecoveryPointRestoreMetadataRequest getRecoveryPointRestoreMetadataRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetRecoveryPointRestoreMetadataResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetRecoveryPointRestoreMetadata")
.withMarshaller(new GetRecoveryPointRestoreMetadataRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(getRecoveryPointRestoreMetadataRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the AWS resource types supported by AWS Backup.
*
*
* @param getSupportedResourceTypesRequest
* @return A Java Future containing the result of the GetSupportedResourceTypes 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.GetSupportedResourceTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture getSupportedResourceTypes(
GetSupportedResourceTypesRequest getSupportedResourceTypesRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSupportedResourceTypesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetSupportedResourceTypes")
.withMarshaller(new GetSupportedResourceTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(getSupportedResourceTypesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata about your backup jobs.
*
*
* @param listBackupJobsRequest
* @return A Java Future containing the result of the ListBackupJobs 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.
* - 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.ListBackupJobs
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listBackupJobs(ListBackupJobsRequest listBackupJobsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupJobs")
.withMarshaller(new ListBackupJobsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupJobsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata about your backup jobs.
*
*
*
* This is a variant of {@link #listBackupJobs(software.amazon.awssdk.services.backup.model.ListBackupJobsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupJobsPublisher publisher = client.listBackupJobsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupJobsPublisher publisher = client.listBackupJobsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupJobsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupJobs(software.amazon.awssdk.services.backup.model.ListBackupJobsRequest)} operation.
*
*
* @param listBackupJobsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.
* - 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.ListBackupJobs
* @see AWS API
* Documentation
*/
public ListBackupJobsPublisher listBackupJobsPaginator(ListBackupJobsRequest listBackupJobsRequest) {
return new ListBackupJobsPublisher(this, applyPaginatorUserAgent(listBackupJobsRequest));
}
/**
*
* Returns metadata of your saved backup plan templates, including the template ID, name, and the creation and
* deletion dates.
*
*
* @param listBackupPlanTemplatesRequest
* @return A Java Future containing the result of the ListBackupPlanTemplates 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.ListBackupPlanTemplates
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listBackupPlanTemplates(
ListBackupPlanTemplatesRequest listBackupPlanTemplatesRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupPlanTemplatesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupPlanTemplates")
.withMarshaller(new ListBackupPlanTemplatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupPlanTemplatesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata of your saved backup plan templates, including the template ID, name, and the creation and
* deletion dates.
*
*
*
* This is a variant of
* {@link #listBackupPlanTemplates(software.amazon.awssdk.services.backup.model.ListBackupPlanTemplatesRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlanTemplatesPublisher publisher = client.listBackupPlanTemplatesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlanTemplatesPublisher publisher = client.listBackupPlanTemplatesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupPlanTemplatesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupPlanTemplates(software.amazon.awssdk.services.backup.model.ListBackupPlanTemplatesRequest)}
* operation.
*
*
* @param listBackupPlanTemplatesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListBackupPlanTemplates
* @see AWS
* API Documentation
*/
public ListBackupPlanTemplatesPublisher listBackupPlanTemplatesPaginator(
ListBackupPlanTemplatesRequest listBackupPlanTemplatesRequest) {
return new ListBackupPlanTemplatesPublisher(this, applyPaginatorUserAgent(listBackupPlanTemplatesRequest));
}
/**
*
* Returns version metadata of your backup plans, including Amazon Resource Names (ARNs), backup plan IDs, creation
* and deletion dates, plan names, and version IDs.
*
*
* @param listBackupPlanVersionsRequest
* @return A Java Future containing the result of the ListBackupPlanVersions 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.ListBackupPlanVersions
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listBackupPlanVersions(
ListBackupPlanVersionsRequest listBackupPlanVersionsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupPlanVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupPlanVersions")
.withMarshaller(new ListBackupPlanVersionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupPlanVersionsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns version metadata of your backup plans, including Amazon Resource Names (ARNs), backup plan IDs, creation
* and deletion dates, plan names, and version IDs.
*
*
*
* This is a variant of
* {@link #listBackupPlanVersions(software.amazon.awssdk.services.backup.model.ListBackupPlanVersionsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlanVersionsPublisher publisher = client.listBackupPlanVersionsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlanVersionsPublisher publisher = client.listBackupPlanVersionsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupPlanVersionsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupPlanVersions(software.amazon.awssdk.services.backup.model.ListBackupPlanVersionsRequest)}
* operation.
*
*
* @param listBackupPlanVersionsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListBackupPlanVersions
* @see AWS
* API Documentation
*/
public ListBackupPlanVersionsPublisher listBackupPlanVersionsPaginator(
ListBackupPlanVersionsRequest listBackupPlanVersionsRequest) {
return new ListBackupPlanVersionsPublisher(this, applyPaginatorUserAgent(listBackupPlanVersionsRequest));
}
/**
*
* Returns metadata of your saved backup plans, including Amazon Resource Names (ARNs), plan IDs, creation and
* deletion dates, version IDs, plan names, and creator request IDs.
*
*
* @param listBackupPlansRequest
* @return A Java Future containing the result of the ListBackupPlans 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.ListBackupPlans
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listBackupPlans(ListBackupPlansRequest listBackupPlansRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupPlansResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupPlans")
.withMarshaller(new ListBackupPlansRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupPlansRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns metadata of your saved backup plans, including Amazon Resource Names (ARNs), plan IDs, creation and
* deletion dates, version IDs, plan names, and creator request IDs.
*
*
*
* This is a variant of
* {@link #listBackupPlans(software.amazon.awssdk.services.backup.model.ListBackupPlansRequest)} operation. The
* return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlansPublisher publisher = client.listBackupPlansPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupPlansPublisher publisher = client.listBackupPlansPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupPlansResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupPlans(software.amazon.awssdk.services.backup.model.ListBackupPlansRequest)} operation.
*
*
* @param listBackupPlansRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListBackupPlans
* @see AWS API
* Documentation
*/
public ListBackupPlansPublisher listBackupPlansPaginator(ListBackupPlansRequest listBackupPlansRequest) {
return new ListBackupPlansPublisher(this, applyPaginatorUserAgent(listBackupPlansRequest));
}
/**
*
* Returns an array containing metadata of the resources associated with the target backup plan.
*
*
* @param listBackupSelectionsRequest
* @return A Java Future containing the result of the ListBackupSelections 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.ListBackupSelections
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listBackupSelections(
ListBackupSelectionsRequest listBackupSelectionsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupSelectionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupSelections")
.withMarshaller(new ListBackupSelectionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupSelectionsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns an array containing metadata of the resources associated with the target backup plan.
*
*
*
* This is a variant of
* {@link #listBackupSelections(software.amazon.awssdk.services.backup.model.ListBackupSelectionsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupSelectionsPublisher publisher = client.listBackupSelectionsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupSelectionsPublisher publisher = client.listBackupSelectionsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupSelectionsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupSelections(software.amazon.awssdk.services.backup.model.ListBackupSelectionsRequest)}
* operation.
*
*
* @param listBackupSelectionsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListBackupSelections
* @see AWS
* API Documentation
*/
public ListBackupSelectionsPublisher listBackupSelectionsPaginator(ListBackupSelectionsRequest listBackupSelectionsRequest) {
return new ListBackupSelectionsPublisher(this, applyPaginatorUserAgent(listBackupSelectionsRequest));
}
/**
*
* Returns a list of recovery point storage containers along with information about them.
*
*
* @param listBackupVaultsRequest
* @return A Java Future containing the result of the ListBackupVaults 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.ListBackupVaults
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listBackupVaults(ListBackupVaultsRequest listBackupVaultsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListBackupVaultsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListBackupVaults")
.withMarshaller(new ListBackupVaultsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listBackupVaultsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of recovery point storage containers along with information about them.
*
*
*
* This is a variant of
* {@link #listBackupVaults(software.amazon.awssdk.services.backup.model.ListBackupVaultsRequest)} operation. The
* return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupVaultsPublisher publisher = client.listBackupVaultsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListBackupVaultsPublisher publisher = client.listBackupVaultsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListBackupVaultsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listBackupVaults(software.amazon.awssdk.services.backup.model.ListBackupVaultsRequest)} operation.
*
*
* @param listBackupVaultsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListBackupVaults
* @see AWS API
* Documentation
*/
public ListBackupVaultsPublisher listBackupVaultsPaginator(ListBackupVaultsRequest listBackupVaultsRequest) {
return new ListBackupVaultsPublisher(this, applyPaginatorUserAgent(listBackupVaultsRequest));
}
/**
*
* Returns an array of resources successfully backed up by AWS Backup, including the time the resource was saved, an
* Amazon Resource Name (ARN) of the resource, and a resource type.
*
*
* @param listProtectedResourcesRequest
* @return A Java Future containing the result of the ListProtectedResources 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.
* - 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.ListProtectedResources
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listProtectedResources(
ListProtectedResourcesRequest listProtectedResourcesRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListProtectedResourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListProtectedResources")
.withMarshaller(new ListProtectedResourcesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listProtectedResourcesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns an array of resources successfully backed up by AWS Backup, including the time the resource was saved, an
* Amazon Resource Name (ARN) of the resource, and a resource type.
*
*
*
* This is a variant of
* {@link #listProtectedResources(software.amazon.awssdk.services.backup.model.ListProtectedResourcesRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListProtectedResourcesPublisher publisher = client.listProtectedResourcesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListProtectedResourcesPublisher publisher = client.listProtectedResourcesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListProtectedResourcesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listProtectedResources(software.amazon.awssdk.services.backup.model.ListProtectedResourcesRequest)}
* operation.
*
*
* @param listProtectedResourcesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.
* - 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.ListProtectedResources
* @see AWS
* API Documentation
*/
public ListProtectedResourcesPublisher listProtectedResourcesPaginator(
ListProtectedResourcesRequest listProtectedResourcesRequest) {
return new ListProtectedResourcesPublisher(this, applyPaginatorUserAgent(listProtectedResourcesRequest));
}
/**
*
* Returns detailed information about the recovery points stored in a backup vault.
*
*
* @param listRecoveryPointsByBackupVaultRequest
* @return A Java Future containing the result of the ListRecoveryPointsByBackupVault 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.ListRecoveryPointsByBackupVault
* @see AWS API Documentation
*/
@Override
public CompletableFuture listRecoveryPointsByBackupVault(
ListRecoveryPointsByBackupVaultRequest listRecoveryPointsByBackupVaultRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListRecoveryPointsByBackupVaultResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRecoveryPointsByBackupVault")
.withMarshaller(new ListRecoveryPointsByBackupVaultRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listRecoveryPointsByBackupVaultRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns detailed information about the recovery points stored in a backup vault.
*
*
*
* This is a variant of
* {@link #listRecoveryPointsByBackupVault(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByBackupVaultRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByBackupVaultPublisher publisher = client.listRecoveryPointsByBackupVaultPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByBackupVaultPublisher publisher = client.listRecoveryPointsByBackupVaultPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByBackupVaultResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listRecoveryPointsByBackupVault(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByBackupVaultRequest)}
* operation.
*
*
* @param listRecoveryPointsByBackupVaultRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListRecoveryPointsByBackupVault
* @see AWS API Documentation
*/
public ListRecoveryPointsByBackupVaultPublisher listRecoveryPointsByBackupVaultPaginator(
ListRecoveryPointsByBackupVaultRequest listRecoveryPointsByBackupVaultRequest) {
return new ListRecoveryPointsByBackupVaultPublisher(this, applyPaginatorUserAgent(listRecoveryPointsByBackupVaultRequest));
}
/**
*
* Returns detailed information about recovery points of the type specified by a resource Amazon Resource Name
* (ARN).
*
*
* @param listRecoveryPointsByResourceRequest
* @return A Java Future containing the result of the ListRecoveryPointsByResource 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.ListRecoveryPointsByResource
* @see AWS API Documentation
*/
@Override
public CompletableFuture listRecoveryPointsByResource(
ListRecoveryPointsByResourceRequest listRecoveryPointsByResourceRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListRecoveryPointsByResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRecoveryPointsByResource")
.withMarshaller(new ListRecoveryPointsByResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listRecoveryPointsByResourceRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns detailed information about recovery points of the type specified by a resource Amazon Resource Name
* (ARN).
*
*
*
* This is a variant of
* {@link #listRecoveryPointsByResource(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByResourcePublisher publisher = client.listRecoveryPointsByResourcePaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRecoveryPointsByResourcePublisher publisher = client.listRecoveryPointsByResourcePaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listRecoveryPointsByResource(software.amazon.awssdk.services.backup.model.ListRecoveryPointsByResourceRequest)}
* operation.
*
*
* @param listRecoveryPointsByResourceRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListRecoveryPointsByResource
* @see AWS API Documentation
*/
public ListRecoveryPointsByResourcePublisher listRecoveryPointsByResourcePaginator(
ListRecoveryPointsByResourceRequest listRecoveryPointsByResourceRequest) {
return new ListRecoveryPointsByResourcePublisher(this, applyPaginatorUserAgent(listRecoveryPointsByResourceRequest));
}
/**
*
* Returns a list of jobs that AWS Backup initiated to restore a saved resource, including metadata about the
* recovery process.
*
*
* @param listRestoreJobsRequest
* @return A Java Future containing the result of the ListRestoreJobs 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.ListRestoreJobs
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listRestoreJobs(ListRestoreJobsRequest listRestoreJobsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListRestoreJobsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRestoreJobs")
.withMarshaller(new ListRestoreJobsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listRestoreJobsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of jobs that AWS Backup initiated to restore a saved resource, including metadata about the
* recovery process.
*
*
*
* This is a variant of
* {@link #listRestoreJobs(software.amazon.awssdk.services.backup.model.ListRestoreJobsRequest)} operation. The
* return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRestoreJobsPublisher publisher = client.listRestoreJobsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListRestoreJobsPublisher publisher = client.listRestoreJobsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListRestoreJobsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listRestoreJobs(software.amazon.awssdk.services.backup.model.ListRestoreJobsRequest)} operation.
*
*
* @param listRestoreJobsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListRestoreJobs
* @see AWS API
* Documentation
*/
public ListRestoreJobsPublisher listRestoreJobsPaginator(ListRestoreJobsRequest listRestoreJobsRequest) {
return new ListRestoreJobsPublisher(this, applyPaginatorUserAgent(listRestoreJobsRequest));
}
/**
*
* Returns a list of key-value pairs assigned to a target recovery point, backup plan, or backup vault.
*
*
* @param listTagsRequest
* @return A Java Future containing the result of the ListTags 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.ListTags
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listTags(ListTagsRequest listTagsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("ListTags")
.withMarshaller(new ListTagsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of key-value pairs assigned to a target recovery point, backup plan, or backup vault.
*
*
*
* This is a variant of {@link #listTags(software.amazon.awssdk.services.backup.model.ListTagsRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListTagsPublisher publisher = client.listTagsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.backup.paginators.ListTagsPublisher publisher = client.listTagsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.backup.model.ListTagsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #listTags(software.amazon.awssdk.services.backup.model.ListTagsRequest)} operation.
*
*
* @param listTagsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* 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.ListTags
* @see AWS API
* Documentation
*/
public ListTagsPublisher listTagsPaginator(ListTagsRequest listTagsRequest) {
return new ListTagsPublisher(this, applyPaginatorUserAgent(listTagsRequest));
}
/**
*
* Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a
* backup vault name and an access policy document in JSON format.
*
*
* @param putBackupVaultAccessPolicyRequest
* @return A Java Future containing the result of the PutBackupVaultAccessPolicy 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.PutBackupVaultAccessPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture putBackupVaultAccessPolicy(
PutBackupVaultAccessPolicyRequest putBackupVaultAccessPolicyRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutBackupVaultAccessPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutBackupVaultAccessPolicy")
.withMarshaller(new PutBackupVaultAccessPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(putBackupVaultAccessPolicyRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Turns on notifications on a backup vault for the specified topic and events.
*
*
* @param putBackupVaultNotificationsRequest
* @return A Java Future containing the result of the PutBackupVaultNotifications 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.PutBackupVaultNotifications
* @see AWS API Documentation
*/
@Override
public CompletableFuture putBackupVaultNotifications(
PutBackupVaultNotificationsRequest putBackupVaultNotificationsRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutBackupVaultNotificationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutBackupVaultNotifications")
.withMarshaller(new PutBackupVaultNotificationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(putBackupVaultNotificationsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Starts a job to create a one-time backup of the specified resource.
*
*
* @param startBackupJobRequest
* @return A Java Future containing the result of the StartBackupJob 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.
* - 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.StartBackupJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture startBackupJob(StartBackupJobRequest startBackupJobRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartBackupJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartBackupJob")
.withMarshaller(new StartBackupJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(startBackupJobRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Recovers the saved resource identified by an Amazon Resource Name (ARN).
*
*
* If the resource ARN is included in the request, then the last complete backup of that resource is recovered. If
* the ARN of a recovery point is supplied, then that recovery point is restored.
*
*
* @param startRestoreJobRequest
* @return A Java Future containing the result of the StartRestoreJob 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.StartRestoreJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture startRestoreJob(StartRestoreJobRequest startRestoreJobRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartRestoreJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartRestoreJob")
.withMarshaller(new StartRestoreJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(startRestoreJobRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Attempts to cancel a job to create a one-time backup of a resource.
*
*
* @param stopBackupJobRequest
* @return A Java Future containing the result of the StopBackupJob 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.
* - 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.
* - 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.StopBackupJob
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture stopBackupJob(StopBackupJobRequest stopBackupJobRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopBackupJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StopBackupJob")
.withMarshaller(new StopBackupJobRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(stopBackupJobRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Assigns a set of key-value pairs to a recovery point, backup plan, or backup vault identified by an Amazon
* Resource Name (ARN).
*
*
* @param tagResourceRequest
* @return A Java Future containing the result of the TagResource 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.
* - 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.TagResource
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("TagResource").withMarshaller(new TagResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(tagResourceRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes a set of key-value pairs from a recovery point, backup plan, or backup vault identified by an Amazon
* Resource Name (ARN)
*
*
* @param untagResourceRequest
* @return A Java Future containing the result of the UntagResource 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.UntagResource
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UntagResource")
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(untagResourceRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Replaces the body of a saved backup plan identified by its backupPlanId
with the input document in
* JSON format. The new version is uniquely identified by a VersionId
.
*
*
* @param updateBackupPlanRequest
* @return A Java Future containing the result of the UpdateBackupPlan 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.UpdateBackupPlan
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture updateBackupPlan(UpdateBackupPlanRequest updateBackupPlanRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateBackupPlanResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateBackupPlan")
.withMarshaller(new UpdateBackupPlanRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(updateBackupPlanRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Sets the transition lifecycle of a recovery point.
*
*
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup
* transitions and expires backups automatically according to the lifecycle that you define.
*
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the
* “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The
* “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
*
*
* @param updateRecoveryPointLifecycleRequest
* @return A Java Future containing the result of the UpdateRecoveryPointLifecycle 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.UpdateRecoveryPointLifecycle
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateRecoveryPointLifecycle(
UpdateRecoveryPointLifecycleRequest updateRecoveryPointLifecycleRequest) {
try {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateRecoveryPointLifecycleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateRecoveryPointLifecycle")
.withMarshaller(new UpdateRecoveryPointLifecycleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(updateRecoveryPointLifecycleRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
@Override
public void close() {
clientHandler.close();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(BackupException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("MissingParameterValueException")
.exceptionBuilderSupplier(MissingParameterValueException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidParameterValueException")
.exceptionBuilderSupplier(InvalidParameterValueException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidRequestException")
.exceptionBuilderSupplier(InvalidRequestException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LimitExceededException")
.exceptionBuilderSupplier(LimitExceededException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DependencyFailureException")
.exceptionBuilderSupplier(DependencyFailureException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AlreadyExistsException")
.exceptionBuilderSupplier(AlreadyExistsException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceUnavailableException")
.exceptionBuilderSupplier(ServiceUnavailableException::builder).build());
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
}