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

software.amazon.awssdk.services.directconnect.DefaultDirectConnectAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Direct Connect module holds the client classes that are used for communicating with AWS Direct Connect Service

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

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.directconnect.model.AcceptDirectConnectGatewayAssociationProposalRequest;
import software.amazon.awssdk.services.directconnect.model.AcceptDirectConnectGatewayAssociationProposalResponse;
import software.amazon.awssdk.services.directconnect.model.AllocateHostedConnectionRequest;
import software.amazon.awssdk.services.directconnect.model.AllocateHostedConnectionResponse;
import software.amazon.awssdk.services.directconnect.model.AllocatePrivateVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.AllocatePrivateVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.AllocatePublicVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.AllocatePublicVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.AllocateTransitVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.AllocateTransitVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.AssociateConnectionWithLagRequest;
import software.amazon.awssdk.services.directconnect.model.AssociateConnectionWithLagResponse;
import software.amazon.awssdk.services.directconnect.model.AssociateHostedConnectionRequest;
import software.amazon.awssdk.services.directconnect.model.AssociateHostedConnectionResponse;
import software.amazon.awssdk.services.directconnect.model.AssociateVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.AssociateVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.ConfirmConnectionRequest;
import software.amazon.awssdk.services.directconnect.model.ConfirmConnectionResponse;
import software.amazon.awssdk.services.directconnect.model.ConfirmPrivateVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.ConfirmPrivateVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.ConfirmPublicVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.ConfirmPublicVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.ConfirmTransitVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.ConfirmTransitVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.CreateBgpPeerRequest;
import software.amazon.awssdk.services.directconnect.model.CreateBgpPeerResponse;
import software.amazon.awssdk.services.directconnect.model.CreateConnectionRequest;
import software.amazon.awssdk.services.directconnect.model.CreateConnectionResponse;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayAssociationProposalRequest;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayAssociationProposalResponse;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayAssociationRequest;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayAssociationResponse;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayRequest;
import software.amazon.awssdk.services.directconnect.model.CreateDirectConnectGatewayResponse;
import software.amazon.awssdk.services.directconnect.model.CreateInterconnectRequest;
import software.amazon.awssdk.services.directconnect.model.CreateInterconnectResponse;
import software.amazon.awssdk.services.directconnect.model.CreateLagRequest;
import software.amazon.awssdk.services.directconnect.model.CreateLagResponse;
import software.amazon.awssdk.services.directconnect.model.CreatePrivateVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.CreatePrivateVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.CreatePublicVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.CreatePublicVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.CreateTransitVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.CreateTransitVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteBgpPeerRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteBgpPeerResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteConnectionRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteConnectionResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayAssociationProposalRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayAssociationProposalResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayAssociationRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayAssociationResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteDirectConnectGatewayResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteInterconnectRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteInterconnectResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteLagRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteLagResponse;
import software.amazon.awssdk.services.directconnect.model.DeleteVirtualInterfaceRequest;
import software.amazon.awssdk.services.directconnect.model.DeleteVirtualInterfaceResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeConnectionsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeConnectionsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAssociationProposalsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAssociationProposalsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAssociationsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAssociationsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAttachmentsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewayAttachmentsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewaysRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeDirectConnectGatewaysResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeHostedConnectionsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeHostedConnectionsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeInterconnectsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeInterconnectsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeLagsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeLagsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeLoaRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeLoaResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeLocationsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeLocationsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeTagsRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeTagsResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeVirtualGatewaysRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeVirtualGatewaysResponse;
import software.amazon.awssdk.services.directconnect.model.DescribeVirtualInterfacesRequest;
import software.amazon.awssdk.services.directconnect.model.DescribeVirtualInterfacesResponse;
import software.amazon.awssdk.services.directconnect.model.DirectConnectClientException;
import software.amazon.awssdk.services.directconnect.model.DirectConnectException;
import software.amazon.awssdk.services.directconnect.model.DirectConnectRequest;
import software.amazon.awssdk.services.directconnect.model.DirectConnectServerException;
import software.amazon.awssdk.services.directconnect.model.DisassociateConnectionFromLagRequest;
import software.amazon.awssdk.services.directconnect.model.DisassociateConnectionFromLagResponse;
import software.amazon.awssdk.services.directconnect.model.DuplicateTagKeysException;
import software.amazon.awssdk.services.directconnect.model.ListVirtualInterfaceTestHistoryRequest;
import software.amazon.awssdk.services.directconnect.model.ListVirtualInterfaceTestHistoryResponse;
import software.amazon.awssdk.services.directconnect.model.StartBgpFailoverTestRequest;
import software.amazon.awssdk.services.directconnect.model.StartBgpFailoverTestResponse;
import software.amazon.awssdk.services.directconnect.model.StopBgpFailoverTestRequest;
import software.amazon.awssdk.services.directconnect.model.StopBgpFailoverTestResponse;
import software.amazon.awssdk.services.directconnect.model.TagResourceRequest;
import software.amazon.awssdk.services.directconnect.model.TagResourceResponse;
import software.amazon.awssdk.services.directconnect.model.TooManyTagsException;
import software.amazon.awssdk.services.directconnect.model.UntagResourceRequest;
import software.amazon.awssdk.services.directconnect.model.UntagResourceResponse;
import software.amazon.awssdk.services.directconnect.model.UpdateDirectConnectGatewayAssociationRequest;
import software.amazon.awssdk.services.directconnect.model.UpdateDirectConnectGatewayAssociationResponse;
import software.amazon.awssdk.services.directconnect.model.UpdateLagRequest;
import software.amazon.awssdk.services.directconnect.model.UpdateLagResponse;
import software.amazon.awssdk.services.directconnect.model.UpdateVirtualInterfaceAttributesRequest;
import software.amazon.awssdk.services.directconnect.model.UpdateVirtualInterfaceAttributesResponse;
import software.amazon.awssdk.services.directconnect.transform.AcceptDirectConnectGatewayAssociationProposalRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AllocateHostedConnectionRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AllocatePrivateVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AllocatePublicVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AllocateTransitVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AssociateConnectionWithLagRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AssociateHostedConnectionRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.AssociateVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.ConfirmConnectionRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.ConfirmPrivateVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.ConfirmPublicVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.ConfirmTransitVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateBgpPeerRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateConnectionRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateDirectConnectGatewayAssociationProposalRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateDirectConnectGatewayAssociationRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateDirectConnectGatewayRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateInterconnectRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateLagRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreatePrivateVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreatePublicVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.CreateTransitVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteBgpPeerRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteConnectionRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteDirectConnectGatewayAssociationProposalRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteDirectConnectGatewayAssociationRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteDirectConnectGatewayRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteInterconnectRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteLagRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DeleteVirtualInterfaceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeConnectionsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeDirectConnectGatewayAssociationProposalsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeDirectConnectGatewayAssociationsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeDirectConnectGatewayAttachmentsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeDirectConnectGatewaysRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeHostedConnectionsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeInterconnectsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeLagsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeLoaRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeLocationsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeTagsRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeVirtualGatewaysRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DescribeVirtualInterfacesRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.DisassociateConnectionFromLagRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.ListVirtualInterfaceTestHistoryRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.StartBgpFailoverTestRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.StopBgpFailoverTestRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.UpdateDirectConnectGatewayAssociationRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.UpdateLagRequestMarshaller;
import software.amazon.awssdk.services.directconnect.transform.UpdateVirtualInterfaceAttributesRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultDirectConnectAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* Accepts a proposal request to attach a virtual private gateway or transit gateway to a Direct Connect gateway. *

* * @param acceptDirectConnectGatewayAssociationProposalRequest * @return A Java Future containing the result of the AcceptDirectConnectGatewayAssociationProposal operation * returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AcceptDirectConnectGatewayAssociationProposal * @see AWS API Documentation */ @Override public CompletableFuture acceptDirectConnectGatewayAssociationProposal( AcceptDirectConnectGatewayAssociationProposalRequest acceptDirectConnectGatewayAssociationProposalRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptDirectConnectGatewayAssociationProposalRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptDirectConnectGatewayAssociationProposal"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, AcceptDirectConnectGatewayAssociationProposalResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AcceptDirectConnectGatewayAssociationProposal") .withMarshaller(new AcceptDirectConnectGatewayAssociationProposalRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(acceptDirectConnectGatewayAssociationProposalRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = acceptDirectConnectGatewayAssociationProposalRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete(( r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a hosted connection on the specified interconnect or a link aggregation group (LAG) of interconnects. *

*

* Allocates a VLAN number and a specified amount of capacity (bandwidth) for use by a hosted connection on the * specified interconnect or LAG of interconnects. AWS polices the hosted connection for the specified capacity and * the AWS Direct Connect Partner must also police the hosted connection for the specified capacity. *

* *

* Intended for use by AWS Direct Connect Partners only. *

*
* * @param allocateHostedConnectionRequest * @return A Java Future containing the result of the AllocateHostedConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AllocateHostedConnection * @see AWS API Documentation */ @Override public CompletableFuture allocateHostedConnection( AllocateHostedConnectionRequest allocateHostedConnectionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, allocateHostedConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AllocateHostedConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AllocateHostedConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AllocateHostedConnection") .withMarshaller(new AllocateHostedConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(allocateHostedConnectionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = allocateHostedConnectionRequest.overrideConfiguration() .orElse(null); 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 a private virtual interface to be owned by the specified AWS account. *

*

* Virtual interfaces created using this action must be confirmed by the owner using * ConfirmPrivateVirtualInterface. Until then, the virtual interface is in the Confirming state * and is not available to handle traffic. *

* * @param allocatePrivateVirtualInterfaceRequest * @return A Java Future containing the result of the AllocatePrivateVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AllocatePrivateVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture allocatePrivateVirtualInterface( AllocatePrivateVirtualInterfaceRequest allocatePrivateVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, allocatePrivateVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AllocatePrivateVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AllocatePrivateVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AllocatePrivateVirtualInterface") .withMarshaller(new AllocatePrivateVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(allocatePrivateVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = allocatePrivateVirtualInterfaceRequest .overrideConfiguration().orElse(null); 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 a public virtual interface to be owned by the specified AWS account. *

*

* The owner of a connection calls this function to provision a public virtual interface to be owned by the * specified AWS account. *

*

* Virtual interfaces created using this function must be confirmed by the owner using * ConfirmPublicVirtualInterface. Until this step has been completed, the virtual interface is in the * confirming state and is not available to handle traffic. *

*

* When creating an IPv6 public virtual interface, omit the Amazon address and customer address. IPv6 addresses are * automatically assigned from the Amazon pool of IPv6 addresses; you cannot specify custom IPv6 addresses. *

* * @param allocatePublicVirtualInterfaceRequest * @return A Java Future containing the result of the AllocatePublicVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AllocatePublicVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture allocatePublicVirtualInterface( AllocatePublicVirtualInterfaceRequest allocatePublicVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, allocatePublicVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AllocatePublicVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AllocatePublicVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AllocatePublicVirtualInterface") .withMarshaller(new AllocatePublicVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(allocatePublicVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = allocatePublicVirtualInterfaceRequest.overrideConfiguration() .orElse(null); 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 a transit virtual interface to be owned by the specified AWS account. Use this type of interface to * connect a transit gateway to your Direct Connect gateway. *

*

* The owner of a connection provisions a transit virtual interface to be owned by the specified AWS account. *

*

* After you create a transit virtual interface, it must be confirmed by the owner using * ConfirmTransitVirtualInterface. Until this step has been completed, the transit virtual interface is in * the requested state and is not available to handle traffic. *

* * @param allocateTransitVirtualInterfaceRequest * @return A Java Future containing the result of the AllocateTransitVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AllocateTransitVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture allocateTransitVirtualInterface( AllocateTransitVirtualInterfaceRequest allocateTransitVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, allocateTransitVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AllocateTransitVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AllocateTransitVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AllocateTransitVirtualInterface") .withMarshaller(new AllocateTransitVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(allocateTransitVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = allocateTransitVirtualInterfaceRequest .overrideConfiguration().orElse(null); 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); } } /** *

* Associates an existing connection with a link aggregation group (LAG). The connection is interrupted and * re-established as a member of the LAG (connectivity to AWS is interrupted). The connection must be hosted on the * same AWS Direct Connect endpoint as the LAG, and its bandwidth must match the bandwidth for the LAG. You can * re-associate a connection that's currently associated with a different LAG; however, if removing the connection * would cause the original LAG to fall below its setting for minimum number of operational connections, the request * fails. *

*

* Any virtual interfaces that are directly associated with the connection are automatically re-associated with the * LAG. If the connection was originally associated with a different LAG, the virtual interfaces remain associated * with the original LAG. *

*

* For interconnects, any hosted connections are automatically re-associated with the LAG. If the interconnect was * originally associated with a different LAG, the hosted connections remain associated with the original LAG. *

* * @param associateConnectionWithLagRequest * @return A Java Future containing the result of the AssociateConnectionWithLag operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AssociateConnectionWithLag * @see AWS API Documentation */ @Override public CompletableFuture associateConnectionWithLag( AssociateConnectionWithLagRequest associateConnectionWithLagRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, associateConnectionWithLagRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateConnectionWithLag"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateConnectionWithLagResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateConnectionWithLag") .withMarshaller(new AssociateConnectionWithLagRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(associateConnectionWithLagRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = associateConnectionWithLagRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Associates a hosted connection and its virtual interfaces with a link aggregation group (LAG) or interconnect. If * the target interconnect or LAG has an existing hosted connection with a conflicting VLAN number or IP address, * the operation fails. This action temporarily interrupts the hosted connection's connectivity to AWS as it is * being migrated. *

* *

* Intended for use by AWS Direct Connect Partners only. *

*
* * @param associateHostedConnectionRequest * @return A Java Future containing the result of the AssociateHostedConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AssociateHostedConnection * @see AWS API Documentation */ @Override public CompletableFuture associateHostedConnection( AssociateHostedConnectionRequest associateHostedConnectionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, associateHostedConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateHostedConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateHostedConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateHostedConnection") .withMarshaller(new AssociateHostedConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(associateHostedConnectionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = associateHostedConnectionRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Associates a virtual interface with a specified link aggregation group (LAG) or connection. Connectivity to AWS * is temporarily interrupted as the virtual interface is being migrated. If the target connection or LAG has an * associated virtual interface with a conflicting VLAN number or a conflicting IP address, the operation fails. *

*

* Virtual interfaces associated with a hosted connection cannot be associated with a LAG; hosted connections must * be migrated along with their virtual interfaces using AssociateHostedConnection. *

*

* To reassociate a virtual interface to a new connection or LAG, the requester must own either the virtual * interface itself or the connection to which the virtual interface is currently associated. Additionally, the * requester must own the connection or LAG for the association. *

* * @param associateVirtualInterfaceRequest * @return A Java Future containing the result of the AssociateVirtualInterface operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.AssociateVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture associateVirtualInterface( AssociateVirtualInterfaceRequest associateVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, associateVirtualInterfaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateVirtualInterface") .withMarshaller(new AssociateVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(associateVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = associateVirtualInterfaceRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Confirms the creation of the specified hosted connection on an interconnect. *

*

* Upon creation, the hosted connection is initially in the Ordering state, and remains in this state * until the owner confirms creation of the hosted connection. *

* * @param confirmConnectionRequest * @return A Java Future containing the result of the ConfirmConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.ConfirmConnection * @see AWS API Documentation */ @Override public CompletableFuture confirmConnection(ConfirmConnectionRequest confirmConnectionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmConnection") .withMarshaller(new ConfirmConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(confirmConnectionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = confirmConnectionRequest.overrideConfiguration().orElse(null); 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); } } /** *

* Accepts ownership of a private virtual interface created by another AWS account. *

*

* After the virtual interface owner makes this call, the virtual interface is created and attached to the specified * virtual private gateway or Direct Connect gateway, and is made available to handle traffic. *

* * @param confirmPrivateVirtualInterfaceRequest * @return A Java Future containing the result of the ConfirmPrivateVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.ConfirmPrivateVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture confirmPrivateVirtualInterface( ConfirmPrivateVirtualInterfaceRequest confirmPrivateVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmPrivateVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmPrivateVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmPrivateVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmPrivateVirtualInterface") .withMarshaller(new ConfirmPrivateVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(confirmPrivateVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = confirmPrivateVirtualInterfaceRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Accepts ownership of a public virtual interface created by another AWS account. *

*

* After the virtual interface owner makes this call, the specified virtual interface is created and made available * to handle traffic. *

* * @param confirmPublicVirtualInterfaceRequest * @return A Java Future containing the result of the ConfirmPublicVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.ConfirmPublicVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture confirmPublicVirtualInterface( ConfirmPublicVirtualInterfaceRequest confirmPublicVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmPublicVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmPublicVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmPublicVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmPublicVirtualInterface") .withMarshaller(new ConfirmPublicVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(confirmPublicVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = confirmPublicVirtualInterfaceRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Accepts ownership of a transit virtual interface created by another AWS account. *

*

* After the owner of the transit virtual interface makes this call, the specified transit virtual interface is * created and made available to handle traffic. *

* * @param confirmTransitVirtualInterfaceRequest * @return A Java Future containing the result of the ConfirmTransitVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.ConfirmTransitVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture confirmTransitVirtualInterface( ConfirmTransitVirtualInterfaceRequest confirmTransitVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmTransitVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmTransitVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmTransitVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmTransitVirtualInterface") .withMarshaller(new ConfirmTransitVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(confirmTransitVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = confirmTransitVirtualInterfaceRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a BGP peer on the specified virtual interface. *

*

* You must create a BGP peer for the corresponding address family (IPv4/IPv6) in order to access AWS resources that * also use that address family. *

*

* If logical redundancy is not supported by the connection, interconnect, or LAG, the BGP peer cannot be in the * same address family as an existing BGP peer on the virtual interface. *

*

* When creating a IPv6 BGP peer, omit the Amazon address and customer address. IPv6 addresses are automatically * assigned from the Amazon pool of IPv6 addresses; you cannot specify custom IPv6 addresses. *

*

* For a public virtual interface, the Autonomous System Number (ASN) must be private or already whitelisted for the * virtual interface. *

* * @param createBgpPeerRequest * @return A Java Future containing the result of the CreateBGPPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateBGPPeer * @see AWS * API Documentation */ @Override public CompletableFuture createBGPPeer(CreateBgpPeerRequest createBgpPeerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createBgpPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateBGPPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateBgpPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateBGPPeer") .withMarshaller(new CreateBgpPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createBgpPeerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createBgpPeerRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a connection between a customer network and a specific AWS Direct Connect location. *

*

* A connection links your internal network to an AWS Direct Connect location over a standard Ethernet fiber-optic * cable. One end of the cable is connected to your router, the other to an AWS Direct Connect router. *

*

* To find the locations for your Region, use DescribeLocations. *

*

* You can automatically add the new connection to a link aggregation group (LAG) by specifying a LAG ID in the * request. This ensures that the new connection is allocated on the same AWS Direct Connect endpoint that hosts the * specified LAG. If there are no available ports on the endpoint, the request fails and no connection is created. *

* * @param createConnectionRequest * @return A Java Future containing the result of the CreateConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateConnection * @see AWS * API Documentation */ @Override public CompletableFuture createConnection(CreateConnectionRequest createConnectionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateConnection") .withMarshaller(new CreateConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createConnectionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createConnectionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a Direct Connect gateway, which is an intermediate object that enables you to connect a set of virtual * interfaces and virtual private gateways. A Direct Connect gateway is global and visible in any AWS Region after * it is created. The virtual interfaces and virtual private gateways that are connected through a Direct Connect * gateway can be in different AWS Regions. This enables you to connect to a VPC in any Region, regardless of the * Region in which the virtual interfaces are located, and pass traffic between them. *

* * @param createDirectConnectGatewayRequest * @return A Java Future containing the result of the CreateDirectConnectGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateDirectConnectGateway * @see AWS API Documentation */ @Override public CompletableFuture createDirectConnectGateway( CreateDirectConnectGatewayRequest createDirectConnectGatewayRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDirectConnectGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectConnectGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDirectConnectGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDirectConnectGateway") .withMarshaller(new CreateDirectConnectGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDirectConnectGatewayRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDirectConnectGatewayRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an association between a Direct Connect gateway and a virtual private gateway. The virtual private * gateway must be attached to a VPC and must not be associated with another Direct Connect gateway. *

* * @param createDirectConnectGatewayAssociationRequest * @return A Java Future containing the result of the CreateDirectConnectGatewayAssociation operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateDirectConnectGatewayAssociation * @see AWS API Documentation */ @Override public CompletableFuture createDirectConnectGatewayAssociation( CreateDirectConnectGatewayAssociationRequest createDirectConnectGatewayAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDirectConnectGatewayAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectConnectGatewayAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateDirectConnectGatewayAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDirectConnectGatewayAssociation") .withMarshaller(new CreateDirectConnectGatewayAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createDirectConnectGatewayAssociationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDirectConnectGatewayAssociationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a proposal to associate the specified virtual private gateway or transit gateway with the specified * Direct Connect gateway. *

*

* You can associate a Direct Connect gateway and virtual private gateway or transit gateway that is owned by any * AWS account. *

* * @param createDirectConnectGatewayAssociationProposalRequest * @return A Java Future containing the result of the CreateDirectConnectGatewayAssociationProposal operation * returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateDirectConnectGatewayAssociationProposal * @see AWS API Documentation */ @Override public CompletableFuture createDirectConnectGatewayAssociationProposal( CreateDirectConnectGatewayAssociationProposalRequest createDirectConnectGatewayAssociationProposalRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createDirectConnectGatewayAssociationProposalRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectConnectGatewayAssociationProposal"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateDirectConnectGatewayAssociationProposalResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDirectConnectGatewayAssociationProposal") .withMarshaller(new CreateDirectConnectGatewayAssociationProposalRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(createDirectConnectGatewayAssociationProposalRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createDirectConnectGatewayAssociationProposalRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete(( r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an interconnect between an AWS Direct Connect Partner's network and a specific AWS Direct Connect * location. *

*

* An interconnect is a connection that is capable of hosting other connections. The AWS Direct Connect partner can * use an interconnect to provide AWS Direct Connect hosted connections to customers through their own network * services. Like a standard connection, an interconnect links the partner's network to an AWS Direct Connect * location over a standard Ethernet fiber-optic cable. One end is connected to the partner's router, the other to * an AWS Direct Connect router. *

*

* You can automatically add the new interconnect to a link aggregation group (LAG) by specifying a LAG ID in the * request. This ensures that the new interconnect is allocated on the same AWS Direct Connect endpoint that hosts * the specified LAG. If there are no available ports on the endpoint, the request fails and no interconnect is * created. *

*

* For each end customer, the AWS Direct Connect Partner provisions a connection on their interconnect by calling * AllocateHostedConnection. The end customer can then connect to AWS resources by creating a virtual * interface on their connection, using the VLAN assigned to them by the AWS Direct Connect Partner. *

* *

* Intended for use by AWS Direct Connect Partners only. *

*
* * @param createInterconnectRequest * @return A Java Future containing the result of the CreateInterconnect operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateInterconnect * @see AWS API Documentation */ @Override public CompletableFuture createInterconnect(CreateInterconnectRequest createInterconnectRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createInterconnectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateInterconnect"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateInterconnectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateInterconnect") .withMarshaller(new CreateInterconnectRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createInterconnectRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createInterconnectRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a link aggregation group (LAG) with the specified number of bundled physical dedicated connections * between the customer network and a specific AWS Direct Connect location. A LAG is a logical interface that uses * the Link Aggregation Control Protocol (LACP) to aggregate multiple interfaces, enabling you to treat them as a * single interface. *

*

* All connections in a LAG must use the same bandwidth (either 1Gbps or 10Gbps) and must terminate at the same AWS * Direct Connect endpoint. *

*

* You can have up to 10 dedicated connections per LAG. Regardless of this limit, if you request more connections * for the LAG than AWS Direct Connect can allocate on a single endpoint, no LAG is created. *

*

* You can specify an existing physical dedicated connection or interconnect to include in the LAG (which counts * towards the total number of connections). Doing so interrupts the current physical dedicated connection, and * re-establishes them as a member of the LAG. The LAG will be created on the same AWS Direct Connect endpoint to * which the dedicated connection terminates. Any virtual interfaces associated with the dedicated connection are * automatically disassociated and re-associated with the LAG. The connection ID does not change. *

*

* If the AWS account used to create a LAG is a registered AWS Direct Connect Partner, the LAG is automatically * enabled to host sub-connections. For a LAG owned by a partner, any associated virtual interfaces cannot be * directly configured. *

* * @param createLagRequest * @return A Java Future containing the result of the CreateLag operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateLag * @see AWS API * Documentation */ @Override public CompletableFuture createLag(CreateLagRequest createLagRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createLagRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLag"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateLagResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateLag") .withMarshaller(new CreateLagRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(createLagRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createLagRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. * A private virtual interface can be connected to either a Direct Connect gateway or a Virtual Private Gateway * (VGW). Connecting the private virtual interface to a Direct Connect gateway enables the possibility for * connecting to multiple VPCs, including VPCs in different AWS Regions. Connecting the private virtual interface to * a VGW only provides access to a single VPC within the same Region. *

*

* Setting the MTU of a virtual interface to 9001 (jumbo frames) can cause an update to the underlying physical * connection if it wasn't updated to support jumbo frames. Updating the connection disrupts network connectivity * for all virtual interfaces associated with the connection for up to 30 seconds. To check whether your connection * supports jumbo frames, call DescribeConnections. To check whether your virtual interface supports jumbo * frames, call DescribeVirtualInterfaces. *

* * @param createPrivateVirtualInterfaceRequest * @return A Java Future containing the result of the CreatePrivateVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreatePrivateVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture createPrivateVirtualInterface( CreatePrivateVirtualInterfaceRequest createPrivateVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createPrivateVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePrivateVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreatePrivateVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreatePrivateVirtualInterface") .withMarshaller(new CreatePrivateVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createPrivateVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createPrivateVirtualInterfaceRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a public virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A * public virtual interface supports sending traffic to public services of AWS such as Amazon S3. *

*

* When creating an IPv6 public virtual interface (addressFamily is ipv6), leave the * customer and amazon address fields blank to use auto-assigned IPv6 space. Custom IPv6 * addresses are not supported. *

* * @param createPublicVirtualInterfaceRequest * @return A Java Future containing the result of the CreatePublicVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreatePublicVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture createPublicVirtualInterface( CreatePublicVirtualInterfaceRequest createPublicVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createPublicVirtualInterfaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePublicVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreatePublicVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreatePublicVirtualInterface") .withMarshaller(new CreatePublicVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createPublicVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createPublicVirtualInterfaceRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a transit virtual interface. A transit virtual interface should be used to access one or more transit * gateways associated with Direct Connect gateways. A transit virtual interface enables the connection of multiple * VPCs attached to a transit gateway to a Direct Connect gateway. *

* *

* If you associate your transit gateway with one or more Direct Connect gateways, the Autonomous System Number * (ASN) used by the transit gateway and the Direct Connect gateway must be different. For example, if you use the * default ASN 64512 for both your the transit gateway and Direct Connect gateway, the association request fails. *

*
*

* Setting the MTU of a virtual interface to 8500 (jumbo frames) can cause an update to the underlying physical * connection if it wasn't updated to support jumbo frames. Updating the connection disrupts network connectivity * for all virtual interfaces associated with the connection for up to 30 seconds. To check whether your connection * supports jumbo frames, call DescribeConnections. To check whether your virtual interface supports jumbo * frames, call DescribeVirtualInterfaces. *

* * @param createTransitVirtualInterfaceRequest * @return A Java Future containing the result of the CreateTransitVirtualInterface operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.CreateTransitVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture createTransitVirtualInterface( CreateTransitVirtualInterfaceRequest createTransitVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createTransitVirtualInterfaceRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTransitVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateTransitVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateTransitVirtualInterface") .withMarshaller(new CreateTransitVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createTransitVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createTransitVirtualInterfaceRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified BGP peer on the specified virtual interface with the specified customer address and ASN. *

*

* You cannot delete the last BGP peer from a virtual interface. *

* * @param deleteBgpPeerRequest * @return A Java Future containing the result of the DeleteBGPPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteBGPPeer * @see AWS * API Documentation */ @Override public CompletableFuture deleteBGPPeer(DeleteBgpPeerRequest deleteBgpPeerRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBgpPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBGPPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteBgpPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteBGPPeer") .withMarshaller(new DeleteBgpPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteBgpPeerRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteBgpPeerRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified connection. *

*

* Deleting a connection only stops the AWS Direct Connect port hour and data transfer charges. If you are * partnering with any third parties to connect with the AWS Direct Connect location, you must cancel your service * with them separately. *

* * @param deleteConnectionRequest * @return A Java Future containing the result of the DeleteConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteConnection * @see AWS * API Documentation */ @Override public CompletableFuture deleteConnection(DeleteConnectionRequest deleteConnectionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnection") .withMarshaller(new DeleteConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteConnectionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteConnectionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified Direct Connect gateway. You must first delete all virtual interfaces that are attached to * the Direct Connect gateway and disassociate all virtual private gateways associated with the Direct Connect * gateway. *

* * @param deleteDirectConnectGatewayRequest * @return A Java Future containing the result of the DeleteDirectConnectGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteDirectConnectGateway * @see AWS API Documentation */ @Override public CompletableFuture deleteDirectConnectGateway( DeleteDirectConnectGatewayRequest deleteDirectConnectGatewayRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDirectConnectGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDirectConnectGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDirectConnectGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDirectConnectGateway") .withMarshaller(new DeleteDirectConnectGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDirectConnectGatewayRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDirectConnectGatewayRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the association between the specified Direct Connect gateway and virtual private gateway. *

*

* We recommend that you specify the associationID to delete the association. Alternatively, if you own * virtual gateway and a Direct Connect gateway association, you can specify the virtualGatewayId and * directConnectGatewayId to delete an association. *

* * @param deleteDirectConnectGatewayAssociationRequest * @return A Java Future containing the result of the DeleteDirectConnectGatewayAssociation operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteDirectConnectGatewayAssociation * @see AWS API Documentation */ @Override public CompletableFuture deleteDirectConnectGatewayAssociation( DeleteDirectConnectGatewayAssociationRequest deleteDirectConnectGatewayAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDirectConnectGatewayAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDirectConnectGatewayAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DeleteDirectConnectGatewayAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDirectConnectGatewayAssociation") .withMarshaller(new DeleteDirectConnectGatewayAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteDirectConnectGatewayAssociationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDirectConnectGatewayAssociationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the association proposal request between the specified Direct Connect gateway and virtual private gateway * or transit gateway. *

* * @param deleteDirectConnectGatewayAssociationProposalRequest * @return A Java Future containing the result of the DeleteDirectConnectGatewayAssociationProposal operation * returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteDirectConnectGatewayAssociationProposal * @see AWS API Documentation */ @Override public CompletableFuture deleteDirectConnectGatewayAssociationProposal( DeleteDirectConnectGatewayAssociationProposalRequest deleteDirectConnectGatewayAssociationProposalRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDirectConnectGatewayAssociationProposalRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDirectConnectGatewayAssociationProposal"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DeleteDirectConnectGatewayAssociationProposalResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDirectConnectGatewayAssociationProposal") .withMarshaller(new DeleteDirectConnectGatewayAssociationProposalRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(deleteDirectConnectGatewayAssociationProposalRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteDirectConnectGatewayAssociationProposalRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete(( r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified interconnect. *

* *

* Intended for use by AWS Direct Connect Partners only. *

*
* * @param deleteInterconnectRequest * @return A Java Future containing the result of the DeleteInterconnect operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteInterconnect * @see AWS API Documentation */ @Override public CompletableFuture deleteInterconnect(DeleteInterconnectRequest deleteInterconnectRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInterconnectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInterconnect"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteInterconnectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteInterconnect") .withMarshaller(new DeleteInterconnectRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteInterconnectRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteInterconnectRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified link aggregation group (LAG). You cannot delete a LAG if it has active virtual interfaces * or hosted connections. *

* * @param deleteLagRequest * @return A Java Future containing the result of the DeleteLag operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteLag * @see AWS API * Documentation */ @Override public CompletableFuture deleteLag(DeleteLagRequest deleteLagRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLagRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLag"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteLagResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteLag") .withMarshaller(new DeleteLagRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(deleteLagRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteLagRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a virtual interface. *

* * @param deleteVirtualInterfaceRequest * @return A Java Future containing the result of the DeleteVirtualInterface operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DeleteVirtualInterface * @see AWS API Documentation */ @Override public CompletableFuture deleteVirtualInterface( DeleteVirtualInterfaceRequest deleteVirtualInterfaceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVirtualInterfaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVirtualInterface"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteVirtualInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteVirtualInterface") .withMarshaller(new DeleteVirtualInterfaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteVirtualInterfaceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteVirtualInterfaceRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Displays the specified connection or all connections in this Region. *

* * @param describeConnectionsRequest * @return A Java Future containing the result of the DescribeConnections operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeConnections * @see AWS API Documentation */ @Override public CompletableFuture describeConnections( DescribeConnectionsRequest describeConnectionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeConnectionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeConnections"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeConnectionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeConnections") .withMarshaller(new DescribeConnectionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeConnectionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeConnectionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes one or more association proposals for connection between a virtual private gateway or transit gateway * and a Direct Connect gateway. *

* * @param describeDirectConnectGatewayAssociationProposalsRequest * @return A Java Future containing the result of the DescribeDirectConnectGatewayAssociationProposals operation * returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeDirectConnectGatewayAssociationProposals * @see AWS API Documentation */ @Override public CompletableFuture describeDirectConnectGatewayAssociationProposals( DescribeDirectConnectGatewayAssociationProposalsRequest describeDirectConnectGatewayAssociationProposalsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDirectConnectGatewayAssociationProposalsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDirectConnectGatewayAssociationProposals"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeDirectConnectGatewayAssociationProposalsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDirectConnectGatewayAssociationProposals") .withMarshaller( new DescribeDirectConnectGatewayAssociationProposalsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(describeDirectConnectGatewayAssociationProposalsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDirectConnectGatewayAssociationProposalsRequest .overrideConfiguration().orElse(null); 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 associations between your Direct Connect gateways and virtual private gateways. You must specify a * Direct Connect gateway, a virtual private gateway, or both. If you specify a Direct Connect gateway, the response * contains all virtual private gateways associated with the Direct Connect gateway. If you specify a virtual * private gateway, the response contains all Direct Connect gateways associated with the virtual private gateway. * If you specify both, the response contains the association between the Direct Connect gateway and the virtual * private gateway. *

* * @param describeDirectConnectGatewayAssociationsRequest * @return A Java Future containing the result of the DescribeDirectConnectGatewayAssociations operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeDirectConnectGatewayAssociations * @see AWS API Documentation */ @Override public CompletableFuture describeDirectConnectGatewayAssociations( DescribeDirectConnectGatewayAssociationsRequest describeDirectConnectGatewayAssociationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDirectConnectGatewayAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDirectConnectGatewayAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeDirectConnectGatewayAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDirectConnectGatewayAssociations") .withMarshaller(new DescribeDirectConnectGatewayAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(describeDirectConnectGatewayAssociationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDirectConnectGatewayAssociationsRequest .overrideConfiguration().orElse(null); 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 attachments between your Direct Connect gateways and virtual interfaces. You must specify a Direct * Connect gateway, a virtual interface, or both. If you specify a Direct Connect gateway, the response contains all * virtual interfaces attached to the Direct Connect gateway. If you specify a virtual interface, the response * contains all Direct Connect gateways attached to the virtual interface. If you specify both, the response * contains the attachment between the Direct Connect gateway and the virtual interface. *

* * @param describeDirectConnectGatewayAttachmentsRequest * @return A Java Future containing the result of the DescribeDirectConnectGatewayAttachments operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeDirectConnectGatewayAttachments * @see AWS API Documentation */ @Override public CompletableFuture describeDirectConnectGatewayAttachments( DescribeDirectConnectGatewayAttachmentsRequest describeDirectConnectGatewayAttachmentsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDirectConnectGatewayAttachmentsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDirectConnectGatewayAttachments"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeDirectConnectGatewayAttachmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDirectConnectGatewayAttachments") .withMarshaller(new DescribeDirectConnectGatewayAttachmentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector) .withInput(describeDirectConnectGatewayAttachmentsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDirectConnectGatewayAttachmentsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all your Direct Connect gateways or only the specified Direct Connect gateway. Deleted Direct Connect * gateways are not returned. *

* * @param describeDirectConnectGatewaysRequest * @return A Java Future containing the result of the DescribeDirectConnectGateways operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeDirectConnectGateways * @see AWS API Documentation */ @Override public CompletableFuture describeDirectConnectGateways( DescribeDirectConnectGatewaysRequest describeDirectConnectGatewaysRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDirectConnectGatewaysRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDirectConnectGateways"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDirectConnectGatewaysResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDirectConnectGateways") .withMarshaller(new DescribeDirectConnectGatewaysRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeDirectConnectGatewaysRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeDirectConnectGatewaysRequest.overrideConfiguration() .orElse(null); 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 hosted connections that have been provisioned on the specified interconnect or link aggregation group * (LAG). *

* *

* Intended for use by AWS Direct Connect Partners only. *

*
* * @param describeHostedConnectionsRequest * @return A Java Future containing the result of the DescribeHostedConnections operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeHostedConnections * @see AWS API Documentation */ @Override public CompletableFuture describeHostedConnections( DescribeHostedConnectionsRequest describeHostedConnectionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeHostedConnectionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeHostedConnections"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeHostedConnectionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeHostedConnections") .withMarshaller(new DescribeHostedConnectionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeHostedConnectionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeHostedConnectionsRequest.overrideConfiguration() .orElse(null); 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 interconnects owned by the AWS account or only the specified interconnect. *

* * @param describeInterconnectsRequest * @return A Java Future containing the result of the DescribeInterconnects operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeInterconnects * @see AWS API Documentation */ @Override public CompletableFuture describeInterconnects( DescribeInterconnectsRequest describeInterconnectsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeInterconnectsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeInterconnects"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeInterconnectsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeInterconnects") .withMarshaller(new DescribeInterconnectsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeInterconnectsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeInterconnectsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes all your link aggregation groups (LAG) or the specified LAG. *

* * @param describeLagsRequest * @return A Java Future containing the result of the DescribeLags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeLags * @see AWS API * Documentation */ @Override public CompletableFuture describeLags(DescribeLagsRequest describeLagsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLagsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLags"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeLagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeLags").withMarshaller(new DescribeLagsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeLagsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeLagsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the LOA-CFA for a connection, interconnect, or link aggregation group (LAG). *

*

* The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that is used when * establishing your cross connect to AWS at the colocation facility. For more information, see Requesting Cross Connects at * AWS Direct Connect Locations in the AWS Direct Connect User Guide. *

* * @param describeLoaRequest * @return A Java Future containing the result of the DescribeLoa operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeLoa * @see AWS API * Documentation */ @Override public CompletableFuture describeLoa(DescribeLoaRequest describeLoaRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLoaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLoa"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeLoaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeLoa").withMarshaller(new DescribeLoaRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeLoaRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeLoaRequest.overrideConfiguration().orElse(null); 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 AWS Direct Connect locations in the current AWS Region. These are the locations that can be selected * when calling CreateConnection or CreateInterconnect. *

* * @param describeLocationsRequest * @return A Java Future containing the result of the DescribeLocations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeLocations * @see AWS API Documentation */ @Override public CompletableFuture describeLocations(DescribeLocationsRequest describeLocationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLocationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLocations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeLocationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeLocations") .withMarshaller(new DescribeLocationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeLocationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeLocationsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the tags associated with the specified AWS Direct Connect resources. *

* * @param describeTagsRequest * @return A Java Future containing the result of the DescribeTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeTags * @see AWS API * Documentation */ @Override public CompletableFuture describeTags(DescribeTagsRequest describeTagsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeTagsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTags"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeTagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeTags").withMarshaller(new DescribeTagsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeTagsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeTagsRequest.overrideConfiguration().orElse(null); 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 virtual private gateways owned by the AWS account. *

*

* You can create one or more AWS Direct Connect private virtual interfaces linked to a virtual private gateway. *

* * @param describeVirtualGatewaysRequest * @return A Java Future containing the result of the DescribeVirtualGateways operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeVirtualGateways * @see AWS API Documentation */ @Override public CompletableFuture describeVirtualGateways( DescribeVirtualGatewaysRequest describeVirtualGatewaysRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeVirtualGatewaysRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeVirtualGateways"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeVirtualGatewaysResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeVirtualGateways") .withMarshaller(new DescribeVirtualGatewaysRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeVirtualGatewaysRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeVirtualGatewaysRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Displays all virtual interfaces for an AWS account. Virtual interfaces deleted fewer than 15 minutes before you * make the request are also returned. If you specify a connection ID, only the virtual interfaces associated with * the connection are returned. If you specify a virtual interface ID, then only a single virtual interface is * returned. *

*

* A virtual interface (VLAN) transmits the traffic between the AWS Direct Connect location and the customer * network. *

* * @param describeVirtualInterfacesRequest * @return A Java Future containing the result of the DescribeVirtualInterfaces operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DescribeVirtualInterfaces * @see AWS API Documentation */ @Override public CompletableFuture describeVirtualInterfaces( DescribeVirtualInterfacesRequest describeVirtualInterfacesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, describeVirtualInterfacesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeVirtualInterfaces"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeVirtualInterfacesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeVirtualInterfaces") .withMarshaller(new DescribeVirtualInterfacesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(describeVirtualInterfacesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = describeVirtualInterfacesRequest.overrideConfiguration() .orElse(null); 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); } } /** *

* Disassociates a connection from a link aggregation group (LAG). The connection is interrupted and re-established * as a standalone connection (the connection is not deleted; to delete the connection, use the * DeleteConnection request). If the LAG has associated virtual interfaces or hosted connections, they remain * associated with the LAG. A disassociated connection owned by an AWS Direct Connect Partner is automatically * converted to an interconnect. *

*

* If disassociating the connection would cause the LAG to fall below its setting for minimum number of operational * connections, the request fails, except when it's the last member of the LAG. If all connections are * disassociated, the LAG continues to exist as an empty LAG with no physical connections. *

* * @param disassociateConnectionFromLagRequest * @return A Java Future containing the result of the DisassociateConnectionFromLag operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.DisassociateConnectionFromLag * @see AWS API Documentation */ @Override public CompletableFuture disassociateConnectionFromLag( DisassociateConnectionFromLagRequest disassociateConnectionFromLagRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateConnectionFromLagRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateConnectionFromLag"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateConnectionFromLagResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateConnectionFromLag") .withMarshaller(new DisassociateConnectionFromLagRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(disassociateConnectionFromLagRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = disassociateConnectionFromLagRequest.overrideConfiguration() .orElse(null); 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 virtual interface failover test history. *

* * @param listVirtualInterfaceTestHistoryRequest * @return A Java Future containing the result of the ListVirtualInterfaceTestHistory operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.ListVirtualInterfaceTestHistory * @see AWS API Documentation */ @Override public CompletableFuture listVirtualInterfaceTestHistory( ListVirtualInterfaceTestHistoryRequest listVirtualInterfaceTestHistoryRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listVirtualInterfaceTestHistoryRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListVirtualInterfaceTestHistory"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListVirtualInterfaceTestHistoryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListVirtualInterfaceTestHistory") .withMarshaller(new ListVirtualInterfaceTestHistoryRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listVirtualInterfaceTestHistoryRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listVirtualInterfaceTestHistoryRequest .overrideConfiguration().orElse(null); 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); } } /** *

* Starts the virtual interface failover test that verifies your configuration meets your resiliency requirements by * placing the BGP peering session in the DOWN state. You can then send traffic to verify that there are no outages. *

*

* You can run the test on public, private, transit, and hosted virtual interfaces. *

*

* You can use ListVirtualInterfaceTestHistory to view the virtual interface test history. *

*

* If you need to stop the test before the test interval completes, use StopBgpFailoverTest. *

* * @param startBgpFailoverTestRequest * @return A Java Future containing the result of the StartBgpFailoverTest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.StartBgpFailoverTest * @see AWS API Documentation */ @Override public CompletableFuture startBgpFailoverTest( StartBgpFailoverTestRequest startBgpFailoverTestRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, startBgpFailoverTestRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartBgpFailoverTest"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartBgpFailoverTestResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartBgpFailoverTest") .withMarshaller(new StartBgpFailoverTestRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(startBgpFailoverTestRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = startBgpFailoverTestRequest.overrideConfiguration().orElse( null); 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 the virtual interface failover test. *

* * @param stopBgpFailoverTestRequest * @return A Java Future containing the result of the StopBgpFailoverTest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.StopBgpFailoverTest * @see AWS API Documentation */ @Override public CompletableFuture stopBgpFailoverTest( StopBgpFailoverTestRequest stopBgpFailoverTestRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, stopBgpFailoverTestRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopBgpFailoverTest"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopBgpFailoverTestResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopBgpFailoverTest") .withMarshaller(new StopBgpFailoverTestRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(stopBgpFailoverTestRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = stopBgpFailoverTestRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds the specified tags to the specified AWS Direct Connect resource. Each resource can have a maximum of 50 * tags. *

*

* Each tag consists of a key and an optional value. If a tag with the same key is already associated with the * resource, this action updates its value. *

* * @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. *
    *
  • DuplicateTagKeysException A tag key was specified more than once.
  • *
  • TooManyTagsException You have reached the limit on the number of tags that can be assigned.
  • *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); 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").withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(tagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = tagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes one or more tags from the specified AWS Direct Connect resource. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.UntagResource * @see AWS * API Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); 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") .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(untagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = untagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified attributes of the Direct Connect gateway association. *

*

* Add or remove prefixes from the association. *

* * @param updateDirectConnectGatewayAssociationRequest * @return A Java Future containing the result of the UpdateDirectConnectGatewayAssociation operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.UpdateDirectConnectGatewayAssociation * @see AWS API Documentation */ @Override public CompletableFuture updateDirectConnectGatewayAssociation( UpdateDirectConnectGatewayAssociationRequest updateDirectConnectGatewayAssociationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDirectConnectGatewayAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDirectConnectGatewayAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateDirectConnectGatewayAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDirectConnectGatewayAssociation") .withMarshaller(new UpdateDirectConnectGatewayAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateDirectConnectGatewayAssociationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateDirectConnectGatewayAssociationRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the attributes of the specified link aggregation group (LAG). *

*

* You can update the following attributes: *

*
    *
  • *

    * The name of the LAG. *

    *
  • *
  • *

    * The value for the minimum number of connections that must be operational for the LAG itself to be operational. *

    *
  • *
*

* When you create a LAG, the default value for the minimum number of operational connections is zero (0). If you * update this value and the number of operational connections falls below the specified value, the LAG * automatically goes down to avoid over-utilization of the remaining connections. Adjust this value with care, as * it could force the LAG down if it is set higher than the current number of operational connections. *

* * @param updateLagRequest * @return A Java Future containing the result of the UpdateLag operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.UpdateLag * @see AWS API * Documentation */ @Override public CompletableFuture updateLag(UpdateLagRequest updateLagRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateLagRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateLag"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateLagResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateLag") .withMarshaller(new UpdateLagRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(updateLagRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateLagRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified attributes of the specified virtual private interface. *

*

* Setting the MTU of a virtual interface to 9001 (jumbo frames) can cause an update to the underlying physical * connection if it wasn't updated to support jumbo frames. Updating the connection disrupts network connectivity * for all virtual interfaces associated with the connection for up to 30 seconds. To check whether your connection * supports jumbo frames, call DescribeConnections. To check whether your virtual q interface supports jumbo * frames, call DescribeVirtualInterfaces. *

* * @param updateVirtualInterfaceAttributesRequest * @return A Java Future containing the result of the UpdateVirtualInterfaceAttributes operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • DirectConnectServerException A server-side error occurred.
  • *
  • DirectConnectClientException One or more parameters are not valid.
  • *
  • 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.
  • *
  • DirectConnectException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample DirectConnectAsyncClient.UpdateVirtualInterfaceAttributes * @see AWS API Documentation */ @Override public CompletableFuture updateVirtualInterfaceAttributes( UpdateVirtualInterfaceAttributesRequest updateVirtualInterfaceAttributesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVirtualInterfaceAttributesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Direct Connect"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVirtualInterfaceAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateVirtualInterfaceAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateVirtualInterfaceAttributes") .withMarshaller(new UpdateVirtualInterfaceAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateVirtualInterfaceAttributesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateVirtualInterfaceAttributesRequest .overrideConfiguration().orElse(null); 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 void close() { clientHandler.close(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(DirectConnectException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("DuplicateTagKeysException") .exceptionBuilderSupplier(DuplicateTagKeysException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyTagsException") .exceptionBuilderSupplier(TooManyTagsException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DirectConnectServerException") .exceptionBuilderSupplier(DirectConnectServerException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DirectConnectClientException") .exceptionBuilderSupplier(DirectConnectClientException::builder).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 T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy