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

software.amazon.awssdk.services.globalaccelerator.DefaultGlobalAcceleratorAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Global Accelerator module holds the client classes that are used for communicating with Global Accelerator.

There is a newer version: 2.28.4
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.globalaccelerator;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.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.awscore.retry.AwsRetryStrategy;
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.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
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.retries.api.RetryStrategy;
import software.amazon.awssdk.services.globalaccelerator.internal.GlobalAcceleratorServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.globalaccelerator.model.AcceleratorNotDisabledException;
import software.amazon.awssdk.services.globalaccelerator.model.AcceleratorNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.AccessDeniedException;
import software.amazon.awssdk.services.globalaccelerator.model.AddCustomRoutingEndpointsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.AddCustomRoutingEndpointsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.AddEndpointsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.AddEndpointsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.AdvertiseByoipCidrRequest;
import software.amazon.awssdk.services.globalaccelerator.model.AdvertiseByoipCidrResponse;
import software.amazon.awssdk.services.globalaccelerator.model.AllowCustomRoutingTrafficRequest;
import software.amazon.awssdk.services.globalaccelerator.model.AllowCustomRoutingTrafficResponse;
import software.amazon.awssdk.services.globalaccelerator.model.AssociatedEndpointGroupFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.AssociatedListenerFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.AttachmentNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.ByoipCidrNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.ConflictException;
import software.amazon.awssdk.services.globalaccelerator.model.CreateAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCrossAccountAttachmentRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCrossAccountAttachmentResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateCustomRoutingListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.CreateListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.CreateListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCrossAccountAttachmentRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCrossAccountAttachmentResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteCustomRoutingListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeleteListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DenyCustomRoutingTrafficRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DenyCustomRoutingTrafficResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DeprovisionByoipCidrRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DeprovisionByoipCidrResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeAcceleratorAttributesRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeAcceleratorAttributesResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCrossAccountAttachmentRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCrossAccountAttachmentResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingAcceleratorAttributesRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingAcceleratorAttributesResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeCustomRoutingListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.DescribeListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.EndpointAlreadyExistsException;
import software.amazon.awssdk.services.globalaccelerator.model.EndpointGroupAlreadyExistsException;
import software.amazon.awssdk.services.globalaccelerator.model.EndpointGroupNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.EndpointNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.GlobalAcceleratorException;
import software.amazon.awssdk.services.globalaccelerator.model.IncorrectCidrStateException;
import software.amazon.awssdk.services.globalaccelerator.model.InternalServiceErrorException;
import software.amazon.awssdk.services.globalaccelerator.model.InvalidArgumentException;
import software.amazon.awssdk.services.globalaccelerator.model.InvalidNextTokenException;
import software.amazon.awssdk.services.globalaccelerator.model.InvalidPortRangeException;
import software.amazon.awssdk.services.globalaccelerator.model.LimitExceededException;
import software.amazon.awssdk.services.globalaccelerator.model.ListAcceleratorsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListAcceleratorsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListByoipCidrsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListByoipCidrsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountAttachmentsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountAttachmentsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountResourceAccountsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountResourceAccountsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountResourcesRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCrossAccountResourcesResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingAcceleratorsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingAcceleratorsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingEndpointGroupsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingEndpointGroupsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingListenersRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingListenersResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingPortMappingsByDestinationRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingPortMappingsByDestinationResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingPortMappingsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListCustomRoutingPortMappingsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListEndpointGroupsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListEndpointGroupsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListListenersRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListListenersResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.globalaccelerator.model.ListenerNotFoundException;
import software.amazon.awssdk.services.globalaccelerator.model.ProvisionByoipCidrRequest;
import software.amazon.awssdk.services.globalaccelerator.model.ProvisionByoipCidrResponse;
import software.amazon.awssdk.services.globalaccelerator.model.RemoveCustomRoutingEndpointsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.RemoveCustomRoutingEndpointsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.RemoveEndpointsRequest;
import software.amazon.awssdk.services.globalaccelerator.model.RemoveEndpointsResponse;
import software.amazon.awssdk.services.globalaccelerator.model.TagResourceRequest;
import software.amazon.awssdk.services.globalaccelerator.model.TagResourceResponse;
import software.amazon.awssdk.services.globalaccelerator.model.TransactionInProgressException;
import software.amazon.awssdk.services.globalaccelerator.model.UntagResourceRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UntagResourceResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateAcceleratorAttributesRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateAcceleratorAttributesResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCrossAccountAttachmentRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCrossAccountAttachmentResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingAcceleratorAttributesRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingAcceleratorAttributesResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingAcceleratorRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingAcceleratorResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateCustomRoutingListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateEndpointGroupRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateEndpointGroupResponse;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateListenerRequest;
import software.amazon.awssdk.services.globalaccelerator.model.UpdateListenerResponse;
import software.amazon.awssdk.services.globalaccelerator.model.WithdrawByoipCidrRequest;
import software.amazon.awssdk.services.globalaccelerator.model.WithdrawByoipCidrResponse;
import software.amazon.awssdk.services.globalaccelerator.transform.AddCustomRoutingEndpointsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.AddEndpointsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.AdvertiseByoipCidrRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.AllowCustomRoutingTrafficRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateCrossAccountAttachmentRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateCustomRoutingAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateCustomRoutingEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateCustomRoutingListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.CreateListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteCrossAccountAttachmentRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteCustomRoutingAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteCustomRoutingEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteCustomRoutingListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeleteListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DenyCustomRoutingTrafficRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DeprovisionByoipCidrRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeAcceleratorAttributesRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeCrossAccountAttachmentRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeCustomRoutingAcceleratorAttributesRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeCustomRoutingAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeCustomRoutingEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeCustomRoutingListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.DescribeListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListAcceleratorsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListByoipCidrsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCrossAccountAttachmentsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCrossAccountResourceAccountsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCrossAccountResourcesRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCustomRoutingAcceleratorsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCustomRoutingEndpointGroupsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCustomRoutingListenersRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCustomRoutingPortMappingsByDestinationRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListCustomRoutingPortMappingsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListEndpointGroupsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListListenersRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.ProvisionByoipCidrRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.RemoveCustomRoutingEndpointsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.RemoveEndpointsRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateAcceleratorAttributesRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateCrossAccountAttachmentRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateCustomRoutingAcceleratorAttributesRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateCustomRoutingAcceleratorRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateCustomRoutingListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateEndpointGroupRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.UpdateListenerRequestMarshaller;
import software.amazon.awssdk.services.globalaccelerator.transform.WithdrawByoipCidrRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

    /**
     * 

* Associate a virtual private cloud (VPC) subnet endpoint with your custom routing accelerator. *

*

* The listener port range must be large enough to support the number of IP addresses that can be specified in your * subnet. The number of ports required is: subnet size times the number of ports per destination EC2 instances. For * example, a subnet defined as /24 requires a listener port range of at least 255 ports. *

*

* Note: You must have enough remaining listener ports available to map to the subnet ports, or the call will fail * with a LimitExceededException. *

*

* By default, all destinations in a subnet in a custom routing accelerator cannot receive traffic. To enable all * destinations to receive traffic, or to specify individual port mappings that can receive traffic, see the * AllowCustomRoutingTraffic operation. *

* * @param addCustomRoutingEndpointsRequest * @return A Java Future containing the result of the AddCustomRoutingEndpoints 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. *
    *
  • EndpointAlreadyExistsException The endpoint that you specified doesn't exist.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • ConflictException You can't use both of those options.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.AddCustomRoutingEndpoints * @see AWS API Documentation */ @Override public CompletableFuture addCustomRoutingEndpoints( AddCustomRoutingEndpointsRequest addCustomRoutingEndpointsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addCustomRoutingEndpointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, addCustomRoutingEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddCustomRoutingEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddCustomRoutingEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddCustomRoutingEndpoints").withProtocolMetadata(protocolMetadata) .withMarshaller(new AddCustomRoutingEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(addCustomRoutingEndpointsRequest)); 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); } } /** *

* Add endpoints to an endpoint group. The AddEndpoints API operation is the recommended option for * adding endpoints. The alternative options are to add endpoints when you create an endpoint group (with the CreateEndpointGroup * API) or when you update an endpoint group (with the UpdateEndpointGroup API). *

*

* There are two advantages to using AddEndpoints to add endpoints in Global Accelerator: *

*
    *
  • *

    * It's faster, because Global Accelerator only has to resolve the new endpoints that you're adding, rather than * resolving new and existing endpoints. *

    *
  • *
  • *

    * It's more convenient, because you don't need to specify the current endpoints that are already in the endpoint * group, in addition to the new endpoints that you want to add. *

    *
  • *
*

* For information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see * Endpoints for standard * accelerators in the Global Accelerator Developer Guide. *

* * @param addEndpointsRequest * @return A Java Future containing the result of the AddEndpoints 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. *
    *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.AddEndpoints * @see AWS API Documentation */ @Override public CompletableFuture addEndpoints(AddEndpointsRequest addEndpointsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addEndpointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, addEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AddEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddEndpoints").withProtocolMetadata(protocolMetadata) .withMarshaller(new AddEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(addEndpointsRequest)); 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); } } /** *

* Advertises an IPv4 address range that is provisioned for use with your Amazon Web Services resources through * bring your own IP addresses (BYOIP). It can take a few minutes before traffic to the specified addresses starts * routing to Amazon Web Services because of propagation delays. *

*

* To stop advertising the BYOIP address range, use WithdrawByoipCidr. *

*

* For more information, see Bring your own IP addresses * (BYOIP) in the Global Accelerator Developer Guide. *

* * @param advertiseByoipCidrRequest * @return A Java Future containing the result of the AdvertiseByoipCidr 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • ByoipCidrNotFoundException The CIDR that you specified was not found or is incorrect.
  • *
  • IncorrectCidrStateException The CIDR that you specified is not valid for this action. For example, * the state of the CIDR might be incorrect for 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.AdvertiseByoipCidr * @see AWS API Documentation */ @Override public CompletableFuture advertiseByoipCidr(AdvertiseByoipCidrRequest advertiseByoipCidrRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(advertiseByoipCidrRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, advertiseByoipCidrRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdvertiseByoipCidr"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdvertiseByoipCidrResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdvertiseByoipCidr").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdvertiseByoipCidrRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(advertiseByoipCidrRequest)); 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); } } /** *

* Specify the Amazon EC2 instance (destination) IP addresses and ports for a VPC subnet endpoint that can receive * traffic for a custom routing accelerator. You can allow traffic to all destinations in the subnet endpoint, or * allow traffic to a specified list of destination IP addresses and ports in the subnet. Note that you cannot * specify IP addresses or ports outside of the range that you configured for the endpoint group. *

*

* After you make changes, you can verify that the updates are complete by checking the status of your accelerator: * the status changes from IN_PROGRESS to DEPLOYED. *

* * @param allowCustomRoutingTrafficRequest * @return A Java Future containing the result of the AllowCustomRoutingTraffic 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. *
    *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.AllowCustomRoutingTraffic * @see AWS API Documentation */ @Override public CompletableFuture allowCustomRoutingTraffic( AllowCustomRoutingTrafficRequest allowCustomRoutingTrafficRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(allowCustomRoutingTrafficRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, allowCustomRoutingTrafficRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AllowCustomRoutingTraffic"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AllowCustomRoutingTrafficResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AllowCustomRoutingTraffic").withProtocolMetadata(protocolMetadata) .withMarshaller(new AllowCustomRoutingTrafficRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(allowCustomRoutingTrafficRequest)); 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); } } /** *

* Create an accelerator. An accelerator includes one or more listeners that process inbound connections and direct * traffic to one or more endpoint groups, each of which includes endpoints, such as Network Load Balancers. *

* *

* Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you * must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for * example, specify --region us-west-2 on Amazon Web Services CLI commands. *

*
* * @param createAcceleratorRequest * @return A Java Future containing the result of the CreateAccelerator 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateAccelerator * @see AWS API Documentation */ @Override public CompletableFuture createAccelerator(CreateAcceleratorRequest createAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAcceleratorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAcceleratorRequest)); 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); } } /** *

* Create a cross-account attachment in Global Accelerator. You create a cross-account attachment to specify the * principals who have permission to work with resources in accelerators in their own account. You * specify, in the same attachment, the resources that are shared. *

*

* A principal can be an Amazon Web Services account number or the Amazon Resource Name (ARN) for an accelerator. * For account numbers that are listed as principals, to work with a resource listed in the attachment, you must * sign in to an account specified as a principal. Then, you can work with resources that are listed, with any of * your accelerators. If an accelerator ARN is listed in the cross-account attachment as a principal, anyone with * permission to make updates to the accelerator can work with resources that are listed in the attachment. *

*

* Specify each principal and resource separately. To specify two CIDR address pools, list them individually under * Resources, and so on. For a command line operation, for example, you might use a statement like the * following: *

*

* "Resources": [{"Cidr": "169.254.60.0/24"},{"Cidr": "169.254.59.0/24"}] *

*

* For more information, see Working with * cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer * Guide. *

* * @param createCrossAccountAttachmentRequest * @return A Java Future containing the result of the CreateCrossAccountAttachment 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateCrossAccountAttachment * @see AWS API Documentation */ @Override public CompletableFuture createCrossAccountAttachment( CreateCrossAccountAttachmentRequest createCrossAccountAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCrossAccountAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCrossAccountAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCrossAccountAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCrossAccountAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCrossAccountAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCrossAccountAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCrossAccountAttachmentRequest)); 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); } } /** *

* Create a custom routing accelerator. A custom routing accelerator directs traffic to one of possibly thousands of * Amazon EC2 instance destinations running in a single or multiple virtual private clouds (VPC) subnet endpoints. *

*

* Be aware that, by default, all destination EC2 instances in a VPC subnet endpoint cannot receive traffic. To * enable all destinations to receive traffic, or to specify individual port mappings that can receive traffic, see * the * AllowCustomRoutingTraffic operation. *

* *

* Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you * must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for * example, specify --region us-west-2 on Amazon Web Services CLI commands. *

*
* * @param createCustomRoutingAcceleratorRequest * @return A Java Future containing the result of the CreateCustomRoutingAccelerator 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateCustomRoutingAccelerator * @see AWS API Documentation */ @Override public CompletableFuture createCustomRoutingAccelerator( CreateCustomRoutingAcceleratorRequest createCustomRoutingAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCustomRoutingAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomRoutingAcceleratorRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomRoutingAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomRoutingAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomRoutingAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCustomRoutingAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCustomRoutingAcceleratorRequest)); 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); } } /** *

* Create an endpoint group for the specified listener for a custom routing accelerator. An endpoint group is a * collection of endpoints in one Amazon Web Services Region. *

* * @param createCustomRoutingEndpointGroupRequest * @return A Java Future containing the result of the CreateCustomRoutingEndpointGroup 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • EndpointGroupAlreadyExistsException The endpoint group that you specified already exists.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidPortRangeException The port numbers that you specified are not valid numbers or are not unique * for this accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateCustomRoutingEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture createCustomRoutingEndpointGroup( CreateCustomRoutingEndpointGroupRequest createCustomRoutingEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCustomRoutingEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomRoutingEndpointGroupRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomRoutingEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateCustomRoutingEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomRoutingEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCustomRoutingEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCustomRoutingEndpointGroupRequest)); 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); } } /** *

* Create a listener to process inbound connections from clients to a custom routing accelerator. Connections arrive * to assigned static IP addresses on the port range that you specify. *

* * @param createCustomRoutingListenerRequest * @return A Java Future containing the result of the CreateCustomRoutingListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InvalidPortRangeException The port numbers that you specified are not valid numbers or are not unique * for this accelerator.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateCustomRoutingListener * @see AWS API Documentation */ @Override public CompletableFuture createCustomRoutingListener( CreateCustomRoutingListenerRequest createCustomRoutingListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCustomRoutingListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomRoutingListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomRoutingListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomRoutingListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomRoutingListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCustomRoutingListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCustomRoutingListenerRequest)); 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); } } /** *

* Create an endpoint group for the specified listener. An endpoint group is a collection of endpoints in one Amazon * Web Services Region. A resource must be valid and active when you add it as an endpoint. *

*

* For more information about endpoint types and requirements for endpoints that you can add to Global Accelerator, * see Endpoints for * standard accelerators in the Global Accelerator Developer Guide. *

* * @param createEndpointGroupRequest * @return A Java Future containing the result of the CreateEndpointGroup 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • EndpointGroupAlreadyExistsException The endpoint group that you specified already exists.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture createEndpointGroup( CreateEndpointGroupRequest createEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createEndpointGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createEndpointGroupRequest)); 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); } } /** *

* Create a listener to process inbound connections from clients to an accelerator. Connections arrive to assigned * static IP addresses on a port, port range, or list of port ranges that you specify. *

* * @param createListenerRequest * @return A Java Future containing the result of the CreateListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InvalidPortRangeException The port numbers that you specified are not valid numbers or are not unique * for this accelerator.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.CreateListener * @see AWS API Documentation */ @Override public CompletableFuture createListener(CreateListenerRequest createListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createListenerRequest)); 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 an accelerator. Before you can delete an accelerator, you must disable it and remove all dependent * resources (listeners and endpoint groups). To disable the accelerator, update the accelerator to set * Enabled to false. *

* *

* When you create an accelerator, by default, Global Accelerator provides you with a set of two static IP * addresses. Alternatively, you can bring your own IP address ranges to Global Accelerator and assign IP addresses * from those ranges. *

*

* The IP addresses are assigned to your accelerator for as long as it exists, even if you disable the accelerator * and it no longer accepts or routes traffic. However, when you delete an accelerator, you lose the static * IP addresses that are assigned to the accelerator, so you can no longer route traffic by using them. As a best * practice, ensure that you have permissions in place to avoid inadvertently deleting accelerators. You can use IAM * policies with Global Accelerator to limit the users who have permissions to delete an accelerator. For more * information, see Identity and access * management in the Global Accelerator Developer Guide. *

*
* * @param deleteAcceleratorRequest * @return A Java Future containing the result of the DeleteAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • AcceleratorNotDisabledException The accelerator that you specified could not be disabled.
  • *
  • AssociatedListenerFoundException The accelerator that you specified has a listener associated with * it. You must remove all dependent resources from an accelerator before you can delete it.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteAccelerator * @see AWS API Documentation */ @Override public CompletableFuture deleteAccelerator(DeleteAcceleratorRequest deleteAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAcceleratorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAcceleratorRequest)); 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 cross-account attachment. When you delete an attachment, Global Accelerator revokes the permission to * use the resources in the attachment from all principals in the list of principals. Global Accelerator revokes the * permission for specific resources. *

*

* For more information, see Working with * cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer * Guide. *

* * @param deleteCrossAccountAttachmentRequest * @return A Java Future containing the result of the DeleteCrossAccountAttachment 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. *
    *
  • AttachmentNotFoundException No cross-account attachment was found.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteCrossAccountAttachment * @see AWS API Documentation */ @Override public CompletableFuture deleteCrossAccountAttachment( DeleteCrossAccountAttachmentRequest deleteCrossAccountAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCrossAccountAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCrossAccountAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCrossAccountAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCrossAccountAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCrossAccountAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCrossAccountAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCrossAccountAttachmentRequest)); 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 custom routing accelerator. Before you can delete an accelerator, you must disable it and remove all * dependent resources (listeners and endpoint groups). To disable the accelerator, update the accelerator to set * Enabled to false. *

* *

* When you create a custom routing accelerator, by default, Global Accelerator provides you with a set of two * static IP addresses. *

*

* The IP addresses are assigned to your accelerator for as long as it exists, even if you disable the accelerator * and it no longer accepts or routes traffic. However, when you delete an accelerator, you lose the static * IP addresses that are assigned to the accelerator, so you can no longer route traffic by using them. As a best * practice, ensure that you have permissions in place to avoid inadvertently deleting accelerators. You can use IAM * policies with Global Accelerator to limit the users who have permissions to delete an accelerator. For more * information, see Identity and access * management in the Global Accelerator Developer Guide. *

*
* * @param deleteCustomRoutingAcceleratorRequest * @return A Java Future containing the result of the DeleteCustomRoutingAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • AcceleratorNotDisabledException The accelerator that you specified could not be disabled.
  • *
  • AssociatedListenerFoundException The accelerator that you specified has a listener associated with * it. You must remove all dependent resources from an accelerator before you can delete it.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteCustomRoutingAccelerator * @see AWS API Documentation */ @Override public CompletableFuture deleteCustomRoutingAccelerator( DeleteCustomRoutingAcceleratorRequest deleteCustomRoutingAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCustomRoutingAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomRoutingAcceleratorRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomRoutingAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomRoutingAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomRoutingAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCustomRoutingAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCustomRoutingAcceleratorRequest)); 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 an endpoint group from a listener for a custom routing accelerator. *

* * @param deleteCustomRoutingEndpointGroupRequest * @return A Java Future containing the result of the DeleteCustomRoutingEndpointGroup 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteCustomRoutingEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture deleteCustomRoutingEndpointGroup( DeleteCustomRoutingEndpointGroupRequest deleteCustomRoutingEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCustomRoutingEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomRoutingEndpointGroupRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomRoutingEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DeleteCustomRoutingEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomRoutingEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCustomRoutingEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCustomRoutingEndpointGroupRequest)); 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 listener for a custom routing accelerator. *

* * @param deleteCustomRoutingListenerRequest * @return A Java Future containing the result of the DeleteCustomRoutingListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • AssociatedEndpointGroupFoundException The listener that you specified has an endpoint group * associated with it. You must remove all dependent resources from a listener before you can delete it.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteCustomRoutingListener * @see AWS API Documentation */ @Override public CompletableFuture deleteCustomRoutingListener( DeleteCustomRoutingListenerRequest deleteCustomRoutingListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCustomRoutingListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomRoutingListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomRoutingListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomRoutingListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomRoutingListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCustomRoutingListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCustomRoutingListenerRequest)); 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 an endpoint group from a listener. *

* * @param deleteEndpointGroupRequest * @return A Java Future containing the result of the DeleteEndpointGroup 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture deleteEndpointGroup( DeleteEndpointGroupRequest deleteEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEndpointGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteEndpointGroupRequest)); 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 listener from an accelerator. *

* * @param deleteListenerRequest * @return A Java Future containing the result of the DeleteListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • AssociatedEndpointGroupFoundException The listener that you specified has an endpoint group * associated with it. You must remove all dependent resources from a listener before you can delete it.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeleteListener * @see AWS API Documentation */ @Override public CompletableFuture deleteListener(DeleteListenerRequest deleteListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteListenerRequest)); 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); } } /** *

* Specify the Amazon EC2 instance (destination) IP addresses and ports for a VPC subnet endpoint that cannot * receive traffic for a custom routing accelerator. You can deny traffic to all destinations in the VPC endpoint, * or deny traffic to a specified list of destination IP addresses and ports. Note that you cannot specify IP * addresses or ports outside of the range that you configured for the endpoint group. *

*

* After you make changes, you can verify that the updates are complete by checking the status of your accelerator: * the status changes from IN_PROGRESS to DEPLOYED. *

* * @param denyCustomRoutingTrafficRequest * @return A Java Future containing the result of the DenyCustomRoutingTraffic 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. *
    *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DenyCustomRoutingTraffic * @see AWS API Documentation */ @Override public CompletableFuture denyCustomRoutingTraffic( DenyCustomRoutingTrafficRequest denyCustomRoutingTrafficRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(denyCustomRoutingTrafficRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, denyCustomRoutingTrafficRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DenyCustomRoutingTraffic"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DenyCustomRoutingTrafficResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DenyCustomRoutingTraffic").withProtocolMetadata(protocolMetadata) .withMarshaller(new DenyCustomRoutingTrafficRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(denyCustomRoutingTrafficRequest)); 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); } } /** *

* Releases the specified address range that you provisioned to use with your Amazon Web Services resources through * bring your own IP addresses (BYOIP) and deletes the corresponding address pool. *

*

* Before you can release an address range, you must stop advertising it by using WithdrawByoipCidr and * you must not have any accelerators that are using static IP addresses allocated from its address range. *

*

* For more information, see Bring your own IP addresses * (BYOIP) in the Global Accelerator Developer Guide. *

* * @param deprovisionByoipCidrRequest * @return A Java Future containing the result of the DeprovisionByoipCidr 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • ByoipCidrNotFoundException The CIDR that you specified was not found or is incorrect.
  • *
  • IncorrectCidrStateException The CIDR that you specified is not valid for this action. For example, * the state of the CIDR might be incorrect for 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DeprovisionByoipCidr * @see AWS API Documentation */ @Override public CompletableFuture deprovisionByoipCidr( DeprovisionByoipCidrRequest deprovisionByoipCidrRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deprovisionByoipCidrRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deprovisionByoipCidrRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeprovisionByoipCidr"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeprovisionByoipCidrResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeprovisionByoipCidr").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeprovisionByoipCidrRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deprovisionByoipCidrRequest)); 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); } } /** *

* Describe an accelerator. *

* * @param describeAcceleratorRequest * @return A Java Future containing the result of the DescribeAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeAccelerator * @see AWS API Documentation */ @Override public CompletableFuture describeAccelerator( DescribeAcceleratorRequest describeAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAcceleratorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAcceleratorRequest)); 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); } } /** *

* Describe the attributes of an accelerator. *

* * @param describeAcceleratorAttributesRequest * @return A Java Future containing the result of the DescribeAcceleratorAttributes 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeAcceleratorAttributes * @see AWS API Documentation */ @Override public CompletableFuture describeAcceleratorAttributes( DescribeAcceleratorAttributesRequest describeAcceleratorAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAcceleratorAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAcceleratorAttributesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAcceleratorAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAcceleratorAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAcceleratorAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAcceleratorAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAcceleratorAttributesRequest)); 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 configuration information about a cross-account attachment. *

* * @param describeCrossAccountAttachmentRequest * @return A Java Future containing the result of the DescribeCrossAccountAttachment 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. *
    *
  • AttachmentNotFoundException No cross-account attachment was found.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeCrossAccountAttachment * @see AWS API Documentation */ @Override public CompletableFuture describeCrossAccountAttachment( DescribeCrossAccountAttachmentRequest describeCrossAccountAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCrossAccountAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCrossAccountAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCrossAccountAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCrossAccountAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCrossAccountAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCrossAccountAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCrossAccountAttachmentRequest)); 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); } } /** *

* Describe a custom routing accelerator. *

* * @param describeCustomRoutingAcceleratorRequest * @return A Java Future containing the result of the DescribeCustomRoutingAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeCustomRoutingAccelerator * @see AWS API Documentation */ @Override public CompletableFuture describeCustomRoutingAccelerator( DescribeCustomRoutingAcceleratorRequest describeCustomRoutingAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCustomRoutingAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCustomRoutingAcceleratorRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCustomRoutingAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeCustomRoutingAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCustomRoutingAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCustomRoutingAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCustomRoutingAcceleratorRequest)); 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); } } /** *

* Describe the attributes of a custom routing accelerator. *

* * @param describeCustomRoutingAcceleratorAttributesRequest * @return A Java Future containing the result of the DescribeCustomRoutingAcceleratorAttributes 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeCustomRoutingAcceleratorAttributes * @see AWS API Documentation */ @Override public CompletableFuture describeCustomRoutingAcceleratorAttributes( DescribeCustomRoutingAcceleratorAttributesRequest describeCustomRoutingAcceleratorAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( describeCustomRoutingAcceleratorAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCustomRoutingAcceleratorAttributesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCustomRoutingAcceleratorAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeCustomRoutingAcceleratorAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCustomRoutingAcceleratorAttributes") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCustomRoutingAcceleratorAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCustomRoutingAcceleratorAttributesRequest)); 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); } } /** *

* Describe an endpoint group for a custom routing accelerator. *

* * @param describeCustomRoutingEndpointGroupRequest * @return A Java Future containing the result of the DescribeCustomRoutingEndpointGroup 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeCustomRoutingEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture describeCustomRoutingEndpointGroup( DescribeCustomRoutingEndpointGroupRequest describeCustomRoutingEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCustomRoutingEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCustomRoutingEndpointGroupRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCustomRoutingEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeCustomRoutingEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCustomRoutingEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCustomRoutingEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCustomRoutingEndpointGroupRequest)); 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); } } /** *

* The description of a listener for a custom routing accelerator. *

* * @param describeCustomRoutingListenerRequest * @return A Java Future containing the result of the DescribeCustomRoutingListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeCustomRoutingListener * @see AWS API Documentation */ @Override public CompletableFuture describeCustomRoutingListener( DescribeCustomRoutingListenerRequest describeCustomRoutingListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCustomRoutingListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCustomRoutingListenerRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCustomRoutingListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCustomRoutingListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeCustomRoutingListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeCustomRoutingListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeCustomRoutingListenerRequest)); 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); } } /** *

* Describe an endpoint group. *

* * @param describeEndpointGroupRequest * @return A Java Future containing the result of the DescribeEndpointGroup 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture describeEndpointGroup( DescribeEndpointGroupRequest describeEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEndpointGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeEndpointGroupRequest)); 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); } } /** *

* Describe a listener. *

* * @param describeListenerRequest * @return A Java Future containing the result of the DescribeListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.DescribeListener * @see AWS API Documentation */ @Override public CompletableFuture describeListener(DescribeListenerRequest describeListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeListenerRequest)); 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); } } /** *

* List the accelerators for an Amazon Web Services account. *

* * @param listAcceleratorsRequest * @return A Java Future containing the result of the ListAccelerators 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListAccelerators * @see AWS API Documentation */ @Override public CompletableFuture listAccelerators(ListAcceleratorsRequest listAcceleratorsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAcceleratorsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAcceleratorsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAccelerators"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAcceleratorsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAccelerators").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAcceleratorsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAcceleratorsRequest)); 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 IP address ranges that were specified in calls to ProvisionByoipCidr, * including the current state and a history of state changes. *

* * @param listByoipCidrsRequest * @return A Java Future containing the result of the ListByoipCidrs 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListByoipCidrs * @see AWS API Documentation */ @Override public CompletableFuture listByoipCidrs(ListByoipCidrsRequest listByoipCidrsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listByoipCidrsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listByoipCidrsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListByoipCidrs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListByoipCidrsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListByoipCidrs").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListByoipCidrsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listByoipCidrsRequest)); 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); } } /** *

* List the cross-account attachments that have been created in Global Accelerator. *

* * @param listCrossAccountAttachmentsRequest * @return A Java Future containing the result of the ListCrossAccountAttachments 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. *
    *
  • AccessDeniedException You don't have access permission.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCrossAccountAttachments * @see AWS API Documentation */ @Override public CompletableFuture listCrossAccountAttachments( ListCrossAccountAttachmentsRequest listCrossAccountAttachmentsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCrossAccountAttachmentsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCrossAccountAttachmentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCrossAccountAttachments"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCrossAccountAttachmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCrossAccountAttachments").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCrossAccountAttachmentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCrossAccountAttachmentsRequest)); 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); } } /** *

* List the accounts that have cross-account resources. *

*

* For more information, see Working with * cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer * Guide. *

* * @param listCrossAccountResourceAccountsRequest * @return A Java Future containing the result of the ListCrossAccountResourceAccounts 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. *
    *
  • AccessDeniedException You don't have access permission.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCrossAccountResourceAccounts * @see AWS API Documentation */ @Override public CompletableFuture listCrossAccountResourceAccounts( ListCrossAccountResourceAccountsRequest listCrossAccountResourceAccountsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCrossAccountResourceAccountsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCrossAccountResourceAccountsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCrossAccountResourceAccounts"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListCrossAccountResourceAccountsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCrossAccountResourceAccounts").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCrossAccountResourceAccountsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCrossAccountResourceAccountsRequest)); 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); } } /** *

* List the cross-account resources available to work with. *

* * @param listCrossAccountResourcesRequest * @return A Java Future containing the result of the ListCrossAccountResources 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCrossAccountResources * @see AWS API Documentation */ @Override public CompletableFuture listCrossAccountResources( ListCrossAccountResourcesRequest listCrossAccountResourcesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCrossAccountResourcesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCrossAccountResourcesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCrossAccountResources"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCrossAccountResourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCrossAccountResources").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCrossAccountResourcesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCrossAccountResourcesRequest)); 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); } } /** *

* List the custom routing accelerators for an Amazon Web Services account. *

* * @param listCustomRoutingAcceleratorsRequest * @return A Java Future containing the result of the ListCustomRoutingAccelerators 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCustomRoutingAccelerators * @see AWS API Documentation */ @Override public CompletableFuture listCustomRoutingAccelerators( ListCustomRoutingAcceleratorsRequest listCustomRoutingAcceleratorsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCustomRoutingAcceleratorsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomRoutingAcceleratorsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomRoutingAccelerators"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomRoutingAcceleratorsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomRoutingAccelerators").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomRoutingAcceleratorsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomRoutingAcceleratorsRequest)); 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); } } /** *

* List the endpoint groups that are associated with a listener for a custom routing accelerator. *

* * @param listCustomRoutingEndpointGroupsRequest * @return A Java Future containing the result of the ListCustomRoutingEndpointGroups 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. *
    *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCustomRoutingEndpointGroups * @see AWS API Documentation */ @Override public CompletableFuture listCustomRoutingEndpointGroups( ListCustomRoutingEndpointGroupsRequest listCustomRoutingEndpointGroupsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCustomRoutingEndpointGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomRoutingEndpointGroupsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomRoutingEndpointGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomRoutingEndpointGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomRoutingEndpointGroups").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomRoutingEndpointGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomRoutingEndpointGroupsRequest)); 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); } } /** *

* List the listeners for a custom routing accelerator. *

* * @param listCustomRoutingListenersRequest * @return A Java Future containing the result of the ListCustomRoutingListeners 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCustomRoutingListeners * @see AWS API Documentation */ @Override public CompletableFuture listCustomRoutingListeners( ListCustomRoutingListenersRequest listCustomRoutingListenersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCustomRoutingListenersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomRoutingListenersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomRoutingListeners"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomRoutingListenersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomRoutingListeners").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomRoutingListenersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomRoutingListenersRequest)); 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); } } /** *

* Provides a complete mapping from the public accelerator IP address and port to destination EC2 instance IP * addresses and ports in the virtual public cloud (VPC) subnet endpoint for a custom routing accelerator. For each * subnet endpoint that you add, Global Accelerator creates a new static port mapping for the accelerator. The port * mappings don't change after Global Accelerator generates them, so you can retrieve and cache the full mapping on * your servers. *

*

* If you remove a subnet from your accelerator, Global Accelerator removes (reclaims) the port mappings. If you add * a subnet to your accelerator, Global Accelerator creates new port mappings (the existing ones don't change). If * you add or remove EC2 instances in your subnet, the port mappings don't change, because the mappings are created * when you add the subnet to Global Accelerator. *

*

* The mappings also include a flag for each destination denoting which destination IP addresses and ports are * allowed or denied traffic. *

* * @param listCustomRoutingPortMappingsRequest * @return A Java Future containing the result of the ListCustomRoutingPortMappings 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCustomRoutingPortMappings * @see AWS API Documentation */ @Override public CompletableFuture listCustomRoutingPortMappings( ListCustomRoutingPortMappingsRequest listCustomRoutingPortMappingsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCustomRoutingPortMappingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomRoutingPortMappingsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomRoutingPortMappings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomRoutingPortMappingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomRoutingPortMappings").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomRoutingPortMappingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomRoutingPortMappingsRequest)); 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); } } /** *

* List the port mappings for a specific EC2 instance (destination) in a VPC subnet endpoint. The response is the * mappings for one destination IP address. This is useful when your subnet endpoint has mappings that span multiple * custom routing accelerators in your account, or for scenarios where you only want to list the port mappings for a * specific destination instance. *

* * @param listCustomRoutingPortMappingsByDestinationRequest * @return A Java Future containing the result of the ListCustomRoutingPortMappingsByDestination 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • EndpointNotFoundException The endpoint that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListCustomRoutingPortMappingsByDestination * @see AWS API Documentation */ @Override public CompletableFuture listCustomRoutingPortMappingsByDestination( ListCustomRoutingPortMappingsByDestinationRequest listCustomRoutingPortMappingsByDestinationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( listCustomRoutingPortMappingsByDestinationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomRoutingPortMappingsByDestinationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomRoutingPortMappingsByDestination"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListCustomRoutingPortMappingsByDestinationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomRoutingPortMappingsByDestination") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomRoutingPortMappingsByDestinationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomRoutingPortMappingsByDestinationRequest)); 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); } } /** *

* List the endpoint groups that are associated with a listener. *

* * @param listEndpointGroupsRequest * @return A Java Future containing the result of the ListEndpointGroups 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. *
    *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListEndpointGroups * @see AWS API Documentation */ @Override public CompletableFuture listEndpointGroups(ListEndpointGroupsRequest listEndpointGroupsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEndpointGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEndpointGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEndpointGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListEndpointGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListEndpointGroups").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListEndpointGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listEndpointGroupsRequest)); 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); } } /** *

* List the listeners for an accelerator. *

* * @param listListenersRequest * @return A Java Future containing the result of the ListListeners 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InvalidNextTokenException There isn't another item to return.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListListeners * @see AWS API Documentation */ @Override public CompletableFuture listListeners(ListListenersRequest listListenersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listListenersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listListenersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListListeners"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListListenersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListListeners").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListListenersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listListenersRequest)); 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); } } /** *

* List all tags for an accelerator. *

*

* For more information, see Tagging in * Global Accelerator in the Global Accelerator Developer Guide. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • AttachmentNotFoundException No cross-account attachment was found.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ListTagsForResource * @see AWS API Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTagsForResourceRequest)); 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); } } /** *

* Provisions an IP address range to use with your Amazon Web Services resources through bring your own IP addresses * (BYOIP) and creates a corresponding address pool. After the address range is provisioned, it is ready to be * advertised using * AdvertiseByoipCidr. *

*

* For more information, see Bring your own IP addresses * (BYOIP) in the Global Accelerator Developer Guide. *

* * @param provisionByoipCidrRequest * @return A Java Future containing the result of the ProvisionByoipCidr 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • IncorrectCidrStateException The CIDR that you specified is not valid for this action. For example, * the state of the CIDR might be incorrect for 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.ProvisionByoipCidr * @see AWS API Documentation */ @Override public CompletableFuture provisionByoipCidr(ProvisionByoipCidrRequest provisionByoipCidrRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(provisionByoipCidrRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, provisionByoipCidrRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ProvisionByoipCidr"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ProvisionByoipCidrResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ProvisionByoipCidr").withProtocolMetadata(protocolMetadata) .withMarshaller(new ProvisionByoipCidrRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(provisionByoipCidrRequest)); 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); } } /** *

* Remove endpoints from a custom routing accelerator. *

* * @param removeCustomRoutingEndpointsRequest * @return A Java Future containing the result of the RemoveCustomRoutingEndpoints 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. *
    *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • EndpointNotFoundException The endpoint that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • ConflictException You can't use both of those options.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.RemoveCustomRoutingEndpoints * @see AWS API Documentation */ @Override public CompletableFuture removeCustomRoutingEndpoints( RemoveCustomRoutingEndpointsRequest removeCustomRoutingEndpointsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(removeCustomRoutingEndpointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, removeCustomRoutingEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveCustomRoutingEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveCustomRoutingEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveCustomRoutingEndpoints").withProtocolMetadata(protocolMetadata) .withMarshaller(new RemoveCustomRoutingEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(removeCustomRoutingEndpointsRequest)); 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); } } /** *

* Remove endpoints from an endpoint group. *

*

* The RemoveEndpoints API operation is the recommended option for removing endpoints. The alternative * is to remove endpoints by updating an endpoint group by using the UpdateEndpointGroup API operation. There are two advantages to using AddEndpoints to remove * endpoints instead: *

*
    *
  • *

    * It's more convenient, because you only need to specify the endpoints that you want to remove. With the * UpdateEndpointGroup API operation, you must specify all of the endpoints in the endpoint group * except the ones that you want to remove from the group. *

    *
  • *
  • *

    * It's faster, because Global Accelerator doesn't need to resolve any endpoints. With the * UpdateEndpointGroup API operation, Global Accelerator must resolve all of the endpoints that remain * in the group. *

    *
  • *
* * @param removeEndpointsRequest * @return A Java Future containing the result of the RemoveEndpoints 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. *
    *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.RemoveEndpoints * @see AWS API Documentation */ @Override public CompletableFuture removeEndpoints(RemoveEndpointsRequest removeEndpointsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(removeEndpointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, removeEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveEndpoints").withProtocolMetadata(protocolMetadata) .withMarshaller(new RemoveEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(removeEndpointsRequest)); 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); } } /** *

* Add tags to an accelerator resource. *

*

* For more information, see Tagging in * Global Accelerator in the Global Accelerator Developer Guide. *

* * @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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.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, "Global Accelerator"); 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); } } /** *

* Remove tags from a Global Accelerator resource. When you specify a tag key, the action removes both that key and * its associated value. The operation succeeds even if you attempt to remove tags from an accelerator that was * already removed. *

*

* For more information, see Tagging in * Global Accelerator in the Global Accelerator Developer Guide. *

* * @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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.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, "Global Accelerator"); 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); } } /** *

* Update an accelerator to make changes, such as the following: *

*
    *
  • *

    * Change the name of the accelerator. *

    *
  • *
  • *

    * Disable the accelerator so that it no longer accepts or routes traffic, or so that you can delete it. *

    *
  • *
  • *

    * Enable the accelerator, if it is disabled. *

    *
  • *
  • *

    * Change the IP address type to dual-stack if it is IPv4, or change the IP address type to IPv4 if it's dual-stack. *

    *
  • *
*

* Be aware that static IP addresses remain assigned to your accelerator for as long as it exists, even if you * disable the accelerator and it no longer accepts or routes traffic. However, when you delete the accelerator, you * lose the static IP addresses that are assigned to it, so you can no longer route traffic by using them. *

* *

* Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you * must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for * example, specify --region us-west-2 on Amazon Web Services CLI commands. *

*
* * @param updateAcceleratorRequest * @return A Java Future containing the result of the UpdateAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • ConflictException You can't use both of those options.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateAccelerator * @see AWS API Documentation */ @Override public CompletableFuture updateAccelerator(UpdateAcceleratorRequest updateAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAcceleratorRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateAcceleratorRequest)); 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); } } /** *

* Update the attributes for an accelerator. *

* * @param updateAcceleratorAttributesRequest * @return A Java Future containing the result of the UpdateAcceleratorAttributes 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateAcceleratorAttributes * @see AWS API Documentation */ @Override public CompletableFuture updateAcceleratorAttributes( UpdateAcceleratorAttributesRequest updateAcceleratorAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAcceleratorAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAcceleratorAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAcceleratorAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAcceleratorAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAcceleratorAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAcceleratorAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateAcceleratorAttributesRequest)); 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); } } /** *

* Update a cross-account attachment to add or remove principals or resources. When you update an attachment to * remove a principal (account ID or accelerator) or a resource, Global Accelerator revokes the permission for * specific resources. *

*

* For more information, see Working with * cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer * Guide. *

* * @param updateCrossAccountAttachmentRequest * @return A Java Future containing the result of the UpdateCrossAccountAttachment 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. *
    *
  • AttachmentNotFoundException No cross-account attachment was found.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateCrossAccountAttachment * @see AWS API Documentation */ @Override public CompletableFuture updateCrossAccountAttachment( UpdateCrossAccountAttachmentRequest updateCrossAccountAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCrossAccountAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCrossAccountAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCrossAccountAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCrossAccountAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCrossAccountAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCrossAccountAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCrossAccountAttachmentRequest)); 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); } } /** *

* Update a custom routing accelerator. *

* * @param updateCustomRoutingAcceleratorRequest * @return A Java Future containing the result of the UpdateCustomRoutingAccelerator 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • ConflictException You can't use both of those options.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateCustomRoutingAccelerator * @see AWS API Documentation */ @Override public CompletableFuture updateCustomRoutingAccelerator( UpdateCustomRoutingAcceleratorRequest updateCustomRoutingAcceleratorRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCustomRoutingAcceleratorRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCustomRoutingAcceleratorRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCustomRoutingAccelerator"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCustomRoutingAcceleratorResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCustomRoutingAccelerator").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCustomRoutingAcceleratorRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCustomRoutingAcceleratorRequest)); 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); } } /** *

* Update the attributes for a custom routing accelerator. *

* * @param updateCustomRoutingAcceleratorAttributesRequest * @return A Java Future containing the result of the UpdateCustomRoutingAcceleratorAttributes 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. *
    *
  • AcceleratorNotFoundException The accelerator that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • TransactionInProgressException There's already a transaction in progress. Another transaction can't * be processed.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateCustomRoutingAcceleratorAttributes * @see AWS API Documentation */ @Override public CompletableFuture updateCustomRoutingAcceleratorAttributes( UpdateCustomRoutingAcceleratorAttributesRequest updateCustomRoutingAcceleratorAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( updateCustomRoutingAcceleratorAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCustomRoutingAcceleratorAttributesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCustomRoutingAcceleratorAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateCustomRoutingAcceleratorAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCustomRoutingAcceleratorAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCustomRoutingAcceleratorAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCustomRoutingAcceleratorAttributesRequest)); 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); } } /** *

* Update a listener for a custom routing accelerator. *

* * @param updateCustomRoutingListenerRequest * @return A Java Future containing the result of the UpdateCustomRoutingListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidPortRangeException The port numbers that you specified are not valid numbers or are not unique * for this accelerator.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateCustomRoutingListener * @see AWS API Documentation */ @Override public CompletableFuture updateCustomRoutingListener( UpdateCustomRoutingListenerRequest updateCustomRoutingListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCustomRoutingListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCustomRoutingListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCustomRoutingListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCustomRoutingListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCustomRoutingListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCustomRoutingListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCustomRoutingListenerRequest)); 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); } } /** *

* Update an endpoint group. A resource must be valid and active when you add it as an endpoint. *

* * @param updateEndpointGroupRequest * @return A Java Future containing the result of the UpdateEndpointGroup 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • EndpointGroupNotFoundException The endpoint group that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateEndpointGroup * @see AWS API Documentation */ @Override public CompletableFuture updateEndpointGroup( UpdateEndpointGroupRequest updateEndpointGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateEndpointGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEndpointGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEndpointGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEndpointGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEndpointGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateEndpointGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateEndpointGroupRequest)); 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); } } /** *

* Update a listener. *

* * @param updateListenerRequest * @return A Java Future containing the result of the UpdateListener 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. *
    *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • InvalidPortRangeException The port numbers that you specified are not valid numbers or are not unique * for this accelerator.
  • *
  • ListenerNotFoundException The listener that you specified doesn't exist.
  • *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • LimitExceededException Processing your request would cause you to exceed an Global Accelerator limit. *
  • *
  • 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.UpdateListener * @see AWS API Documentation */ @Override public CompletableFuture updateListener(UpdateListenerRequest updateListenerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateListenerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateListenerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateListener"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateListenerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateListener").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateListenerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateListenerRequest)); 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); } } /** *

* Stops advertising an address range that is provisioned as an address pool. You can perform this operation at most * once every 10 seconds, even if you specify different address ranges each time. *

*

* It can take a few minutes before traffic to the specified addresses stops routing to Amazon Web Services because * of propagation delays. *

*

* For more information, see Bring your own IP addresses * (BYOIP) in the Global Accelerator Developer Guide. *

* * @param withdrawByoipCidrRequest * @return A Java Future containing the result of the WithdrawByoipCidr 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. *
    *
  • InternalServiceErrorException There was an internal error for Global Accelerator.
  • *
  • InvalidArgumentException An argument that you specified is invalid.
  • *
  • AccessDeniedException You don't have access permission.
  • *
  • ByoipCidrNotFoundException The CIDR that you specified was not found or is incorrect.
  • *
  • IncorrectCidrStateException The CIDR that you specified is not valid for this action. For example, * the state of the CIDR might be incorrect for 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.
  • *
  • GlobalAcceleratorException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample GlobalAcceleratorAsyncClient.WithdrawByoipCidr * @see AWS API Documentation */ @Override public CompletableFuture withdrawByoipCidr(WithdrawByoipCidrRequest withdrawByoipCidrRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(withdrawByoipCidrRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, withdrawByoipCidrRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Global Accelerator"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "WithdrawByoipCidr"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, WithdrawByoipCidrResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("WithdrawByoipCidr").withProtocolMetadata(protocolMetadata) .withMarshaller(new WithdrawByoipCidrRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(withdrawByoipCidrRequest)); 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 GlobalAcceleratorServiceClientConfiguration serviceClientConfiguration() { return new GlobalAcceleratorServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(GlobalAcceleratorException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("EndpointNotFoundException") .exceptionBuilderSupplier(EndpointNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AssociatedListenerFoundException") .exceptionBuilderSupplier(AssociatedListenerFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AssociatedEndpointGroupFoundException") .exceptionBuilderSupplier(AssociatedEndpointGroupFoundException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidNextTokenException") .exceptionBuilderSupplier(InvalidNextTokenException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EndpointGroupAlreadyExistsException") .exceptionBuilderSupplier(EndpointGroupAlreadyExistsException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidPortRangeException") .exceptionBuilderSupplier(InvalidPortRangeException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EndpointAlreadyExistsException") .exceptionBuilderSupplier(EndpointAlreadyExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AttachmentNotFoundException") .exceptionBuilderSupplier(AttachmentNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidArgumentException") .exceptionBuilderSupplier(InvalidArgumentException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ListenerNotFoundException") .exceptionBuilderSupplier(ListenerNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AcceleratorNotFoundException") .exceptionBuilderSupplier(AcceleratorNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IncorrectCidrStateException") .exceptionBuilderSupplier(IncorrectCidrStateException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TransactionInProgressException") .exceptionBuilderSupplier(TransactionInProgressException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ByoipCidrNotFoundException") .exceptionBuilderSupplier(ByoipCidrNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServiceErrorException") .exceptionBuilderSupplier(InternalServiceErrorException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EndpointGroupNotFoundException") .exceptionBuilderSupplier(EndpointGroupNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AcceleratorNotDisabledException") .exceptionBuilderSupplier(AcceleratorNotDisabledException::builder).httpStatusCode(400).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 void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } 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(); } GlobalAcceleratorServiceClientConfigurationBuilder serviceConfigBuilder = new GlobalAcceleratorServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy