All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.route53recoveryreadiness.DefaultRoute53RecoveryReadinessAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Route53 Recovery Readiness module holds the client classes that are used for communicating with Route53 Recovery Readiness.

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.route53recoveryreadiness;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
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.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.route53recoveryreadiness.internal.Route53RecoveryReadinessServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.route53recoveryreadiness.model.AccessDeniedException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ConflictException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCrossAccountAuthorizationRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCrossAccountAuthorizationResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCrossAccountAuthorizationRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCrossAccountAuthorizationResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetArchitectureRecommendationsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetArchitectureRecommendationsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellReadinessSummaryRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellReadinessSummaryResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResourceStatusRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResourceStatusResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckStatusRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckStatusResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupReadinessSummaryRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupReadinessSummaryResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.InternalServerException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCellsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCellsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCrossAccountAuthorizationsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCrossAccountAuthorizationsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListReadinessChecksRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListReadinessChecksResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRecoveryGroupsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRecoveryGroupsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListResourceSetsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListResourceSetsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRulesRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRulesResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListTagsForResourcesRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListTagsForResourcesResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ResourceNotFoundException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.Route53RecoveryReadinessException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.TagResourceRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.TagResourceResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ThrottlingException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UntagResourceRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UntagResourceResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ValidationException;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateCrossAccountAuthorizationRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteCrossAccountAuthorizationRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetArchitectureRecommendationsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetCellReadinessSummaryRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckResourceStatusRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckStatusRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetRecoveryGroupReadinessSummaryRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListCellsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListCrossAccountAuthorizationsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListReadinessChecksRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListRecoveryGroupsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListResourceSetsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListRulesRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListTagsForResourcesRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateResourceSetRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link Route53RecoveryReadinessAsyncClient}.
 *
 * @see Route53RecoveryReadinessAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultRoute53RecoveryReadinessAsyncClient implements Route53RecoveryReadinessAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultRoute53RecoveryReadinessAsyncClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.REST_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultRoute53RecoveryReadinessAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Creates a cell in an account. *

* * @param createCellRequest * @return A Java Future containing the result of the CreateCell operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • ConflictException 409 response - Conflict exception. You might be using a predefined variable.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.CreateCell * @see AWS API Documentation */ @Override public CompletableFuture createCell(CreateCellRequest createCellRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCellRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCellRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCell"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateCellResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateCell") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCellRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCellRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a cross-account readiness authorization. This lets you authorize another account to work with Route 53 * Application Recovery Controller, for example, to check the readiness status of resources in a separate account. *

* * @param createCrossAccountAuthorizationRequest * @return A Java Future containing the result of the CreateCrossAccountAuthorization operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • ConflictException 409 response - Conflict exception. You might be using a predefined variable.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.CreateCrossAccountAuthorization * @see AWS API Documentation */ @Override public CompletableFuture createCrossAccountAuthorization( CreateCrossAccountAuthorizationRequest createCrossAccountAuthorizationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCrossAccountAuthorizationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCrossAccountAuthorizationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCrossAccountAuthorization"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCrossAccountAuthorizationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCrossAccountAuthorization").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCrossAccountAuthorizationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCrossAccountAuthorizationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a readiness check in an account. A readiness check monitors a resource set in your application, such as a * set of Amazon Aurora instances, that Application Recovery Controller is auditing recovery readiness for. The * audits run once every minute on every resource that's associated with a readiness check. *

* * @param createReadinessCheckRequest * @return A Java Future containing the result of the CreateReadinessCheck operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • ConflictException 409 response - Conflict exception. You might be using a predefined variable.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.CreateReadinessCheck * @see AWS API Documentation */ @Override public CompletableFuture createReadinessCheck( CreateReadinessCheckRequest createReadinessCheckRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReadinessCheckRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createReadinessCheckRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReadinessCheck"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateReadinessCheckResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateReadinessCheck").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateReadinessCheckRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createReadinessCheckRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a recovery group in an account. A recovery group corresponds to an application and includes a list of the * cells that make up the application. *

* * @param createRecoveryGroupRequest * @return A Java Future containing the result of the CreateRecoveryGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • ConflictException 409 response - Conflict exception. You might be using a predefined variable.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.CreateRecoveryGroup * @see AWS API Documentation */ @Override public CompletableFuture createRecoveryGroup( CreateRecoveryGroupRequest createRecoveryGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRecoveryGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createRecoveryGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRecoveryGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateRecoveryGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateRecoveryGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateRecoveryGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createRecoveryGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a resource set. A resource set is a set of resources of one type that span multiple cells. You can * associate a resource set with a readiness check to monitor the resources for failover readiness. *

* * @param createResourceSetRequest * @return A Java Future containing the result of the CreateResourceSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • ConflictException 409 response - Conflict exception. You might be using a predefined variable.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.CreateResourceSet * @see AWS API Documentation */ @Override public CompletableFuture createResourceSet(CreateResourceSetRequest createResourceSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createResourceSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createResourceSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateResourceSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateResourceSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateResourceSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateResourceSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createResourceSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Delete a cell. When successful, the response code is 204, with no response body. *

* * @param deleteCellRequest * @return A Java Future containing the result of the DeleteCell operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.DeleteCell * @see AWS API Documentation */ @Override public CompletableFuture deleteCell(DeleteCellRequest deleteCellRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCellRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCellRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCell"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteCellResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteCell") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCellRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCellRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes cross account readiness authorization. *

* * @param deleteCrossAccountAuthorizationRequest * @return A Java Future containing the result of the DeleteCrossAccountAuthorization operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.DeleteCrossAccountAuthorization * @see AWS API Documentation */ @Override public CompletableFuture deleteCrossAccountAuthorization( DeleteCrossAccountAuthorizationRequest deleteCrossAccountAuthorizationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCrossAccountAuthorizationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCrossAccountAuthorizationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCrossAccountAuthorization"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCrossAccountAuthorizationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCrossAccountAuthorization").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCrossAccountAuthorizationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCrossAccountAuthorizationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a readiness check. *

* * @param deleteReadinessCheckRequest * @return A Java Future containing the result of the DeleteReadinessCheck operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.DeleteReadinessCheck * @see AWS API Documentation */ @Override public CompletableFuture deleteReadinessCheck( DeleteReadinessCheckRequest deleteReadinessCheckRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReadinessCheckRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReadinessCheckRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReadinessCheck"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteReadinessCheckResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteReadinessCheck").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteReadinessCheckRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteReadinessCheckRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a recovery group. *

* * @param deleteRecoveryGroupRequest * @return A Java Future containing the result of the DeleteRecoveryGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.DeleteRecoveryGroup * @see AWS API Documentation */ @Override public CompletableFuture deleteRecoveryGroup( DeleteRecoveryGroupRequest deleteRecoveryGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRecoveryGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecoveryGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecoveryGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRecoveryGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRecoveryGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteRecoveryGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteRecoveryGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a resource set. *

* * @param deleteResourceSetRequest * @return A Java Future containing the result of the DeleteResourceSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.DeleteResourceSet * @see AWS API Documentation */ @Override public CompletableFuture deleteResourceSet(DeleteResourceSetRequest deleteResourceSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourceSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourceSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourceSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourceSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteResourceSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteResourceSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteResourceSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets recommendations about architecture designs for improving resiliency for an application, based on a recovery * group. *

* * @param getArchitectureRecommendationsRequest * @return A Java Future containing the result of the GetArchitectureRecommendations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetArchitectureRecommendations * @see AWS API Documentation */ @Override public CompletableFuture getArchitectureRecommendations( GetArchitectureRecommendationsRequest getArchitectureRecommendationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchitectureRecommendationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchitectureRecommendationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchitectureRecommendations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetArchitectureRecommendationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetArchitectureRecommendations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetArchitectureRecommendationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getArchitectureRecommendationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about a cell including cell name, cell Amazon Resource Name (ARN), ARNs of nested cells for this * cell, and a list of those cell ARNs with their associated recovery group ARNs. *

* * @param getCellRequest * @return A Java Future containing the result of the GetCell operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetCell * @see AWS API Documentation */ @Override public CompletableFuture getCell(GetCellRequest getCellRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCellRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCellRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCell"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetCellResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetCell") .withProtocolMetadata(protocolMetadata).withMarshaller(new GetCellRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCellRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets readiness for a cell. Aggregates the readiness of all the resources that are associated with the cell into a * single value. *

* * @param getCellReadinessSummaryRequest * @return A Java Future containing the result of the GetCellReadinessSummary operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetCellReadinessSummary * @see AWS API Documentation */ @Override public CompletableFuture getCellReadinessSummary( GetCellReadinessSummaryRequest getCellReadinessSummaryRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCellReadinessSummaryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCellReadinessSummaryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCellReadinessSummary"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCellReadinessSummaryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCellReadinessSummary").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCellReadinessSummaryRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCellReadinessSummaryRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets details about a readiness check. *

* * @param getReadinessCheckRequest * @return A Java Future containing the result of the GetReadinessCheck operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetReadinessCheck * @see AWS API Documentation */ @Override public CompletableFuture getReadinessCheck(GetReadinessCheckRequest getReadinessCheckRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getReadinessCheckRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getReadinessCheckRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheck"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetReadinessCheckResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetReadinessCheck").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetReadinessCheckRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getReadinessCheckRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets individual readiness status for a readiness check. To see the overall readiness status for a recovery group, * that considers the readiness status for all the readiness checks in the recovery group, use * GetRecoveryGroupReadinessSummary. *

* * @param getReadinessCheckResourceStatusRequest * @return A Java Future containing the result of the GetReadinessCheckResourceStatus operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetReadinessCheckResourceStatus * @see AWS API Documentation */ @Override public CompletableFuture getReadinessCheckResourceStatus( GetReadinessCheckResourceStatusRequest getReadinessCheckResourceStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getReadinessCheckResourceStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getReadinessCheckResourceStatusRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheckResourceStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetReadinessCheckResourceStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetReadinessCheckResourceStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetReadinessCheckResourceStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getReadinessCheckResourceStatusRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the readiness status for an individual readiness check. To see the overall readiness status for a recovery * group, that considers the readiness status for all the readiness checks in a recovery group, use * GetRecoveryGroupReadinessSummary. *

* * @param getReadinessCheckStatusRequest * @return A Java Future containing the result of the GetReadinessCheckStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetReadinessCheckStatus * @see AWS API Documentation */ @Override public CompletableFuture getReadinessCheckStatus( GetReadinessCheckStatusRequest getReadinessCheckStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getReadinessCheckStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getReadinessCheckStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheckStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetReadinessCheckStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetReadinessCheckStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetReadinessCheckStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getReadinessCheckStatusRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets details about a recovery group, including a list of the cells that are included in it. *

* * @param getRecoveryGroupRequest * @return A Java Future containing the result of the GetRecoveryGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetRecoveryGroup * @see AWS API Documentation */ @Override public CompletableFuture getRecoveryGroup(GetRecoveryGroupRequest getRecoveryGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRecoveryGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecoveryGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecoveryGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRecoveryGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRecoveryGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetRecoveryGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getRecoveryGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Displays a summary of information about a recovery group's readiness status. Includes the readiness checks for * resources in the recovery group and the readiness status of each one. *

* * @param getRecoveryGroupReadinessSummaryRequest * @return A Java Future containing the result of the GetRecoveryGroupReadinessSummary operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetRecoveryGroupReadinessSummary * @see AWS API Documentation */ @Override public CompletableFuture getRecoveryGroupReadinessSummary( GetRecoveryGroupReadinessSummaryRequest getRecoveryGroupReadinessSummaryRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRecoveryGroupReadinessSummaryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecoveryGroupReadinessSummaryRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecoveryGroupReadinessSummary"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetRecoveryGroupReadinessSummaryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRecoveryGroupReadinessSummary").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetRecoveryGroupReadinessSummaryRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getRecoveryGroupReadinessSummaryRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Displays the details about a resource set, including a list of the resources in the set. *

* * @param getResourceSetRequest * @return A Java Future containing the result of the GetResourceSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.GetResourceSet * @see AWS API Documentation */ @Override public CompletableFuture getResourceSet(GetResourceSetRequest getResourceSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourceSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourceSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourceSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetResourceSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetResourceSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetResourceSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getResourceSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the cells for an account. *

* * @param listCellsRequest * @return A Java Future containing the result of the ListCells operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListCells * @see AWS API Documentation */ @Override public CompletableFuture listCells(ListCellsRequest listCellsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCellsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCellsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCells"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListCellsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListCells") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCellsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(listCellsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the cross-account readiness authorizations that are in place for an account. *

* * @param listCrossAccountAuthorizationsRequest * @return A Java Future containing the result of the ListCrossAccountAuthorizations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListCrossAccountAuthorizations * @see AWS API Documentation */ @Override public CompletableFuture listCrossAccountAuthorizations( ListCrossAccountAuthorizationsRequest listCrossAccountAuthorizationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCrossAccountAuthorizationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCrossAccountAuthorizationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCrossAccountAuthorizations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCrossAccountAuthorizationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCrossAccountAuthorizations").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCrossAccountAuthorizationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCrossAccountAuthorizationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the readiness checks for an account. *

* * @param listReadinessChecksRequest * @return A Java Future containing the result of the ListReadinessChecks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListReadinessChecks * @see AWS API Documentation */ @Override public CompletableFuture listReadinessChecks( ListReadinessChecksRequest listReadinessChecksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listReadinessChecksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listReadinessChecksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListReadinessChecks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListReadinessChecksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListReadinessChecks").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListReadinessChecksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listReadinessChecksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the recovery groups in an account. *

* * @param listRecoveryGroupsRequest * @return A Java Future containing the result of the ListRecoveryGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListRecoveryGroups * @see AWS API Documentation */ @Override public CompletableFuture listRecoveryGroups(ListRecoveryGroupsRequest listRecoveryGroupsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRecoveryGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listRecoveryGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRecoveryGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListRecoveryGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListRecoveryGroups").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListRecoveryGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listRecoveryGroupsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the resource sets in an account. *

* * @param listResourceSetsRequest * @return A Java Future containing the result of the ListResourceSets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListResourceSets * @see AWS API Documentation */ @Override public CompletableFuture listResourceSets(ListResourceSetsRequest listResourceSetsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listResourceSetsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceSetsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceSets"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListResourceSetsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListResourceSets").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListResourceSetsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listResourceSetsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all readiness rules, or lists the readiness rules for a specific resource type. *

* * @param listRulesRequest * @return A Java Future containing the result of the ListRules operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListRules * @see AWS API Documentation */ @Override public CompletableFuture listRules(ListRulesRequest listRulesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRulesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listRulesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRules"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListRulesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListRules") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListRulesRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(listRulesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the tags for a resource. *

* * @param listTagsForResourcesRequest * @return A Java Future containing the result of the ListTagsForResources operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.ListTagsForResources * @see AWS API Documentation */ @Override public CompletableFuture listTagsForResources( ListTagsForResourcesRequest listTagsForResourcesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourcesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourcesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResources"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResources").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTagsForResourcesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTagsForResourcesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a tag to a resource. *

* * @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. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.TagResource * @see AWS API Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); 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").withProtocolMetadata(protocolMetadata) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(tagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes a tag from a resource. *

* * @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. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.UntagResource * @see AWS API Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); 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").withProtocolMetadata(protocolMetadata) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(untagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a cell to replace the list of nested cells with a new list of nested cells. *

* * @param updateCellRequest * @return A Java Future containing the result of the UpdateCell operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.UpdateCell * @see AWS API Documentation */ @Override public CompletableFuture updateCell(UpdateCellRequest updateCellRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCellRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCellRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCell"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateCellResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateCell") .withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCellRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCellRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a readiness check. *

* * @param updateReadinessCheckRequest * Name of a readiness check to describe. * @return A Java Future containing the result of the UpdateReadinessCheck operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.UpdateReadinessCheck * @see AWS API Documentation */ @Override public CompletableFuture updateReadinessCheck( UpdateReadinessCheckRequest updateReadinessCheckRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateReadinessCheckRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateReadinessCheckRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateReadinessCheck"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateReadinessCheckResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateReadinessCheck").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateReadinessCheckRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateReadinessCheckRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a recovery group. *

* * @param updateRecoveryGroupRequest * Name of a recovery group. * @return A Java Future containing the result of the UpdateRecoveryGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.UpdateRecoveryGroup * @see AWS API Documentation */ @Override public CompletableFuture updateRecoveryGroup( UpdateRecoveryGroupRequest updateRecoveryGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRecoveryGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRecoveryGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRecoveryGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateRecoveryGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateRecoveryGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateRecoveryGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateRecoveryGroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a resource set. *

* * @param updateResourceSetRequest * Name of a resource set. * @return A Java Future containing the result of the UpdateResourceSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ResourceNotFoundException 404 response - Malformed query string. The query string contains a syntax * error or resource not found.
  • *
  • ThrottlingException 429 response - Limit exceeded exception or too many requests exception.
  • *
  • ValidationException 400 response - Multiple causes. For example, you might have a malformed query * string, an input parameter might be out of range, or you used parameters together incorrectly.
  • *
  • InternalServerException 500 response - Internal service error or temporary service error. Retry the * request.
  • *
  • AccessDeniedException 403 response - Access denied exception. You do not have sufficient access to * perform this action.
  • *
  • 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.
  • *
  • Route53RecoveryReadinessException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample Route53RecoveryReadinessAsyncClient.UpdateResourceSet * @see AWS API Documentation */ @Override public CompletableFuture updateResourceSet(UpdateResourceSetRequest updateResourceSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateResourceSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResourceSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResourceSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateResourceSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateResourceSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateResourceSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateResourceSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public final Route53RecoveryReadinessServiceClientConfiguration serviceClientConfiguration() { return new Route53RecoveryReadinessServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(Route53RecoveryReadinessException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } Route53RecoveryReadinessServiceClientConfigurationBuilder serviceConfigBuilder = new Route53RecoveryReadinessServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy