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

com.amazonaws.services.databasemigrationservice.AWSDatabaseMigrationServiceClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 1.12.782
Show newest version
/*
 * Copyright 2011-2016 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 com.amazonaws.services.databasemigrationservice;

import org.w3c.dom.*;

import java.net.*;
import java.util.*;
import java.util.Map.Entry;

import org.apache.commons.logging.*;

import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;

import com.amazonaws.AmazonServiceException;

import com.amazonaws.services.databasemigrationservice.model.*;
import com.amazonaws.services.databasemigrationservice.model.transform.*;

/**
 * Client for accessing AWS Database Migration Service. All service calls made using this client are blocking, and will
 * not return until the service call completes.
 * 

* AWS Database Migration Service *

* AWS Database Migration Service (AWS DMS) can migrate your data to and from the most widely used commercial and * open-source databases such as Oracle, PostgreSQL, Microsoft SQL Server, Amazon Redshift, MariaDB, Amazon Aurora, and * MySQL. The service supports homogeneous migrations such as Oracle to Oracle, as well as heterogeneous migrations * between different database platforms, such as Oracle to MySQL or SQL Server to PostgreSQL. *

*/ @ThreadSafe public class AWSDatabaseMigrationServiceClient extends AmazonWebServiceClient implements AWSDatabaseMigrationService { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSDatabaseMigrationService.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "dms"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final SdkJsonProtocolFactory protocolFactory = new SdkJsonProtocolFactory(new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidCertificateFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.InvalidCertificateException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("UpgradeDependencyFailureFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.UpgradeDependencyFailureException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InsufficientResourceCapacityFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.InsufficientResourceCapacityException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceQuotaExceededFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.ResourceQuotaExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.AccessDeniedException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidResourceStateFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.InvalidResourceStateException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.ResourceNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KMSKeyNotAccessibleFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.KMSKeyNotAccessibleException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("SubnetAlreadyInUse").withModeledClass( com.amazonaws.services.databasemigrationservice.model.SubnetAlreadyInUseException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceAlreadyExistsFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.ResourceAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidSubnet").withModeledClass( com.amazonaws.services.databasemigrationservice.model.InvalidSubnetException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("StorageQuotaExceededFault").withModeledClass( com.amazonaws.services.databasemigrationservice.model.StorageQuotaExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ReplicationSubnetGroupDoesNotCoverEnoughAZs").withModeledClass( com.amazonaws.services.databasemigrationservice.model.ReplicationSubnetGroupDoesNotCoverEnoughAZsException.class)) .withBaseServiceExceptionClass(com.amazonaws.services.databasemigrationservice.model.AWSDatabaseMigrationServiceException.class)); /** * Constructs a new client to invoke service methods on AWS Database Migration Service. A credentials provider chain * will be used that searches for credentials in this order: *
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
* *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @see DefaultAWSCredentialsProviderChain */ public AWSDatabaseMigrationServiceClient() { this(new DefaultAWSCredentialsProviderChain(), configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service. A credentials provider chain * will be used that searches for credentials in this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
* *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientConfiguration * The client configuration options controlling how this client connects to AWS Database Migration Service * (ex: proxy settings, retry counts, etc.). * * @see DefaultAWSCredentialsProviderChain */ public AWSDatabaseMigrationServiceClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified AWS * account credentials. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. */ public AWSDatabaseMigrationServiceClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified AWS * account credentials and client configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS Database Migration Service * (ex: proxy settings, retry counts, etc.). */ public AWSDatabaseMigrationServiceClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials); init(); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified AWS * account credentials provider. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. */ public AWSDatabaseMigrationServiceClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified AWS * account credentials provider and client configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS Database Migration Service * (ex: proxy settings, retry counts, etc.). */ public AWSDatabaseMigrationServiceClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified AWS * account credentials provider, client configuration options, and request metric collector. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS Database Migration Service * (ex: proxy settings, retry counts, etc.). * @param requestMetricCollector * optional request metric collector */ public AWSDatabaseMigrationServiceClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; init(); } /** * Constructs a new client to invoke service methods on AWS Database Migration Service using the specified * parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSDatabaseMigrationServiceClient(AwsSyncClientParams clientParams) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("dms.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/databasemigrationservice/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/databasemigrationservice/request.handler2s")); } /** *

* Adds metadata tags to a DMS resource, including replication instance, endpoint, security 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. *

* * @param addTagsToResourceRequest * @return Result of the AddTagsToResource operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.AddTagsToResource */ @Override public AddTagsToResourceResult addTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest) { ExecutionContext executionContext = createExecutionContext(addTagsToResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AddTagsToResourceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(addTagsToResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddTagsToResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates an endpoint using the provided settings. *

* * @param createEndpointRequest * @return Result of the CreateEndpoint operation returned by the service. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.CreateEndpoint */ @Override public CreateEndpointResult createEndpoint(CreateEndpointRequest createEndpointRequest) { ExecutionContext executionContext = createExecutionContext(createEndpointRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateEndpointRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEndpointRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEndpointResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates the replication instance using the specified parameters. *

* * @param createReplicationInstanceRequest * @return Result of the CreateReplicationInstance operation returned by the service. * @throws AccessDeniedException * AWS DMS was denied access to the endpoint. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws InsufficientResourceCapacityException * There are not enough resources allocated to the database migration. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @throws StorageQuotaExceededException * The storage quota has been exceeded. * @throws ResourceNotFoundException * The resource could not be found. * @throws ReplicationSubnetGroupDoesNotCoverEnoughAZsException * The replication subnet group does not cover enough Availability Zones (AZs). Edit the replication subnet * group and add more AZs. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws InvalidSubnetException * The subnet provided is invalid. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @sample AWSDatabaseMigrationService.CreateReplicationInstance */ @Override public CreateReplicationInstanceResult createReplicationInstance(CreateReplicationInstanceRequest createReplicationInstanceRequest) { ExecutionContext executionContext = createExecutionContext(createReplicationInstanceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateReplicationInstanceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(createReplicationInstanceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateReplicationInstanceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a replication subnet group given a list of the subnet IDs in a VPC. *

* * @param createReplicationSubnetGroupRequest * @return Result of the CreateReplicationSubnetGroup operation returned by the service. * @throws AccessDeniedException * AWS DMS was denied access to the endpoint. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws ResourceNotFoundException * The resource could not be found. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @throws ReplicationSubnetGroupDoesNotCoverEnoughAZsException * The replication subnet group does not cover enough Availability Zones (AZs). Edit the replication subnet * group and add more AZs. * @throws InvalidSubnetException * The subnet provided is invalid. * @sample AWSDatabaseMigrationService.CreateReplicationSubnetGroup */ @Override public CreateReplicationSubnetGroupResult createReplicationSubnetGroup(CreateReplicationSubnetGroupRequest createReplicationSubnetGroupRequest) { ExecutionContext executionContext = createExecutionContext(createReplicationSubnetGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateReplicationSubnetGroupRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(createReplicationSubnetGroupRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateReplicationSubnetGroupResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Creates a replication task using the specified parameters. *

* * @param createReplicationTaskRequest * @return Result of the CreateReplicationTask operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws ResourceNotFoundException * The resource could not be found. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @sample AWSDatabaseMigrationService.CreateReplicationTask */ @Override public CreateReplicationTaskResult createReplicationTask(CreateReplicationTaskRequest createReplicationTaskRequest) { ExecutionContext executionContext = createExecutionContext(createReplicationTaskRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateReplicationTaskRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(createReplicationTaskRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateReplicationTaskResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes the specified certificate. *

* * @param deleteCertificateRequest * @return Result of the DeleteCertificate operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.DeleteCertificate */ @Override public DeleteCertificateResult deleteCertificate(DeleteCertificateRequest deleteCertificateRequest) { ExecutionContext executionContext = createExecutionContext(deleteCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteCertificateRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes the specified endpoint. *

* *

* All tasks associated with the endpoint must be deleted before you can delete the endpoint. *

*
*

* * @param deleteEndpointRequest * @return Result of the DeleteEndpoint operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.DeleteEndpoint */ @Override public DeleteEndpointResult deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) { ExecutionContext executionContext = createExecutionContext(deleteEndpointRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteEndpointRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteEndpointRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEndpointResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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 Result of the DeleteReplicationInstance operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DeleteReplicationInstance */ @Override public DeleteReplicationInstanceResult deleteReplicationInstance(DeleteReplicationInstanceRequest deleteReplicationInstanceRequest) { ExecutionContext executionContext = createExecutionContext(deleteReplicationInstanceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteReplicationInstanceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReplicationInstanceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReplicationInstanceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes a subnet group. *

* * @param deleteReplicationSubnetGroupRequest * @return Result of the DeleteReplicationSubnetGroup operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DeleteReplicationSubnetGroup */ @Override public DeleteReplicationSubnetGroupResult deleteReplicationSubnetGroup(DeleteReplicationSubnetGroupRequest deleteReplicationSubnetGroupRequest) { ExecutionContext executionContext = createExecutionContext(deleteReplicationSubnetGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteReplicationSubnetGroupRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(deleteReplicationSubnetGroupRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReplicationSubnetGroupResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Deletes the specified replication task. *

* * @param deleteReplicationTaskRequest * @return Result of the DeleteReplicationTask operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.DeleteReplicationTask */ @Override public DeleteReplicationTaskResult deleteReplicationTask(DeleteReplicationTaskRequest deleteReplicationTaskRequest) { ExecutionContext executionContext = createExecutionContext(deleteReplicationTaskRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteReplicationTaskRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReplicationTaskRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReplicationTaskResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists all of the AWS DMS attributes for a customer account. The attributes include AWS DMS quotas for the * account, such as the number of replication instances allowed. The description for a quota includes the quota * name, current usage toward that quota, and the quota's maximum value. *

*

* This command does not take any parameters. *

* * @param describeAccountAttributesRequest * @return Result of the DescribeAccountAttributes operation returned by the service. * @sample AWSDatabaseMigrationService.DescribeAccountAttributes */ @Override public DescribeAccountAttributesResult describeAccountAttributes(DescribeAccountAttributesRequest describeAccountAttributesRequest) { ExecutionContext executionContext = createExecutionContext(describeAccountAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeAccountAttributesRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAccountAttributesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAccountAttributesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Provides a description of the certificate. *

* * @param describeCertificatesRequest * @return Result of the DescribeCertificates operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeCertificates */ @Override public DescribeCertificatesResult describeCertificates(DescribeCertificatesRequest describeCertificatesRequest) { ExecutionContext executionContext = createExecutionContext(describeCertificatesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeCertificatesRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCertificatesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCertificatesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* 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 Result of the DescribeConnections operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeConnections */ @Override public DescribeConnectionsResult describeConnections(DescribeConnectionsRequest describeConnectionsRequest) { ExecutionContext executionContext = createExecutionContext(describeConnectionsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeConnectionsRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConnectionsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConnectionsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about the type of endpoints available. *

* * @param describeEndpointTypesRequest * @return Result of the DescribeEndpointTypes operation returned by the service. * @sample AWSDatabaseMigrationService.DescribeEndpointTypes */ @Override public DescribeEndpointTypesResult describeEndpointTypes(DescribeEndpointTypesRequest describeEndpointTypesRequest) { ExecutionContext executionContext = createExecutionContext(describeEndpointTypesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeEndpointTypesRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointTypesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointTypesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about the endpoints for your account in the current region. *

* * @param describeEndpointsRequest * @return Result of the DescribeEndpoints operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeEndpoints */ @Override public DescribeEndpointsResult describeEndpoints(DescribeEndpointsRequest describeEndpointsRequest) { ExecutionContext executionContext = createExecutionContext(describeEndpointsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeEndpointsRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about the replication instance types that can be created in the specified region. *

* * @param describeOrderableReplicationInstancesRequest * @return Result of the DescribeOrderableReplicationInstances operation returned by the service. * @sample AWSDatabaseMigrationService.DescribeOrderableReplicationInstances */ @Override public DescribeOrderableReplicationInstancesResult describeOrderableReplicationInstances( DescribeOrderableReplicationInstancesRequest describeOrderableReplicationInstancesRequest) { ExecutionContext executionContext = createExecutionContext(describeOrderableReplicationInstancesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeOrderableReplicationInstancesRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(describeOrderableReplicationInstancesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeOrderableReplicationInstancesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns the status of the RefreshSchemas operation. *

* * @param describeRefreshSchemasStatusRequest * @return Result of the DescribeRefreshSchemasStatus operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeRefreshSchemasStatus */ @Override public DescribeRefreshSchemasStatusResult describeRefreshSchemasStatus(DescribeRefreshSchemasStatusRequest describeRefreshSchemasStatusRequest) { ExecutionContext executionContext = createExecutionContext(describeRefreshSchemasStatusRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeRefreshSchemasStatusRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(describeRefreshSchemasStatusRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRefreshSchemasStatusResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about replication instances for your account in the current region. *

* * @param describeReplicationInstancesRequest * @return Result of the DescribeReplicationInstances operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeReplicationInstances */ @Override public DescribeReplicationInstancesResult describeReplicationInstances(DescribeReplicationInstancesRequest describeReplicationInstancesRequest) { ExecutionContext executionContext = createExecutionContext(describeReplicationInstancesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeReplicationInstancesRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(describeReplicationInstancesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReplicationInstancesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about the replication subnet groups. *

* * @param describeReplicationSubnetGroupsRequest * @return Result of the DescribeReplicationSubnetGroups operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeReplicationSubnetGroups */ @Override public DescribeReplicationSubnetGroupsResult describeReplicationSubnetGroups(DescribeReplicationSubnetGroupsRequest describeReplicationSubnetGroupsRequest) { ExecutionContext executionContext = createExecutionContext(describeReplicationSubnetGroupsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeReplicationSubnetGroupsRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(describeReplicationSubnetGroupsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReplicationSubnetGroupsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about replication tasks for your account in the current region. *

* * @param describeReplicationTasksRequest * @return Result of the DescribeReplicationTasks operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeReplicationTasks */ @Override public DescribeReplicationTasksResult describeReplicationTasks(DescribeReplicationTasksRequest describeReplicationTasksRequest) { ExecutionContext executionContext = createExecutionContext(describeReplicationTasksRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeReplicationTasksRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReplicationTasksRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReplicationTasksResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns information about the schema for the specified endpoint. *

*

* * @param describeSchemasRequest * @return Result of the DescribeSchemas operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.DescribeSchemas */ @Override public DescribeSchemasResult describeSchemas(DescribeSchemasRequest describeSchemasRequest) { ExecutionContext executionContext = createExecutionContext(describeSchemasRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeSchemasRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeSchemasRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeSchemasResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Returns table statistics on the database migration task, including table name, rows inserted, rows updated, and * rows deleted. *

* * @param describeTableStatisticsRequest * @return Result of the DescribeTableStatistics operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.DescribeTableStatistics */ @Override public DescribeTableStatisticsResult describeTableStatistics(DescribeTableStatisticsRequest describeTableStatisticsRequest) { ExecutionContext executionContext = createExecutionContext(describeTableStatisticsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeTableStatisticsRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeTableStatisticsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeTableStatisticsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Uploads the specified certificate. *

* * @param importCertificateRequest * @return Result of the ImportCertificate operation returned by the service. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws InvalidCertificateException * The certificate was not valid. * @sample AWSDatabaseMigrationService.ImportCertificate */ @Override public ImportCertificateResult importCertificate(ImportCertificateRequest importCertificateRequest) { ExecutionContext executionContext = createExecutionContext(importCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ImportCertificateRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(importCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Lists all tags for an AWS DMS resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.ListTagsForResource */ @Override public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListTagsForResourceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Modifies the specified endpoint. *

* * @param modifyEndpointRequest * @return Result of the ModifyEndpoint operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @sample AWSDatabaseMigrationService.ModifyEndpoint */ @Override public ModifyEndpointResult modifyEndpoint(ModifyEndpointRequest modifyEndpointRequest) { ExecutionContext executionContext = createExecutionContext(modifyEndpointRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifyEndpointRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyEndpointRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyEndpointResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Modifies the replication instance to apply new settings. You can change one or more parameters by specifying * these parameters and the new values in the request. *

*

* Some settings are applied during the maintenance window. *

*

* * @param modifyReplicationInstanceRequest * @return Result of the ModifyReplicationInstance operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceAlreadyExistsException * The resource you are attempting to create already exists. * @throws ResourceNotFoundException * The resource could not be found. * @throws InsufficientResourceCapacityException * There are not enough resources allocated to the database migration. * @throws StorageQuotaExceededException * The storage quota has been exceeded. * @throws UpgradeDependencyFailureException * An upgrade dependency is preventing the database migration. * @sample AWSDatabaseMigrationService.ModifyReplicationInstance */ @Override public ModifyReplicationInstanceResult modifyReplicationInstance(ModifyReplicationInstanceRequest modifyReplicationInstanceRequest) { ExecutionContext executionContext = createExecutionContext(modifyReplicationInstanceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifyReplicationInstanceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyReplicationInstanceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyReplicationInstanceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Modifies the settings for the specified replication subnet group. *

* * @param modifyReplicationSubnetGroupRequest * @return Result of the ModifyReplicationSubnetGroup operation returned by the service. * @throws AccessDeniedException * AWS DMS was denied access to the endpoint. * @throws ResourceNotFoundException * The resource could not be found. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @throws SubnetAlreadyInUseException * The specified subnet is already in use. * @throws ReplicationSubnetGroupDoesNotCoverEnoughAZsException * The replication subnet group does not cover enough Availability Zones (AZs). Edit the replication subnet * group and add more AZs. * @throws InvalidSubnetException * The subnet provided is invalid. * @sample AWSDatabaseMigrationService.ModifyReplicationSubnetGroup */ @Override public ModifyReplicationSubnetGroupResult modifyReplicationSubnetGroup(ModifyReplicationSubnetGroupRequest modifyReplicationSubnetGroupRequest) { ExecutionContext executionContext = createExecutionContext(modifyReplicationSubnetGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ModifyReplicationSubnetGroupRequestMarshaller(protocolFactory).marshall(super .beforeMarshalling(modifyReplicationSubnetGroupRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyReplicationSubnetGroupResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Populates the schema for the specified endpoint. This is an asynchronous operation and can take several minutes. * You can check the status of this operation by calling the DescribeRefreshSchemasStatus operation. *

* * @param refreshSchemasRequest * @return Result of the RefreshSchemas operation returned by the service. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws ResourceNotFoundException * The resource could not be found. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @sample AWSDatabaseMigrationService.RefreshSchemas */ @Override public RefreshSchemasResult refreshSchemas(RefreshSchemasRequest refreshSchemasRequest) { ExecutionContext executionContext = createExecutionContext(refreshSchemasRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RefreshSchemasRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(refreshSchemasRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RefreshSchemasResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Removes metadata tags from a DMS resource. *

* * @param removeTagsFromResourceRequest * @return Result of the RemoveTagsFromResource operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @sample AWSDatabaseMigrationService.RemoveTagsFromResource */ @Override public RemoveTagsFromResourceResult removeTagsFromResource(RemoveTagsFromResourceRequest removeTagsFromResourceRequest) { ExecutionContext executionContext = createExecutionContext(removeTagsFromResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RemoveTagsFromResourceRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(removeTagsFromResourceRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RemoveTagsFromResourceResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Starts the replication task. *

* * @param startReplicationTaskRequest * @return Result of the StartReplicationTask operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.StartReplicationTask */ @Override public StartReplicationTaskResult startReplicationTask(StartReplicationTaskRequest startReplicationTaskRequest) { ExecutionContext executionContext = createExecutionContext(startReplicationTaskRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartReplicationTaskRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(startReplicationTaskRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartReplicationTaskResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Stops the replication task. *

*

* * @param stopReplicationTaskRequest * @return Result of the StopReplicationTask operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @sample AWSDatabaseMigrationService.StopReplicationTask */ @Override public StopReplicationTaskResult stopReplicationTask(StopReplicationTaskRequest stopReplicationTaskRequest) { ExecutionContext executionContext = createExecutionContext(stopReplicationTaskRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StopReplicationTaskRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopReplicationTaskRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopReplicationTaskResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Tests the connection between the replication instance and the endpoint. *

* * @param testConnectionRequest * @return Result of the TestConnection operation returned by the service. * @throws ResourceNotFoundException * The resource could not be found. * @throws InvalidResourceStateException * The resource is in a state that prevents it from being used for database migration. * @throws KMSKeyNotAccessibleException * AWS DMS cannot access the KMS key. * @throws ResourceQuotaExceededException * The quota for this resource quota has been exceeded. * @sample AWSDatabaseMigrationService.TestConnection */ @Override public TestConnectionResult testConnection(TestConnectionRequest testConnectionRequest) { ExecutionContext executionContext = createExecutionContext(testConnectionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new TestConnectionRequestMarshaller(protocolFactory).marshall(super.beforeMarshalling(testConnectionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestConnectionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. *

* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic * information for an executed request, you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private Response anonymousInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private Response doInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy