software.amazon.awssdk.services.databasemigration.DefaultDatabaseMigrationAsyncClient Maven / Gradle / Ivy
Show all versions of databasemigration Show documentation
/*
* 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.databasemigration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.databasemigration.internal.DatabaseMigrationServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.databasemigration.model.AccessDeniedException;
import software.amazon.awssdk.services.databasemigration.model.AddTagsToResourceRequest;
import software.amazon.awssdk.services.databasemigration.model.AddTagsToResourceResponse;
import software.amazon.awssdk.services.databasemigration.model.ApplyPendingMaintenanceActionRequest;
import software.amazon.awssdk.services.databasemigration.model.ApplyPendingMaintenanceActionResponse;
import software.amazon.awssdk.services.databasemigration.model.BatchStartRecommendationsRequest;
import software.amazon.awssdk.services.databasemigration.model.BatchStartRecommendationsResponse;
import software.amazon.awssdk.services.databasemigration.model.CancelReplicationTaskAssessmentRunRequest;
import software.amazon.awssdk.services.databasemigration.model.CancelReplicationTaskAssessmentRunResponse;
import software.amazon.awssdk.services.databasemigration.model.CollectorNotFoundException;
import software.amazon.awssdk.services.databasemigration.model.CreateDataProviderRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateDataProviderResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateEndpointRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateEndpointResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateEventSubscriptionRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateEventSubscriptionResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateFleetAdvisorCollectorRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateFleetAdvisorCollectorResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateInstanceProfileRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateInstanceProfileResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateMigrationProjectRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateMigrationProjectResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationConfigRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationConfigResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationInstanceRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationInstanceResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationSubnetGroupRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationSubnetGroupResponse;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.CreateReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.DatabaseMigrationException;
import software.amazon.awssdk.services.databasemigration.model.DeleteCertificateRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteCertificateResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteConnectionRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteConnectionResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteDataProviderRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteDataProviderResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteEndpointRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteEndpointResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteEventSubscriptionRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteEventSubscriptionResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteFleetAdvisorCollectorRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteFleetAdvisorCollectorResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteFleetAdvisorDatabasesRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteFleetAdvisorDatabasesResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteInstanceProfileRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteInstanceProfileResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteMigrationProjectRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteMigrationProjectResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationConfigRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationConfigResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationInstanceRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationInstanceResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationSubnetGroupRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationSubnetGroupResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationTaskAssessmentRunRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationTaskAssessmentRunResponse;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.DeleteReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeAccountAttributesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeAccountAttributesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeApplicableIndividualAssessmentsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeApplicableIndividualAssessmentsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeCertificatesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeCertificatesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeConnectionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeConnectionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeConversionConfigurationRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeConversionConfigurationResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeDataProvidersRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeDataProvidersResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointSettingsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointSettingsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointTypesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointTypesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEngineVersionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEngineVersionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventCategoriesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventCategoriesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventSubscriptionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventSubscriptionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEventsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeExtensionPackAssociationsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeExtensionPackAssociationsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorCollectorsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorCollectorsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorDatabasesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorDatabasesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorLsaAnalysisRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorLsaAnalysisResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorSchemaObjectSummaryRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorSchemaObjectSummaryResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorSchemasRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeFleetAdvisorSchemasResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeInstanceProfilesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeInstanceProfilesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelAssessmentsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelAssessmentsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelConversionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelConversionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelExportsAsScriptRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelExportsAsScriptResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelExportsToTargetRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelExportsToTargetResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelImportsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMetadataModelImportsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeMigrationProjectsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeMigrationProjectsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeOrderableReplicationInstancesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeOrderableReplicationInstancesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribePendingMaintenanceActionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribePendingMaintenanceActionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeRecommendationLimitationsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeRecommendationLimitationsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeRecommendationsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeRecommendationsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeRefreshSchemasStatusRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeRefreshSchemasStatusResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationConfigsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationConfigsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstanceTaskLogsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstanceTaskLogsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstancesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstancesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationSubnetGroupsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationSubnetGroupsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTableStatisticsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTableStatisticsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskAssessmentResultsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskAssessmentResultsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskAssessmentRunsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskAssessmentRunsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskIndividualAssessmentsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTaskIndividualAssessmentsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTasksRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTasksResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeSchemasRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeSchemasResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeTableStatisticsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeTableStatisticsResponse;
import software.amazon.awssdk.services.databasemigration.model.ExportMetadataModelAssessmentRequest;
import software.amazon.awssdk.services.databasemigration.model.ExportMetadataModelAssessmentResponse;
import software.amazon.awssdk.services.databasemigration.model.ImportCertificateRequest;
import software.amazon.awssdk.services.databasemigration.model.ImportCertificateResponse;
import software.amazon.awssdk.services.databasemigration.model.InsufficientResourceCapacityException;
import software.amazon.awssdk.services.databasemigration.model.InvalidCertificateException;
import software.amazon.awssdk.services.databasemigration.model.InvalidOperationException;
import software.amazon.awssdk.services.databasemigration.model.InvalidResourceStateException;
import software.amazon.awssdk.services.databasemigration.model.InvalidSubnetException;
import software.amazon.awssdk.services.databasemigration.model.KmsAccessDeniedException;
import software.amazon.awssdk.services.databasemigration.model.KmsDisabledException;
import software.amazon.awssdk.services.databasemigration.model.KmsException;
import software.amazon.awssdk.services.databasemigration.model.KmsInvalidStateException;
import software.amazon.awssdk.services.databasemigration.model.KmsKeyNotAccessibleException;
import software.amazon.awssdk.services.databasemigration.model.KmsNotFoundException;
import software.amazon.awssdk.services.databasemigration.model.KmsThrottlingException;
import software.amazon.awssdk.services.databasemigration.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.databasemigration.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyConversionConfigurationRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyConversionConfigurationResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyDataProviderRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyDataProviderResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyEndpointRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyEndpointResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyEventSubscriptionRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyEventSubscriptionResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyInstanceProfileRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyInstanceProfileResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyMigrationProjectRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyMigrationProjectResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationConfigRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationConfigResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationInstanceRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationInstanceResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationSubnetGroupRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationSubnetGroupResponse;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.ModifyReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.MoveReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.MoveReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.RebootReplicationInstanceRequest;
import software.amazon.awssdk.services.databasemigration.model.RebootReplicationInstanceResponse;
import software.amazon.awssdk.services.databasemigration.model.RefreshSchemasRequest;
import software.amazon.awssdk.services.databasemigration.model.RefreshSchemasResponse;
import software.amazon.awssdk.services.databasemigration.model.ReloadReplicationTablesRequest;
import software.amazon.awssdk.services.databasemigration.model.ReloadReplicationTablesResponse;
import software.amazon.awssdk.services.databasemigration.model.ReloadTablesRequest;
import software.amazon.awssdk.services.databasemigration.model.ReloadTablesResponse;
import software.amazon.awssdk.services.databasemigration.model.RemoveTagsFromResourceRequest;
import software.amazon.awssdk.services.databasemigration.model.RemoveTagsFromResourceResponse;
import software.amazon.awssdk.services.databasemigration.model.ReplicationSubnetGroupDoesNotCoverEnoughAZsException;
import software.amazon.awssdk.services.databasemigration.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.databasemigration.model.ResourceNotFoundException;
import software.amazon.awssdk.services.databasemigration.model.ResourceQuotaExceededException;
import software.amazon.awssdk.services.databasemigration.model.RunFleetAdvisorLsaAnalysisRequest;
import software.amazon.awssdk.services.databasemigration.model.RunFleetAdvisorLsaAnalysisResponse;
import software.amazon.awssdk.services.databasemigration.model.S3AccessDeniedException;
import software.amazon.awssdk.services.databasemigration.model.S3ResourceNotFoundException;
import software.amazon.awssdk.services.databasemigration.model.SnsInvalidTopicException;
import software.amazon.awssdk.services.databasemigration.model.SnsNoAuthorizationException;
import software.amazon.awssdk.services.databasemigration.model.StartExtensionPackAssociationRequest;
import software.amazon.awssdk.services.databasemigration.model.StartExtensionPackAssociationResponse;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelAssessmentRequest;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelAssessmentResponse;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelConversionRequest;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelConversionResponse;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelExportAsScriptRequest;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelExportAsScriptResponse;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelExportToTargetRequest;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelExportToTargetResponse;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelImportRequest;
import software.amazon.awssdk.services.databasemigration.model.StartMetadataModelImportResponse;
import software.amazon.awssdk.services.databasemigration.model.StartRecommendationsRequest;
import software.amazon.awssdk.services.databasemigration.model.StartRecommendationsResponse;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationRequest;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationResponse;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskAssessmentRequest;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskAssessmentResponse;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskAssessmentRunRequest;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskAssessmentRunResponse;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.StopReplicationRequest;
import software.amazon.awssdk.services.databasemigration.model.StopReplicationResponse;
import software.amazon.awssdk.services.databasemigration.model.StopReplicationTaskRequest;
import software.amazon.awssdk.services.databasemigration.model.StopReplicationTaskResponse;
import software.amazon.awssdk.services.databasemigration.model.StorageQuotaExceededException;
import software.amazon.awssdk.services.databasemigration.model.SubnetAlreadyInUseException;
import software.amazon.awssdk.services.databasemigration.model.TestConnectionRequest;
import software.amazon.awssdk.services.databasemigration.model.TestConnectionResponse;
import software.amazon.awssdk.services.databasemigration.model.UpdateSubscriptionsToEventBridgeRequest;
import software.amazon.awssdk.services.databasemigration.model.UpdateSubscriptionsToEventBridgeResponse;
import software.amazon.awssdk.services.databasemigration.model.UpgradeDependencyFailureException;
import software.amazon.awssdk.services.databasemigration.transform.AddTagsToResourceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ApplyPendingMaintenanceActionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.BatchStartRecommendationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CancelReplicationTaskAssessmentRunRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateDataProviderRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateEndpointRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateEventSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateFleetAdvisorCollectorRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateInstanceProfileRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateMigrationProjectRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateReplicationConfigRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateReplicationInstanceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateReplicationSubnetGroupRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.CreateReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteCertificateRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteConnectionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteDataProviderRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteEndpointRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteEventSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteFleetAdvisorCollectorRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteFleetAdvisorDatabasesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteInstanceProfileRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteMigrationProjectRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteReplicationConfigRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteReplicationInstanceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteReplicationSubnetGroupRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteReplicationTaskAssessmentRunRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DeleteReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeAccountAttributesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeApplicableIndividualAssessmentsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeCertificatesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeConnectionsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeConversionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeDataProvidersRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEndpointSettingsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEndpointTypesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEndpointsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEngineVersionsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEventCategoriesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEventSubscriptionsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeEventsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeExtensionPackAssociationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeFleetAdvisorCollectorsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeFleetAdvisorDatabasesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeFleetAdvisorLsaAnalysisRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeFleetAdvisorSchemaObjectSummaryRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeFleetAdvisorSchemasRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeInstanceProfilesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMetadataModelAssessmentsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMetadataModelConversionsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMetadataModelExportsAsScriptRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMetadataModelExportsToTargetRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMetadataModelImportsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeMigrationProjectsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeOrderableReplicationInstancesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribePendingMaintenanceActionsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeRecommendationLimitationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeRecommendationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeRefreshSchemasStatusRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationConfigsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationInstanceTaskLogsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationInstancesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationSubnetGroupsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationTableStatisticsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationTaskAssessmentResultsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationTaskAssessmentRunsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationTaskIndividualAssessmentsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationTasksRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeReplicationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeSchemasRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.DescribeTableStatisticsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ExportMetadataModelAssessmentRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ImportCertificateRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyConversionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyDataProviderRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyEndpointRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyEventSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyInstanceProfileRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyMigrationProjectRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyReplicationConfigRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyReplicationInstanceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyReplicationSubnetGroupRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ModifyReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.MoveReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.RebootReplicationInstanceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.RefreshSchemasRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ReloadReplicationTablesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.ReloadTablesRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.RemoveTagsFromResourceRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.RunFleetAdvisorLsaAnalysisRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartExtensionPackAssociationRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartMetadataModelAssessmentRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartMetadataModelConversionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartMetadataModelExportAsScriptRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartMetadataModelExportToTargetRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartMetadataModelImportRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartRecommendationsRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartReplicationRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartReplicationTaskAssessmentRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartReplicationTaskAssessmentRunRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StartReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StopReplicationRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.StopReplicationTaskRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.TestConnectionRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.transform.UpdateSubscriptionsToEventBridgeRequestMarshaller;
import software.amazon.awssdk.services.databasemigration.waiters.DatabaseMigrationAsyncWaiter;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link DatabaseMigrationAsyncClient}.
*
* @see DatabaseMigrationAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultDatabaseMigrationAsyncClient implements DatabaseMigrationAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultDatabaseMigrationAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
private final ScheduledExecutorService executorService;
protected DefaultDatabaseMigrationAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
this.executorService = clientConfiguration.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE);
}
/**
*
* Adds metadata tags to an DMS resource, including replication instance, endpoint, subnet group, and migration
* task. These tags can also be used with cost allocation reporting to track cost associated with DMS resources, or
* used in a Condition statement in an IAM policy for DMS. For more information, see Tag
data type
* description.
*
*
* @param addTagsToResourceRequest
* Associates a set of tags with an DMS resource.
* @return A Java Future containing the result of the AddTagsToResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.AddTagsToResource
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture addTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addTagsToResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, addTagsToResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddTagsToResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddTagsToResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddTagsToResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AddTagsToResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(addTagsToResourceRequest));
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);
}
}
/**
*
* Applies a pending maintenance action to a resource (for example, to a replication instance).
*
*
* @param applyPendingMaintenanceActionRequest
* @return A Java Future containing the result of the ApplyPendingMaintenanceAction operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.ApplyPendingMaintenanceAction
* @see AWS API Documentation
*/
@Override
public CompletableFuture applyPendingMaintenanceAction(
ApplyPendingMaintenanceActionRequest applyPendingMaintenanceActionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(applyPendingMaintenanceActionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
applyPendingMaintenanceActionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ApplyPendingMaintenanceAction");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ApplyPendingMaintenanceActionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ApplyPendingMaintenanceAction").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ApplyPendingMaintenanceActionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(applyPendingMaintenanceActionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Starts the analysis of up to 20 source databases to recommend target engines for each source database. This is a
* batch version of StartRecommendations
* .
*
*
* The result of analysis of each source database is reported individually in the response. Because the batch
* request can result in a combination of successful and unsuccessful actions, you should check for batch errors
* even when the call returns an HTTP status code of 200
.
*
*
* @param batchStartRecommendationsRequest
* @return A Java Future containing the result of the BatchStartRecommendations 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.
*
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.BatchStartRecommendations
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture batchStartRecommendations(
BatchStartRecommendationsRequest batchStartRecommendationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchStartRecommendationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchStartRecommendationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchStartRecommendations");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchStartRecommendationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchStartRecommendations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchStartRecommendationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchStartRecommendationsRequest));
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);
}
}
/**
*
* Cancels a single premigration assessment run.
*
*
* This operation prevents any individual assessments from running if they haven't started running. It also attempts
* to cancel any individual assessments that are currently running.
*
*
* @param cancelReplicationTaskAssessmentRunRequest
* @return A Java Future containing the result of the CancelReplicationTaskAssessmentRun operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CancelReplicationTaskAssessmentRun
* @see AWS API Documentation
*/
@Override
public CompletableFuture cancelReplicationTaskAssessmentRun(
CancelReplicationTaskAssessmentRunRequest cancelReplicationTaskAssessmentRunRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(cancelReplicationTaskAssessmentRunRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
cancelReplicationTaskAssessmentRunRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelReplicationTaskAssessmentRun");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CancelReplicationTaskAssessmentRunResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CancelReplicationTaskAssessmentRun").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CancelReplicationTaskAssessmentRunRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(cancelReplicationTaskAssessmentRunRequest));
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 data provider using the provided settings. A data provider stores a data store type and location
* information about your database.
*
*
* @param createDataProviderRequest
* @return A Java Future containing the result of the CreateDataProvider 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.
*
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateDataProvider
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createDataProvider(CreateDataProviderRequest createDataProviderRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataProviderRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataProviderRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataProvider");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDataProviderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDataProvider").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateDataProviderRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createDataProviderRequest));
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 endpoint using the provided settings.
*
*
*
* For a MySQL source or target endpoint, don't explicitly specify the database using the DatabaseName
* request parameter on the CreateEndpoint
API call. Specifying DatabaseName
when you
* create a MySQL endpoint replicates all the task tables to this single database. For MySQL endpoints, you specify
* the database only when you specify the schema in the table-mapping rules of the DMS task.
*
*
*
* @param createEndpointRequest
* @return A Java Future containing the result of the CreateEndpoint 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.
*
* - KmsKeyNotAccessibleException DMS cannot access the KMS key.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - ResourceNotFoundException The resource could not be found.
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - S3AccessDeniedException Insufficient privileges are preventing access to an Amazon S3 object.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateEndpoint
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createEndpoint(CreateEndpointRequest createEndpointRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEndpointRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createEndpointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEndpoint");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEndpointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateEndpoint").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateEndpointRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createEndpointRequest));
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 DMS event notification subscription.
*
*
* You can specify the type of source (SourceType
) you want to be notified of, provide a list of DMS
* source IDs (SourceIds
) that triggers the events, and provide a list of event categories (
* EventCategories
) for events you want to be notified of. If you specify both the
* SourceType
and SourceIds
, such as SourceType = replication-instance
and
* SourceIdentifier = my-replinstance
, you will be notified of all the replication instance events for
* the specified source. If you specify a SourceType
but don't specify a SourceIdentifier
,
* you receive notice of the events for that source type for all your DMS sources. If you don't specify either
* SourceType
nor SourceIdentifier
, you will be notified of events generated from all DMS
* sources belonging to your customer account.
*
*
* For more information about DMS events, see Working with Events and
* Notifications in the Database Migration Service User Guide.
*
*
* @param createEventSubscriptionRequest
* @return A Java Future containing the result of the CreateEventSubscription 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.
*
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - ResourceNotFoundException The resource could not be found.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - SnsInvalidTopicException The SNS topic is invalid.
* - SnsNoAuthorizationException You are not authorized for the SNS subscription.
* - KmsAccessDeniedException The ciphertext references a key that doesn't exist or that the DMS account
* doesn't have access to.
* - KmsDisabledException The specified KMS key isn't enabled.
* - KmsInvalidStateException The state of the specified KMS resource isn't valid for this request.
* - KmsNotFoundException The specified KMS entity or resource can't be found.
* - KmsThrottlingException This request triggered KMS request throttling.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateEventSubscription
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createEventSubscription(
CreateEventSubscriptionRequest createEventSubscriptionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEventSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createEventSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEventSubscription");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEventSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateEventSubscription").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateEventSubscriptionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createEventSubscriptionRequest));
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 Fleet Advisor collector using the specified parameters.
*
*
* @param createFleetAdvisorCollectorRequest
* @return A Java Future containing the result of the CreateFleetAdvisorCollector 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.
*
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - S3AccessDeniedException Insufficient privileges are preventing access to an Amazon S3 object.
* - S3ResourceNotFoundException A specified Amazon S3 bucket, bucket folder, or other object can't be
* found.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateFleetAdvisorCollector
* @see AWS API Documentation
*/
@Override
public CompletableFuture createFleetAdvisorCollector(
CreateFleetAdvisorCollectorRequest createFleetAdvisorCollectorRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFleetAdvisorCollectorRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFleetAdvisorCollectorRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFleetAdvisorCollector");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateFleetAdvisorCollectorResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFleetAdvisorCollector").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateFleetAdvisorCollectorRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createFleetAdvisorCollectorRequest));
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 the instance profile using the specified parameters.
*
*
* @param createInstanceProfileRequest
* @return A Java Future containing the result of the CreateInstanceProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceNotFoundException The resource could not be found.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - KmsKeyNotAccessibleException DMS cannot access the KMS key.
* - S3ResourceNotFoundException A specified Amazon S3 bucket, bucket folder, or other object can't be
* found.
* - S3AccessDeniedException Insufficient privileges are preventing access to an Amazon S3 object.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateInstanceProfile
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createInstanceProfile(
CreateInstanceProfileRequest createInstanceProfileRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createInstanceProfileRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createInstanceProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateInstanceProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateInstanceProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateInstanceProfile").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateInstanceProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createInstanceProfileRequest));
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 the migration project using the specified parameters.
*
*
* You can run this action only after you create an instance profile and data providers using CreateInstanceProfile and CreateDataProvider.
*
*
* @param createMigrationProjectRequest
* @return A Java Future containing the result of the CreateMigrationProject operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - ResourceNotFoundException The resource could not be found.
* - S3ResourceNotFoundException A specified Amazon S3 bucket, bucket folder, or other object can't be
* found.
* - S3AccessDeniedException Insufficient privileges are preventing access to an Amazon S3 object.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateMigrationProject
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createMigrationProject(
CreateMigrationProjectRequest createMigrationProjectRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createMigrationProjectRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createMigrationProjectRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMigrationProject");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateMigrationProjectResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateMigrationProject").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateMigrationProjectRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createMigrationProjectRequest));
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 configuration that you can later provide to configure and start an DMS Serverless replication. You can
* also provide options to validate the configuration inputs before you start the replication.
*
*
* @param createReplicationConfigRequest
* @return A Java Future containing the result of the CreateReplicationConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - ReplicationSubnetGroupDoesNotCoverEnoughAZsException The replication subnet group does not cover
* enough Availability Zones (AZs). Edit the replication subnet group and add more AZs.
* - InvalidSubnetException The subnet provided isn't valid.
* - KmsKeyNotAccessibleException DMS cannot access the KMS key.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateReplicationConfig
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createReplicationConfig(
CreateReplicationConfigRequest createReplicationConfigRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReplicationConfigRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReplicationConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReplicationConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReplicationConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateReplicationConfig").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateReplicationConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createReplicationConfigRequest));
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 the replication instance using the specified parameters.
*
*
* DMS requires that your account have certain roles with appropriate permissions before you can create a
* replication instance. For information on the required roles, see Creating the IAM
* Roles to Use With the CLI and DMS API. For information on the required permissions, see IAM
* Permissions Needed to Use DMS.
*
*
*
* If you don't specify a version when creating a replication instance, DMS will create the instance using the
* default engine version. For information about the default engine version, see Release Notes.
*
*
*
* @param createReplicationInstanceRequest
* @return A Java Future containing the result of the CreateReplicationInstance operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - InsufficientResourceCapacityException There are not enough resources allocated to the database
* migration.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - StorageQuotaExceededException The storage quota has been exceeded.
* - ResourceNotFoundException The resource could not be found.
* - ReplicationSubnetGroupDoesNotCoverEnoughAZsException The replication subnet group does not cover
* enough Availability Zones (AZs). Edit the replication subnet group and add more AZs.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - InvalidSubnetException The subnet provided isn't valid.
* - KmsKeyNotAccessibleException DMS cannot access the KMS key.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateReplicationInstance
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createReplicationInstance(
CreateReplicationInstanceRequest createReplicationInstanceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReplicationInstanceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReplicationInstanceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReplicationInstance");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReplicationInstanceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateReplicationInstance").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateReplicationInstanceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createReplicationInstanceRequest));
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 replication subnet group given a list of the subnet IDs in a VPC.
*
*
* The VPC needs to have at least one subnet in at least two availability zones in the Amazon Web Services Region,
* otherwise the service will throw a ReplicationSubnetGroupDoesNotCoverEnoughAZs
exception.
*
*
* If a replication subnet group exists in your Amazon Web Services account, the CreateReplicationSubnetGroup action
* returns the following error message: The Replication Subnet Group already exists. In this case, delete the
* existing replication subnet group. To do so, use the DeleteReplicationSubnetGroup action. Optionally, choose Subnet groups in the DMS console, then choose your
* subnet group. Next, choose Delete from Actions.
*
*
* @param createReplicationSubnetGroupRequest
* @return A Java Future containing the result of the CreateReplicationSubnetGroup operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceNotFoundException The resource could not be found.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - ReplicationSubnetGroupDoesNotCoverEnoughAZsException The replication subnet group does not cover
* enough Availability Zones (AZs). Edit the replication subnet group and add more AZs.
* - InvalidSubnetException The subnet provided isn't valid.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateReplicationSubnetGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture createReplicationSubnetGroup(
CreateReplicationSubnetGroupRequest createReplicationSubnetGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReplicationSubnetGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReplicationSubnetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReplicationSubnetGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReplicationSubnetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateReplicationSubnetGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateReplicationSubnetGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createReplicationSubnetGroupRequest));
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 replication task using the specified parameters.
*
*
* @param createReplicationTaskRequest
* @return A Java Future containing the result of the CreateReplicationTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - ResourceAlreadyExistsException The resource you are attempting to create already exists.
* - ResourceNotFoundException The resource could not be found.
* - KmsKeyNotAccessibleException DMS cannot access the KMS key.
* - ResourceQuotaExceededException The quota for this resource quota has been exceeded.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.CreateReplicationTask
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createReplicationTask(
CreateReplicationTaskRequest createReplicationTaskRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReplicationTaskRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReplicationTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReplicationTask");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReplicationTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateReplicationTask").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateReplicationTaskRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createReplicationTaskRequest));
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 certificate.
*
*
* @param deleteCertificateRequest
* @return A Java Future containing the result of the DeleteCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteCertificate
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteCertificate(DeleteCertificateRequest deleteCertificateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCertificateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCertificateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCertificate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCertificateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCertificate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteCertificateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteCertificateRequest));
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 connection between a replication instance and an endpoint.
*
*
* @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.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.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, "Database Migration Service");
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 the specified data provider.
*
*
*
* All migration projects associated with the data provider must be deleted or modified before you can delete the
* data provider.
*
*
*
* @param deleteDataProviderRequest
* @return A Java Future containing the result of the DeleteDataProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteDataProvider
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteDataProvider(DeleteDataProviderRequest deleteDataProviderRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDataProviderRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDataProviderRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataProvider");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDataProviderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDataProvider").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteDataProviderRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteDataProviderRequest));
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 endpoint.
*
*
*
* All tasks associated with the endpoint must be deleted before you can delete the endpoint.
*
*
*
*
* @param deleteEndpointRequest
* @return A Java Future containing the result of the DeleteEndpoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
- InvalidResourceStateException The
* resource is in a state that prevents it from being used for database migration.
- 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.
- DatabaseMigrationException Base class for all service
* exceptions. Unknown exceptions will be thrown as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteEndpoint
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEndpointRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEndpointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEndpoint");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEndpointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteEndpoint").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteEndpointRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteEndpointRequest));
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 DMS event subscription.
*
*
* @param deleteEventSubscriptionRequest
* @return A Java Future containing the result of the DeleteEventSubscription operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteEventSubscription
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteEventSubscription(
DeleteEventSubscriptionRequest deleteEventSubscriptionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEventSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEventSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEventSubscription");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEventSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteEventSubscription").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteEventSubscriptionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteEventSubscriptionRequest));
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 Fleet Advisor collector.
*
*
* @param deleteFleetAdvisorCollectorRequest
* @return A Java Future containing the result of the DeleteFleetAdvisorCollector 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.
*
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - CollectorNotFoundException The specified collector doesn't exist.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteFleetAdvisorCollector
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFleetAdvisorCollector(
DeleteFleetAdvisorCollectorRequest deleteFleetAdvisorCollectorRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFleetAdvisorCollectorRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFleetAdvisorCollectorRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFleetAdvisorCollector");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFleetAdvisorCollectorResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFleetAdvisorCollector").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteFleetAdvisorCollectorRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteFleetAdvisorCollectorRequest));
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 Fleet Advisor collector databases.
*
*
* @param deleteFleetAdvisorDatabasesRequest
* @return A Java Future containing the result of the DeleteFleetAdvisorDatabases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - InvalidOperationException The action or operation requested isn't valid.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteFleetAdvisorDatabases
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFleetAdvisorDatabases(
DeleteFleetAdvisorDatabasesRequest deleteFleetAdvisorDatabasesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFleetAdvisorDatabasesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFleetAdvisorDatabasesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFleetAdvisorDatabases");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFleetAdvisorDatabasesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFleetAdvisorDatabases").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteFleetAdvisorDatabasesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteFleetAdvisorDatabasesRequest));
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 instance profile.
*
*
*
* All migration projects associated with the instance profile must be deleted or modified before you can delete the
* instance profile.
*
*
*
* @param deleteInstanceProfileRequest
* @return A Java Future containing the result of the DeleteInstanceProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteInstanceProfile
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteInstanceProfile(
DeleteInstanceProfileRequest deleteInstanceProfileRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteInstanceProfileRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInstanceProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInstanceProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteInstanceProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteInstanceProfile").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteInstanceProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteInstanceProfileRequest));
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 migration project.
*
*
*
* The migration project must be closed before you can delete it.
*
*
*
* @param deleteMigrationProjectRequest
* @return A Java Future containing the result of the DeleteMigrationProject operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteMigrationProject
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteMigrationProject(
DeleteMigrationProjectRequest deleteMigrationProjectRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteMigrationProjectRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMigrationProjectRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMigrationProject");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteMigrationProjectResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteMigrationProject").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteMigrationProjectRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteMigrationProjectRequest));
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 DMS Serverless replication configuration. This effectively deprovisions any and all replications that
* use this configuration. You can't delete the configuration for an DMS Serverless replication that is ongoing. You
* can delete the configuration when the replication is in a non-RUNNING and non-STARTING state.
*
*
* @param deleteReplicationConfigRequest
* @return A Java Future containing the result of the DeleteReplicationConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteReplicationConfig
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteReplicationConfig(
DeleteReplicationConfigRequest deleteReplicationConfigRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReplicationConfigRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReplicationConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReplicationConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReplicationConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReplicationConfig").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteReplicationConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteReplicationConfigRequest));
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 replication instance.
*
*
*
* You must delete any migration tasks that are associated with the replication instance before you can delete it.
*
*
*
*
* @param deleteReplicationInstanceRequest
* @return A Java Future containing the result of the DeleteReplicationInstance 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.
*
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
- ResourceNotFoundException The resource could not be found.
-
* 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.
- DatabaseMigrationException Base class for
* all service exceptions. Unknown exceptions will be thrown as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteReplicationInstance
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteReplicationInstance(
DeleteReplicationInstanceRequest deleteReplicationInstanceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReplicationInstanceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReplicationInstanceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReplicationInstance");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReplicationInstanceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReplicationInstance").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteReplicationInstanceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteReplicationInstanceRequest));
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 subnet group.
*
*
* @param deleteReplicationSubnetGroupRequest
* @return A Java Future containing the result of the DeleteReplicationSubnetGroup 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.
*
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteReplicationSubnetGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteReplicationSubnetGroup(
DeleteReplicationSubnetGroupRequest deleteReplicationSubnetGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReplicationSubnetGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReplicationSubnetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReplicationSubnetGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReplicationSubnetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReplicationSubnetGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteReplicationSubnetGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteReplicationSubnetGroupRequest));
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 replication task.
*
*
* @param deleteReplicationTaskRequest
* @return A Java Future containing the result of the DeleteReplicationTask operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteReplicationTask
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteReplicationTask(
DeleteReplicationTaskRequest deleteReplicationTaskRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReplicationTaskRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReplicationTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReplicationTask");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReplicationTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReplicationTask").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteReplicationTaskRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteReplicationTaskRequest));
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 record of a single premigration assessment run.
*
*
* This operation removes all metadata that DMS maintains about this assessment run. However, the operation leaves
* untouched all information about this assessment run that is stored in your Amazon S3 bucket.
*
*
* @param deleteReplicationTaskAssessmentRunRequest
* @return A Java Future containing the result of the DeleteReplicationTaskAssessmentRun operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DeleteReplicationTaskAssessmentRun
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteReplicationTaskAssessmentRun(
DeleteReplicationTaskAssessmentRunRequest deleteReplicationTaskAssessmentRunRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReplicationTaskAssessmentRunRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteReplicationTaskAssessmentRunRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReplicationTaskAssessmentRun");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteReplicationTaskAssessmentRunResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteReplicationTaskAssessmentRun").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteReplicationTaskAssessmentRunRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteReplicationTaskAssessmentRunRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists all of the DMS attributes for a customer account. These attributes include DMS quotas for the account and a
* unique account identifier in a particular DMS region. DMS quotas include a list of resource quotas supported by
* the account, such as the number of replication instances allowed. The description for each resource quota,
* includes the quota name, current usage toward that quota, and the quota's maximum value. DMS uses the unique
* account identifier to name each artifact used by DMS in the given region.
*
*
* This command does not take any parameters.
*
*
* @param describeAccountAttributesRequest
* @return A Java Future containing the result of the DescribeAccountAttributes 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.
*
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeAccountAttributes
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeAccountAttributes(
DescribeAccountAttributesRequest describeAccountAttributesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAccountAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAccountAttributesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAccountAttributes");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeAccountAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAccountAttributes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAccountAttributesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAccountAttributesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Provides a list of individual assessments that you can specify for a new premigration assessment run, given one
* or more parameters.
*
*
* If you specify an existing migration task, this operation provides the default individual assessments you can
* specify for that task. Otherwise, the specified parameters model elements of a possible migration task on which
* to base a premigration assessment run.
*
*
* To use these migration task modeling parameters, you must specify an existing replication instance, a source
* database engine, a target database engine, and a migration type. This combination of parameters potentially
* limits the default individual assessments available for an assessment run created for a corresponding migration
* task.
*
*
* If you specify no parameters, this operation provides a list of all possible individual assessments that you can
* specify for an assessment run. If you specify any one of the task modeling parameters, you must specify all of
* them or the operation cannot provide a list of individual assessments. The only parameter that you can specify
* alone is for an existing migration task. The specified task definition then determines the default list of
* individual assessments that you can specify in an assessment run for the task.
*
*
* @param describeApplicableIndividualAssessmentsRequest
* @return A Java Future containing the result of the DescribeApplicableIndividualAssessments operation returned by
* the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - ResourceNotFoundException The resource could not be found.
* - InvalidResourceStateException The resource is in a state that prevents it from being used for
* database migration.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeApplicableIndividualAssessments
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeApplicableIndividualAssessments(
DescribeApplicableIndividualAssessmentsRequest describeApplicableIndividualAssessmentsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeApplicableIndividualAssessmentsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeApplicableIndividualAssessmentsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeApplicableIndividualAssessments");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeApplicableIndividualAssessmentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeApplicableIndividualAssessments").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeApplicableIndividualAssessmentsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeApplicableIndividualAssessmentsRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Provides a description of the certificate.
*
*
* @param describeCertificatesRequest
* @return A Java Future containing the result of the DescribeCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeCertificates
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeCertificates(
DescribeCertificatesRequest describeCertificatesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCertificatesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCertificatesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCertificates");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeCertificatesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeCertificates").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeCertificatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeCertificatesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the status of the connections that have been made between the replication instance and an endpoint.
* Connections are created when you test an endpoint.
*
*
* @param describeConnectionsRequest
* @return A Java Future containing the result of the DescribeConnections operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeConnections
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeConnections(
DescribeConnectionsRequest describeConnectionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeConnectionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeConnectionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeConnections");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeConnectionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeConnections").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeConnectionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeConnectionsRequest));
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);
}
}
/**
*
* Returns configuration parameters for a schema conversion project.
*
*
* @param describeConversionConfigurationRequest
* @return A Java Future containing the result of the DescribeConversionConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeConversionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeConversionConfiguration(
DescribeConversionConfigurationRequest describeConversionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeConversionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeConversionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeConversionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeConversionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeConversionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeConversionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeConversionConfigurationRequest));
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);
}
}
/**
*
* Returns a paginated list of data providers for your account in the current region.
*
*
* @param describeDataProvidersRequest
* @return A Java Future containing the result of the DescribeDataProviders operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource could not be found.
* - AccessDeniedException DMS was denied access to the endpoint. Check that the role is correctly
* configured.
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeDataProviders
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeDataProviders(
DescribeDataProvidersRequest describeDataProvidersRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDataProvidersRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDataProvidersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDataProviders");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDataProvidersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDataProviders").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeDataProvidersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeDataProvidersRequest));
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);
}
}
/**
*
* Returns information about the possible endpoint settings available when you create an endpoint for a specific
* database engine.
*
*
* @param describeEndpointSettingsRequest
* @return A Java Future containing the result of the DescribeEndpointSettings 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.
*
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeEndpointSettings
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeEndpointSettings(
DescribeEndpointSettingsRequest describeEndpointSettingsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeEndpointSettingsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEndpointSettingsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEndpointSettings");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeEndpointSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeEndpointSettings").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeEndpointSettingsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeEndpointSettingsRequest));
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);
}
}
/**
*
* Returns information about the type of endpoints available.
*
*
* @param describeEndpointTypesRequest
* @return A Java Future containing the result of the DescribeEndpointTypes 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.
*
* - 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.
* - DatabaseMigrationException Base class for all service exceptions. Unknown exceptions will be thrown
* as an instance of this type.
*
* @sample DatabaseMigrationAsyncClient.DescribeEndpointTypes
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeEndpointTypes(
DescribeEndpointTypesRequest describeEndpointTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeEndpointTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEndpointTypesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Database Migration Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEndpointTypes");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeEndpointTypesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams