
software.amazon.awssdk.services.networkmanager.DefaultNetworkManagerAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.networkmanager;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.networkmanager.internal.NetworkManagerServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.networkmanager.model.AcceptAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.AcceptAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.AccessDeniedException;
import software.amazon.awssdk.services.networkmanager.model.AssociateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateCustomerGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateCustomerGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateTransitGatewayConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateTransitGatewayConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.ConflictException;
import software.amazon.awssdk.services.networkmanager.model.CoreNetworkPolicyException;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteToSiteVpnAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteToSiteVpnAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayPeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayPeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayRouteTableAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayRouteTableAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkPolicyVersionRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkPolicyVersionResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeletePeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.DeletePeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.DeregisterTransitGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.DeregisterTransitGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.DescribeGlobalNetworksRequest;
import software.amazon.awssdk.services.networkmanager.model.DescribeGlobalNetworksResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateCustomerGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateCustomerGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateTransitGatewayConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateTransitGatewayConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.ExecuteCoreNetworkChangeSetRequest;
import software.amazon.awssdk.services.networkmanager.model.ExecuteCoreNetworkChangeSetResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectionsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectionsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeEventsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeEventsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeSetRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeSetResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkPolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkPolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCustomerGatewayAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCustomerGatewayAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetDevicesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetDevicesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetLinkAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetLinkAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetLinksRequest;
import software.amazon.awssdk.services.networkmanager.model.GetLinksResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceCountsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceCountsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceRelationshipsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceRelationshipsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourcesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourcesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkRoutesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkRoutesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkTelemetryRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkTelemetryResponse;
import software.amazon.awssdk.services.networkmanager.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.GetRouteAnalysisRequest;
import software.amazon.awssdk.services.networkmanager.model.GetRouteAnalysisResponse;
import software.amazon.awssdk.services.networkmanager.model.GetSiteToSiteVpnAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetSiteToSiteVpnAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetSitesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetSitesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayConnectPeerAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayConnectPeerAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayPeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayPeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRegistrationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRegistrationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRouteTableAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRouteTableAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.InternalServerException;
import software.amazon.awssdk.services.networkmanager.model.ListAttachmentsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListAttachmentsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListConnectPeersRequest;
import software.amazon.awssdk.services.networkmanager.model.ListConnectPeersResponse;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworkPolicyVersionsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworkPolicyVersionsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworksRequest;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworksResponse;
import software.amazon.awssdk.services.networkmanager.model.ListOrganizationServiceAccessStatusRequest;
import software.amazon.awssdk.services.networkmanager.model.ListOrganizationServiceAccessStatusResponse;
import software.amazon.awssdk.services.networkmanager.model.ListPeeringsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListPeeringsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.NetworkManagerException;
import software.amazon.awssdk.services.networkmanager.model.PutCoreNetworkPolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.PutCoreNetworkPolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.RegisterTransitGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.RegisterTransitGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.RejectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.RejectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.ResourceNotFoundException;
import software.amazon.awssdk.services.networkmanager.model.RestoreCoreNetworkPolicyVersionRequest;
import software.amazon.awssdk.services.networkmanager.model.RestoreCoreNetworkPolicyVersionResponse;
import software.amazon.awssdk.services.networkmanager.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.networkmanager.model.StartOrganizationServiceAccessUpdateRequest;
import software.amazon.awssdk.services.networkmanager.model.StartOrganizationServiceAccessUpdateResponse;
import software.amazon.awssdk.services.networkmanager.model.StartRouteAnalysisRequest;
import software.amazon.awssdk.services.networkmanager.model.StartRouteAnalysisResponse;
import software.amazon.awssdk.services.networkmanager.model.TagResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.TagResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.ThrottlingException;
import software.amazon.awssdk.services.networkmanager.model.UntagResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.UntagResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateNetworkResourceMetadataRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateNetworkResourceMetadataResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.ValidationException;
import software.amazon.awssdk.services.networkmanager.transform.AcceptAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateCustomerGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateTransitGatewayConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateSiteToSiteVpnAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateTransitGatewayPeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateTransitGatewayRouteTableAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteCoreNetworkPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeletePeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeregisterTransitGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DescribeGlobalNetworksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateCustomerGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateTransitGatewayConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ExecuteCoreNetworkChangeSetRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectPeerAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectionsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkChangeEventsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkChangeSetRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCustomerGatewayAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetDevicesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetLinkAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetLinksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourceCountsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourceRelationshipsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourcesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkRoutesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkTelemetryRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetRouteAnalysisRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetSiteToSiteVpnAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetSitesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayConnectPeerAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayPeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayRegistrationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayRouteTableAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListAttachmentsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListConnectPeersRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListCoreNetworkPolicyVersionsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListCoreNetworksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListOrganizationServiceAccessStatusRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListPeeringsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.PutCoreNetworkPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RegisterTransitGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RejectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RestoreCoreNetworkPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.StartOrganizationServiceAccessUpdateRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.StartRouteAnalysisRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateNetworkResourceMetadataRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link NetworkManagerAsyncClient}.
*
* @see NetworkManagerAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultNetworkManagerAsyncClient implements NetworkManagerAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultNetworkManagerAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultNetworkManagerAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Accepts a core network attachment request.
*
*
* Once the attachment request is accepted by a core network owner, the attachment is created and connected to a
* core network.
*
*
* @param acceptAttachmentRequest
* @return A Java Future containing the result of the AcceptAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.AcceptAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture acceptAttachment(AcceptAttachmentRequest acceptAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(acceptAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptAttachmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AcceptAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AcceptAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AcceptAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(acceptAttachmentRequest));
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 core network Connect peer with a device and optionally, with a link.
*
*
* If you specify a link, it must be associated with the specified device. You can only associate core network
* Connect peers that have been created on a core network Connect attachment on a core network.
*
*
* @param associateConnectPeerRequest
* @return A Java Future containing the result of the AssociateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.AssociateConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateConnectPeer(
AssociateConnectPeerRequest associateConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateConnectPeerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateConnectPeerRequest));
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 customer gateway with a device and optionally, with a link. If you specify a link, it must be
* associated with the specified device.
*
*
* You can only associate customer gateways that are connected to a VPN attachment on a transit gateway or core
* network registered in your global network. When you register a transit gateway or core network, customer gateways
* that are connected to the transit gateway are automatically included in the global network. To list customer
* gateways that are connected to a transit gateway, use the DescribeVpnConnections EC2 API and filter by transit-gateway-id
.
*
*
* You cannot associate a customer gateway with more than one device and link.
*
*
* @param associateCustomerGatewayRequest
* @return A Java Future containing the result of the AssociateCustomerGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.AssociateCustomerGateway
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateCustomerGateway(
AssociateCustomerGatewayRequest associateCustomerGatewayRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateCustomerGatewayRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateCustomerGatewayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateCustomerGateway");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateCustomerGatewayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateCustomerGateway").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateCustomerGatewayRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateCustomerGatewayRequest));
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 link to a device. A device can be associated to multiple links and a link can be associated to
* multiple devices. The device and link must be in the same global network and the same site.
*
*
* @param associateLinkRequest
* @return A Java Future containing the result of the AssociateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.AssociateLink
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture associateLink(AssociateLinkRequest associateLinkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateLinkRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateLinkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateLink");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AssociateLinkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateLink").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateLinkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateLinkRequest));
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 transit gateway Connect peer with a device, and optionally, with a link. If you specify a link, it
* must be associated with the specified device.
*
*
* You can only associate transit gateway Connect peers that have been created on a transit gateway that's
* registered in your global network.
*
*
* You cannot associate a transit gateway Connect peer with more than one device and link.
*
*
* @param associateTransitGatewayConnectPeerRequest
* @return A Java Future containing the result of the AssociateTransitGatewayConnectPeer operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.AssociateTransitGatewayConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateTransitGatewayConnectPeer(
AssociateTransitGatewayConnectPeerRequest associateTransitGatewayConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateTransitGatewayConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
associateTransitGatewayConnectPeerRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateTransitGatewayConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, AssociateTransitGatewayConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateTransitGatewayConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateTransitGatewayConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateTransitGatewayConnectPeerRequest));
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 core network Connect attachment from a specified core network attachment.
*
*
* A core network Connect attachment is a GRE-based tunnel attachment that you can use to establish a connection
* between a core network and an appliance. A core network Connect attachment uses an existing VPC attachment as the
* underlying transport mechanism.
*
*
* @param createConnectAttachmentRequest
* @return A Java Future containing the result of the CreateConnectAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateConnectAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConnectAttachment(
CreateConnectAttachmentRequest createConnectAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectAttachmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnectAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateConnectAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConnectAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConnectAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConnectAttachmentRequest));
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 core network Connect peer for a specified core network connect attachment between a core network and an
* appliance. The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).
*
*
* @param createConnectPeerRequest
* @return A Java Future containing the result of the CreateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConnectPeer(CreateConnectPeerRequest createConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectPeerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConnectPeerRequest));
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 two devices. The devices can be a physical or virtual appliance that connects to a
* third-party appliance in a VPC, or a physical appliance that connects to another physical appliance in an
* on-premises network.
*
*
* @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. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateConnection
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConnection(CreateConnectionRequest createConnectionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
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").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConnectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConnectionRequest));
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 core network as part of your global network, and optionally, with a core network policy.
*
*
* @param createCoreNetworkRequest
* @return A Java Future containing the result of the CreateCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - CoreNetworkPolicyException Describes a core network policy exception.
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateCoreNetwork
* @see AWS API Documentation
*/
@Override
public CompletableFuture createCoreNetwork(CreateCoreNetworkRequest createCoreNetworkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCoreNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCoreNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCoreNetwork");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCoreNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCoreNetwork").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateCoreNetworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createCoreNetworkRequest));
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 new device in a global network. If you specify both a site ID and a location, the location of the site
* is used for visualization in the Network Manager console.
*
*
* @param createDeviceRequest
* @return A Java Future containing the result of the CreateDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateDevice
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createDevice(CreateDeviceRequest createDeviceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDeviceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDeviceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDevice");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDevice").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateDeviceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createDeviceRequest));
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 Amazon Web Services Direct Connect gateway attachment
*
*
* @param createDirectConnectGatewayAttachmentRequest
* @return A Java Future containing the result of the CreateDirectConnectGatewayAttachment operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateDirectConnectGatewayAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture createDirectConnectGatewayAttachment(
CreateDirectConnectGatewayAttachmentRequest createDirectConnectGatewayAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDirectConnectGatewayAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createDirectConnectGatewayAttachmentRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectConnectGatewayAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateDirectConnectGatewayAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDirectConnectGatewayAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateDirectConnectGatewayAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createDirectConnectGatewayAttachmentRequest));
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 new, empty global network.
*
*
* @param createGlobalNetworkRequest
* @return A Java Future containing the result of the CreateGlobalNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateGlobalNetwork
* @see AWS API Documentation
*/
@Override
public CompletableFuture createGlobalNetwork(
CreateGlobalNetworkRequest createGlobalNetworkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createGlobalNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createGlobalNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateGlobalNetwork");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateGlobalNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateGlobalNetwork").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateGlobalNetworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createGlobalNetworkRequest));
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 new link for a specified site.
*
*
* @param createLinkRequest
* @return A Java Future containing the result of the CreateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateLink
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createLink(CreateLinkRequest createLinkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createLinkRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createLinkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLink");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateLinkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateLink")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateLinkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createLinkRequest));
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 new site in a global network.
*
*
* @param createSiteRequest
* @return A Java Future containing the result of the CreateSite operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - ServiceQuotaExceededException A service limit was exceeded.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateSite
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createSite(CreateSiteRequest createSiteRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSite");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateSite")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateSiteRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createSiteRequest));
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 Amazon Web Services site-to-site VPN attachment on an edge location of a core network.
*
*
* @param createSiteToSiteVpnAttachmentRequest
* @return A Java Future containing the result of the CreateSiteToSiteVpnAttachment operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateSiteToSiteVpnAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture createSiteToSiteVpnAttachment(
CreateSiteToSiteVpnAttachmentRequest createSiteToSiteVpnAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSiteToSiteVpnAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createSiteToSiteVpnAttachmentRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSiteToSiteVpnAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSiteToSiteVpnAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateSiteToSiteVpnAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateSiteToSiteVpnAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createSiteToSiteVpnAttachmentRequest));
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 gateway peering connection.
*
*
* @param createTransitGatewayPeeringRequest
* @return A Java Future containing the result of the CreateTransitGatewayPeering operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateTransitGatewayPeering
* @see AWS API Documentation
*/
@Override
public CompletableFuture createTransitGatewayPeering(
CreateTransitGatewayPeeringRequest createTransitGatewayPeeringRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTransitGatewayPeeringRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createTransitGatewayPeeringRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTransitGatewayPeering");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateTransitGatewayPeeringResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateTransitGatewayPeering").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateTransitGatewayPeeringRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createTransitGatewayPeeringRequest));
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 gateway route table attachment.
*
*
* @param createTransitGatewayRouteTableAttachmentRequest
* @return A Java Future containing the result of the CreateTransitGatewayRouteTableAttachment operation returned by
* the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateTransitGatewayRouteTableAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture createTransitGatewayRouteTableAttachment(
CreateTransitGatewayRouteTableAttachmentRequest createTransitGatewayRouteTableAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
createTransitGatewayRouteTableAttachmentRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createTransitGatewayRouteTableAttachmentRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTransitGatewayRouteTableAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateTransitGatewayRouteTableAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateTransitGatewayRouteTableAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateTransitGatewayRouteTableAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createTransitGatewayRouteTableAttachmentRequest));
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 VPC attachment on an edge location of a core network.
*
*
* @param createVpcAttachmentRequest
* @return A Java Future containing the result of the CreateVpcAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.CreateVpcAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture createVpcAttachment(
CreateVpcAttachmentRequest createVpcAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createVpcAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createVpcAttachmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVpcAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateVpcAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateVpcAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateVpcAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createVpcAttachmentRequest));
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 an attachment. Supports all attachment types.
*
*
* @param deleteAttachmentRequest
* @return A Java Future containing the result of the DeleteAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteAttachment
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteAttachment(DeleteAttachmentRequest deleteAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAttachmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteAttachmentRequest));
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 Connect peer.
*
*
* @param deleteConnectPeerRequest
* @return A Java Future containing the result of the DeleteConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConnectPeer(DeleteConnectPeerRequest deleteConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectPeerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConnectPeerRequest));
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 in your global network.
*
*
* @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. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteConnection
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConnection(DeleteConnectionRequest deleteConnectionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
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").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConnectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConnectionRequest));
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 core network along with all core network policies. This can only be done if there are no attachments on
* a core network.
*
*
* @param deleteCoreNetworkRequest
* @return A Java Future containing the result of the DeleteCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteCoreNetwork
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteCoreNetwork(DeleteCoreNetworkRequest deleteCoreNetworkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCoreNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCoreNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCoreNetwork");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCoreNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCoreNetwork").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteCoreNetworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteCoreNetworkRequest));
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 policy version from a core network. You can't delete the current LIVE policy.
*
*
* @param deleteCoreNetworkPolicyVersionRequest
* @return A Java Future containing the result of the DeleteCoreNetworkPolicyVersion operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteCoreNetworkPolicyVersion
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteCoreNetworkPolicyVersion(
DeleteCoreNetworkPolicyVersionRequest deleteCoreNetworkPolicyVersionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCoreNetworkPolicyVersionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteCoreNetworkPolicyVersionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCoreNetworkPolicyVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCoreNetworkPolicyVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCoreNetworkPolicyVersion").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteCoreNetworkPolicyVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteCoreNetworkPolicyVersionRequest));
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 an existing device. You must first disassociate the device from any links and customer gateways.
*
*
* @param deleteDeviceRequest
* @return A Java Future containing the result of the DeleteDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteDevice
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteDevice(DeleteDeviceRequest deleteDeviceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDeviceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDeviceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDevice");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDevice").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteDeviceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteDeviceRequest));
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 an existing global network. You must first delete all global network objects (devices, links, and sites),
* deregister all transit gateways, and delete any core networks.
*
*
* @param deleteGlobalNetworkRequest
* @return A Java Future containing the result of the DeleteGlobalNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteGlobalNetwork
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteGlobalNetwork(
DeleteGlobalNetworkRequest deleteGlobalNetworkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteGlobalNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteGlobalNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteGlobalNetwork");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteGlobalNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteGlobalNetwork").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteGlobalNetworkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteGlobalNetworkRequest));
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 an existing link. You must first disassociate the link from any devices and customer gateways.
*
*
* @param deleteLinkRequest
* @return A Java Future containing the result of the DeleteLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteLink
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteLink(DeleteLinkRequest deleteLinkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteLinkRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLinkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLink");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteLinkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteLink")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteLinkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteLinkRequest));
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 an existing peering connection.
*
*
* @param deletePeeringRequest
* @return A Java Future containing the result of the DeletePeering operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeletePeering
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deletePeering(DeletePeeringRequest deletePeeringRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deletePeeringRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePeeringRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePeering");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeletePeeringResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeletePeering").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeletePeeringRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deletePeeringRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a resource policy for the specified resource. This revokes the access of the principals specified in the
* resource policy.
*
*
* @param deleteResourcePolicyRequest
* @return A Java Future containing the result of the DeleteResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteResourcePolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteResourcePolicy(
DeleteResourcePolicyRequest deleteResourcePolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteResourcePolicyRequest));
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 an existing site. The site cannot be associated with any device or link.
*
*
* @param deleteSiteRequest
* @return A Java Future containing the result of the DeleteSite operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeleteSite
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteSite(DeleteSiteRequest deleteSiteRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSite");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteSite")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteSiteRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteSiteRequest));
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);
}
}
/**
*
* Deregisters a transit gateway from your global network. This action does not delete your transit gateway, or
* modify any of its attachments. This action removes any customer gateway associations.
*
*
* @param deregisterTransitGatewayRequest
* @return A Java Future containing the result of the DeregisterTransitGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DeregisterTransitGateway
* @see AWS API Documentation
*/
@Override
public CompletableFuture deregisterTransitGateway(
DeregisterTransitGatewayRequest deregisterTransitGatewayRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deregisterTransitGatewayRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deregisterTransitGatewayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeregisterTransitGateway");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeregisterTransitGatewayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeregisterTransitGateway").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeregisterTransitGatewayRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deregisterTransitGatewayRequest));
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 global networks. By default, all global networks are described. To describe the objects in
* your global network, you must use the appropriate Get*
action. For example, to list the transit
* gateways in your global network, use GetTransitGatewayRegistrations.
*
*
* @param describeGlobalNetworksRequest
* @return A Java Future containing the result of the DescribeGlobalNetworks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DescribeGlobalNetworks
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeGlobalNetworks(
DescribeGlobalNetworksRequest describeGlobalNetworksRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeGlobalNetworksRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeGlobalNetworksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeGlobalNetworks");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeGlobalNetworksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeGlobalNetworks").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeGlobalNetworksRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeGlobalNetworksRequest));
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 core network Connect peer from a device and a link.
*
*
* @param disassociateConnectPeerRequest
* @return A Java Future containing the result of the DisassociateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DisassociateConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateConnectPeer(
DisassociateConnectPeerRequest disassociateConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateConnectPeerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateConnectPeerRequest));
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 customer gateway from a device and a link.
*
*
* @param disassociateCustomerGatewayRequest
* @return A Java Future containing the result of the DisassociateCustomerGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DisassociateCustomerGateway
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateCustomerGateway(
DisassociateCustomerGatewayRequest disassociateCustomerGatewayRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateCustomerGatewayRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateCustomerGatewayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateCustomerGateway");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateCustomerGatewayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateCustomerGateway").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateCustomerGatewayRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateCustomerGatewayRequest));
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 an existing device from a link. You must first disassociate any customer gateways that are
* associated with the link.
*
*
* @param disassociateLinkRequest
* @return A Java Future containing the result of the DisassociateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DisassociateLink
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateLink(DisassociateLinkRequest disassociateLinkRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateLinkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateLinkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateLink");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateLinkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateLink").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateLinkRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateLinkRequest));
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 transit gateway Connect peer from a device and link.
*
*
* @param disassociateTransitGatewayConnectPeerRequest
* @return A Java Future containing the result of the DisassociateTransitGatewayConnectPeer operation returned by
* the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.DisassociateTransitGatewayConnectPeer
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateTransitGatewayConnectPeer(
DisassociateTransitGatewayConnectPeerRequest disassociateTransitGatewayConnectPeerRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateTransitGatewayConnectPeerRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
disassociateTransitGatewayConnectPeerRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateTransitGatewayConnectPeer");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DisassociateTransitGatewayConnectPeerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateTransitGatewayConnectPeer").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateTransitGatewayConnectPeerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateTransitGatewayConnectPeerRequest));
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);
}
}
/**
*
* Executes a change set on your core network. Deploys changes globally based on the policy submitted..
*
*
* @param executeCoreNetworkChangeSetRequest
* @return A Java Future containing the result of the ExecuteCoreNetworkChangeSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ValidationException The input fails to satisfy the constraints.
* - AccessDeniedException You do not have sufficient access to perform this action.
* - ResourceNotFoundException The specified resource could not be found.
* - ThrottlingException The request was denied due to request throttling.
* - InternalServerException The request has failed due to an internal error.
* - ConflictException There was a conflict processing the request. Updating or deleting the resource can
* cause an inconsistent state.
* - 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.
* - NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkManagerAsyncClient.ExecuteCoreNetworkChangeSet
* @see AWS API Documentation
*/
@Override
public CompletableFuture executeCoreNetworkChangeSet(
ExecuteCoreNetworkChangeSetRequest executeCoreNetworkChangeSetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(executeCoreNetworkChangeSetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, executeCoreNetworkChangeSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ExecuteCoreNetworkChangeSet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ExecuteCoreNetworkChangeSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams