/* * Copyright 2018-2023 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.docdbelastic; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; 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.client.builder.AdvancedConfig; import com.amazonaws.services.docdbelastic.AmazonDocDBElasticClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.docdbelastic.model.*; import com.amazonaws.services.docdbelastic.model.transform.*; /** * Client for accessing DocDB Elastic. All service calls made using this client are blocking, and will not return until * the service call completes. *
*
* The new Amazon Elastic DocumentDB service endpoint. *
*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonDocDBElasticClient extends AmazonWebServiceClient implements AmazonDocDBElastic { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AmazonDocDBElastic.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "docdb-elastic"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.ValidationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.ConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.InternalServerExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller( com.amazonaws.services.docdbelastic.model.transform.ThrottlingExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.docdbelastic.model.AmazonDocDBElasticException.class)); public static AmazonDocDBElasticClientBuilder builder() { return AmazonDocDBElasticClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on DocDB Elastic 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. */ AmazonDocDBElasticClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on DocDB Elastic 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. */ AmazonDocDBElasticClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("docdb-elastic.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/docdbelastic/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/docdbelastic/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *
* Creates a new Elastic DocumentDB cluster and returns its Cluster structure. *
* * @param createClusterRequest * @return Result of the CreateCluster operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ServiceQuotaExceededException * The service quota for the action was exceeded. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.CreateCluster * @see AWS * API Documentation */ @Override public CreateClusterResult createCluster(CreateClusterRequest request) { request = beforeClientExecution(request); return executeCreateCluster(request); } @SdkInternalApi final CreateClusterResult executeCreateCluster(CreateClusterRequest createClusterRequest) { ExecutionContext executionContext = createExecutionContext(createClusterRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Creates a snapshot of a cluster. *
* * @param createClusterSnapshotRequest * @return Result of the CreateClusterSnapshot operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ServiceQuotaExceededException * The service quota for the action was exceeded. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.CreateClusterSnapshot * @see AWS API Documentation */ @Override public CreateClusterSnapshotResult createClusterSnapshot(CreateClusterSnapshotRequest request) { request = beforeClientExecution(request); return executeCreateClusterSnapshot(request); } @SdkInternalApi final CreateClusterSnapshotResult executeCreateClusterSnapshot(CreateClusterSnapshotRequest createClusterSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(createClusterSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Delete a Elastic DocumentDB cluster. *
* * @param deleteClusterRequest * @return Result of the DeleteCluster operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.DeleteCluster * @see AWS * API Documentation */ @Override public DeleteClusterResult deleteCluster(DeleteClusterRequest request) { request = beforeClientExecution(request); return executeDeleteCluster(request); } @SdkInternalApi final DeleteClusterResult executeDeleteCluster(DeleteClusterRequest deleteClusterRequest) { ExecutionContext executionContext = createExecutionContext(deleteClusterRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Delete a Elastic DocumentDB snapshot. *
* * @param deleteClusterSnapshotRequest * @return Result of the DeleteClusterSnapshot operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.DeleteClusterSnapshot * @see AWS API Documentation */ @Override public DeleteClusterSnapshotResult deleteClusterSnapshot(DeleteClusterSnapshotRequest request) { request = beforeClientExecution(request); return executeDeleteClusterSnapshot(request); } @SdkInternalApi final DeleteClusterSnapshotResult executeDeleteClusterSnapshot(DeleteClusterSnapshotRequest deleteClusterSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(deleteClusterSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns information about a specific Elastic DocumentDB cluster. *
* * @param getClusterRequest * @return Result of the GetCluster operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.GetCluster * @see AWS API * Documentation */ @Override public GetClusterResult getCluster(GetClusterRequest request) { request = beforeClientExecution(request); return executeGetCluster(request); } @SdkInternalApi final GetClusterResult executeGetCluster(GetClusterRequest getClusterRequest) { ExecutionContext executionContext = createExecutionContext(getClusterRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns information about a specific Elastic DocumentDB snapshot *
* * @param getClusterSnapshotRequest * @return Result of the GetClusterSnapshot operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.GetClusterSnapshot * @see AWS API Documentation */ @Override public GetClusterSnapshotResult getClusterSnapshot(GetClusterSnapshotRequest request) { request = beforeClientExecution(request); return executeGetClusterSnapshot(request); } @SdkInternalApi final GetClusterSnapshotResult executeGetClusterSnapshot(GetClusterSnapshotRequest getClusterSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(getClusterSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns information about Elastic DocumentDB snapshots for a specified cluster. *
* * @param listClusterSnapshotsRequest * @return Result of the ListClusterSnapshots operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.ListClusterSnapshots * @see AWS API Documentation */ @Override public ListClusterSnapshotsResult listClusterSnapshots(ListClusterSnapshotsRequest request) { request = beforeClientExecution(request); return executeListClusterSnapshots(request); } @SdkInternalApi final ListClusterSnapshotsResult executeListClusterSnapshots(ListClusterSnapshotsRequest listClusterSnapshotsRequest) { ExecutionContext executionContext = createExecutionContext(listClusterSnapshotsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns information about provisioned Elastic DocumentDB clusters. *
* * @param listClustersRequest * @return Result of the ListClusters operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.ListClusters * @see AWS API * Documentation */ @Override public ListClustersResult listClusters(ListClustersRequest request) { request = beforeClientExecution(request); return executeListClusters(request); } @SdkInternalApi final ListClustersResult executeListClusters(ListClustersRequest listClustersRequest) { ExecutionContext executionContext = createExecutionContext(listClustersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists all tags on a Elastic DocumentDB resource *
* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @sample AmazonDocDBElastic.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) { request = beforeClientExecution(request); return executeListTagsForResource(request); } @SdkInternalApi final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Restores a Elastic DocumentDB cluster from a snapshot. *
* * @param restoreClusterFromSnapshotRequest * @return Result of the RestoreClusterFromSnapshot operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ServiceQuotaExceededException * The service quota for the action was exceeded. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.RestoreClusterFromSnapshot * @see AWS API Documentation */ @Override public RestoreClusterFromSnapshotResult restoreClusterFromSnapshot(RestoreClusterFromSnapshotRequest request) { request = beforeClientExecution(request); return executeRestoreClusterFromSnapshot(request); } @SdkInternalApi final RestoreClusterFromSnapshotResult executeRestoreClusterFromSnapshot(RestoreClusterFromSnapshotRequest restoreClusterFromSnapshotRequest) { ExecutionContext executionContext = createExecutionContext(restoreClusterFromSnapshotRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Adds metadata tags to a Elastic DocumentDB resource *
* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @sample AmazonDocDBElastic.TagResource * @see AWS API * Documentation */ @Override public TagResourceResult tagResource(TagResourceRequest request) { request = beforeClientExecution(request); return executeTagResource(request); } @SdkInternalApi final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) { ExecutionContext executionContext = createExecutionContext(tagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Removes metadata tags to a Elastic DocumentDB resource *
* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @sample AmazonDocDBElastic.UntagResource * @see AWS * API Documentation */ @Override public UntagResourceResult untagResource(UntagResourceRequest request) { request = beforeClientExecution(request); return executeUntagResource(request); } @SdkInternalApi final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) { ExecutionContext executionContext = createExecutionContext(untagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Modifies a Elastic DocumentDB cluster. This includes updating admin-username/password, upgrading API version * setting up a backup window and maintenance window *
* * @param updateClusterRequest * @return Result of the UpdateCluster operation returned by the service. * @throws ThrottlingException * ThrottlingException will be thrown when request was denied due to request throttling. * @throws ValidationException * A structure defining a validation exception. * @throws ConflictException * There was an access conflict. * @throws InternalServerException * There was an internal server error. * @throws ResourceNotFoundException * The specified resource could not be located. * @throws AccessDeniedException * An exception that occurs when there are not sufficient permissions to perform an action. * @sample AmazonDocDBElastic.UpdateCluster * @see AWS * API Documentation */ @Override public UpdateClusterResult updateCluster(UpdateClusterRequest request) { request = beforeClientExecution(request); return executeUpdateCluster(request); } @SdkInternalApi final UpdateClusterResult executeUpdateCluster(UpdateClusterRequest updateClusterRequest) { ExecutionContext executionContext = createExecutionContext(updateClusterRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request
* 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