com.amazonaws.services.cloudhsm.AWSCloudHSMClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudhsm Show documentation
/*
* 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.cloudhsm;
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.cloudhsm.AWSCloudHSMClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.cloudhsm.model.*;
import com.amazonaws.services.cloudhsm.model.transform.*;
/**
* Client for accessing CloudHSM. All service calls made using this client are blocking, and will not return until the
* service call completes.
*
* AWS CloudHSM Service
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS
* CloudHSM, the AWS CloudHSM User Guide, and
* the AWS CloudHSM API Reference.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSCloudHSMClient extends AmazonWebServiceClient implements AWSCloudHSM {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSCloudHSM.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "cloudhsm";
/** 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)
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("CloudHsmInternalException").withExceptionUnmarshaller(
com.amazonaws.services.cloudhsm.model.transform.CloudHsmInternalExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withExceptionUnmarshaller(
com.amazonaws.services.cloudhsm.model.transform.InvalidRequestExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("CloudHsmServiceException").withExceptionUnmarshaller(
com.amazonaws.services.cloudhsm.model.transform.CloudHsmServiceExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.cloudhsm.model.AWSCloudHSMException.class));
/**
* Constructs a new client to invoke service methods on CloudHSM. 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
* @deprecated use {@link AWSCloudHSMClientBuilder#defaultClient()}
*/
@Deprecated
public AWSCloudHSMClient() {
this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on CloudHSM. 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 CloudHSM (ex: proxy settings,
* retry counts, etc.).
*
* @see DefaultAWSCredentialsProviderChain
* @deprecated use {@link AWSCloudHSMClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSCloudHSMClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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.
* @deprecated use {@link AWSCloudHSMClientBuilder#withCredentials(AWSCredentialsProvider)} for example:
* {@code AWSCloudHSMClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();}
*/
@Deprecated
public AWSCloudHSMClient(AWSCredentials awsCredentials) {
this(awsCredentials, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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 CloudHSM (ex: proxy settings,
* retry counts, etc.).
* @deprecated use {@link AWSCloudHSMClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSCloudHSMClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSCloudHSMClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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.
* @deprecated use {@link AWSCloudHSMClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AWSCloudHSMClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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 CloudHSM (ex: proxy settings,
* retry counts, etc.).
* @deprecated use {@link AWSCloudHSMClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSCloudHSMClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSCloudHSMClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, null);
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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 CloudHSM (ex: proxy settings,
* retry counts, etc.).
* @param requestMetricCollector
* optional request metric collector
* @deprecated use {@link AWSCloudHSMClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSCloudHSMClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AWSCloudHSMClientBuilder#withMetricsCollector(RequestMetricCollector)}
*/
@Deprecated
public AWSCloudHSMClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
public static AWSCloudHSMClientBuilder builder() {
return AWSCloudHSMClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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.
*/
AWSCloudHSMClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on CloudHSM 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.
*/
AWSCloudHSMClient(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("https://cloudhsm.us-east-1.amazonaws.com/");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/cloudhsm/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/cloudhsm/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Adds or overwrites one or more tags for the specified AWS CloudHSM resource.
*
*
* Each tag consists of a key and a value. Tag keys must be unique to each resource.
*
*
* @param addTagsToResourceRequest
* @return Result of the AddTagsToResource operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.AddTagsToResource
* @see AWS API
* Documentation
*/
@Override
public AddTagsToResourceResult addTagsToResource(AddTagsToResourceRequest request) {
request = beforeClientExecution(request);
return executeAddTagsToResource(request);
}
@SdkInternalApi
final AddTagsToResourceResult executeAddTagsToResource(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 AddTagsToResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addTagsToResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddTagsToResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} 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);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Creates a high-availability partition group. A high-availability partition group is a group of partitions that
* spans multiple physical HSMs.
*
*
* @param createHapgRequest
* Contains the inputs for the CreateHapgRequest action.
* @return Result of the CreateHapg operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.CreateHapg
* @see AWS API
* Documentation
*/
@Override
public CreateHapgResult createHapg(CreateHapgRequest request) {
request = beforeClientExecution(request);
return executeCreateHapg(request);
}
@SdkInternalApi
final CreateHapgResult executeCreateHapg(CreateHapgRequest createHapgRequest) {
ExecutionContext executionContext = createExecutionContext(createHapgRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateHapgRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHapgRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHapg");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateHapgResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Creates an uninitialized HSM instance.
*
*
* There is an upfront fee charged for each HSM instance that you create with the CreateHsm
operation.
* If you accidentally provision an HSM and want to request a refund, delete the instance using the DeleteHsm
* operation, go to the AWS Support Center, create a new
* case, and select Account and Billing Support.
*
*
*
* It can take up to 20 minutes to create and provision an HSM. You can monitor the status of the HSM with the
* DescribeHsm operation. The HSM is ready to be initialized when the status changes to RUNNING
.
*
*
*
* @param createHsmRequest
* Contains the inputs for the CreateHsm
operation.
* @return Result of the CreateHsm operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.CreateHsm
* @see AWS API
* Documentation
*/
@Override
public CreateHsmResult createHsm(CreateHsmRequest request) {
request = beforeClientExecution(request);
return executeCreateHsm(request);
}
@SdkInternalApi
final CreateHsmResult executeCreateHsm(CreateHsmRequest createHsmRequest) {
ExecutionContext executionContext = createExecutionContext(createHsmRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHsmRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHsm");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateHsmResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Creates an HSM client.
*
*
* @param createLunaClientRequest
* Contains the inputs for the CreateLunaClient action.
* @return Result of the CreateLunaClient operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.CreateLunaClient
* @see AWS API
* Documentation
*/
@Override
public CreateLunaClientResult createLunaClient(CreateLunaClientRequest request) {
request = beforeClientExecution(request);
return executeCreateLunaClient(request);
}
@SdkInternalApi
final CreateLunaClientResult executeCreateLunaClient(CreateLunaClientRequest createLunaClientRequest) {
ExecutionContext executionContext = createExecutionContext(createLunaClientRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLunaClientRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLunaClient");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLunaClientResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Deletes a high-availability partition group.
*
*
* @param deleteHapgRequest
* Contains the inputs for the DeleteHapg action.
* @return Result of the DeleteHapg operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DeleteHapg
* @see AWS API
* Documentation
*/
@Override
public DeleteHapgResult deleteHapg(DeleteHapgRequest request) {
request = beforeClientExecution(request);
return executeDeleteHapg(request);
}
@SdkInternalApi
final DeleteHapgResult executeDeleteHapg(DeleteHapgRequest deleteHapgRequest) {
ExecutionContext executionContext = createExecutionContext(deleteHapgRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteHapgRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteHapgRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteHapg");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteHapgResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Deletes an HSM. After completion, this operation cannot be undone and your key material cannot be recovered.
*
*
* @param deleteHsmRequest
* Contains the inputs for the DeleteHsm operation.
* @return Result of the DeleteHsm operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DeleteHsm
* @see AWS API
* Documentation
*/
@Override
public DeleteHsmResult deleteHsm(DeleteHsmRequest request) {
request = beforeClientExecution(request);
return executeDeleteHsm(request);
}
@SdkInternalApi
final DeleteHsmResult executeDeleteHsm(DeleteHsmRequest deleteHsmRequest) {
ExecutionContext executionContext = createExecutionContext(deleteHsmRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteHsmRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteHsm");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteHsmResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Deletes a client.
*
*
* @param deleteLunaClientRequest
* @return Result of the DeleteLunaClient operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DeleteLunaClient
* @see AWS API
* Documentation
*/
@Override
public DeleteLunaClientResult deleteLunaClient(DeleteLunaClientRequest request) {
request = beforeClientExecution(request);
return executeDeleteLunaClient(request);
}
@SdkInternalApi
final DeleteLunaClientResult executeDeleteLunaClient(DeleteLunaClientRequest deleteLunaClientRequest) {
ExecutionContext executionContext = createExecutionContext(deleteLunaClientRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLunaClientRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLunaClient");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLunaClientResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Retrieves information about a high-availability partition group.
*
*
* @param describeHapgRequest
* Contains the inputs for the DescribeHapg action.
* @return Result of the DescribeHapg operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DescribeHapg
* @see AWS API
* Documentation
*/
@Override
public DescribeHapgResult describeHapg(DescribeHapgRequest request) {
request = beforeClientExecution(request);
return executeDescribeHapg(request);
}
@SdkInternalApi
final DescribeHapgResult executeDescribeHapg(DescribeHapgRequest describeHapgRequest) {
ExecutionContext executionContext = createExecutionContext(describeHapgRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeHapgRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeHapgRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeHapg");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeHapgResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Retrieves information about an HSM. You can identify the HSM by its ARN or its serial number.
*
*
* @param describeHsmRequest
* Contains the inputs for the DescribeHsm operation.
* @return Result of the DescribeHsm operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DescribeHsm
* @see AWS API
* Documentation
*/
@Override
public DescribeHsmResult describeHsm(DescribeHsmRequest request) {
request = beforeClientExecution(request);
return executeDescribeHsm(request);
}
@SdkInternalApi
final DescribeHsmResult executeDescribeHsm(DescribeHsmRequest describeHsmRequest) {
ExecutionContext executionContext = createExecutionContext(describeHsmRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeHsmRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeHsm");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeHsmResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public DescribeHsmResult describeHsm() {
return describeHsm(new DescribeHsmRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Retrieves information about an HSM client.
*
*
* @param describeLunaClientRequest
* @return Result of the DescribeLunaClient operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.DescribeLunaClient
* @see AWS
* API Documentation
*/
@Override
public DescribeLunaClientResult describeLunaClient(DescribeLunaClientRequest request) {
request = beforeClientExecution(request);
return executeDescribeLunaClient(request);
}
@SdkInternalApi
final DescribeLunaClientResult executeDescribeLunaClient(DescribeLunaClientRequest describeLunaClientRequest) {
ExecutionContext executionContext = createExecutionContext(describeLunaClientRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLunaClientRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLunaClient");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLunaClientResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public DescribeLunaClientResult describeLunaClient() {
return describeLunaClient(new DescribeLunaClientRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Gets the configuration files necessary to connect to all high availability partition groups the client is
* associated with.
*
*
* @param getConfigRequest
* @return Result of the GetConfig operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.GetConfig
* @see AWS API
* Documentation
*/
@Override
public GetConfigResult getConfig(GetConfigRequest request) {
request = beforeClientExecution(request);
return executeGetConfig(request);
}
@SdkInternalApi
final GetConfigResult executeGetConfig(GetConfigRequest getConfigRequest) {
ExecutionContext executionContext = createExecutionContext(getConfigRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getConfigRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetConfig");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetConfigResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Lists the Availability Zones that have available AWS CloudHSM capacity.
*
*
* @param listAvailableZonesRequest
* Contains the inputs for the ListAvailableZones action.
* @return Result of the ListAvailableZones operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ListAvailableZones
* @see AWS
* API Documentation
*/
@Override
public ListAvailableZonesResult listAvailableZones(ListAvailableZonesRequest request) {
request = beforeClientExecution(request);
return executeListAvailableZones(request);
}
@SdkInternalApi
final ListAvailableZonesResult executeListAvailableZones(ListAvailableZonesRequest listAvailableZonesRequest) {
ExecutionContext executionContext = createExecutionContext(listAvailableZonesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAvailableZonesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAvailableZonesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAvailableZones");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAvailableZonesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public ListAvailableZonesResult listAvailableZones() {
return listAvailableZones(new ListAvailableZonesRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Lists the high-availability partition groups for the account.
*
*
* This operation supports pagination with the use of the NextToken
member. If more results are
* available, the NextToken
member of the response contains a token that you pass in the next call to
* ListHapgs
to retrieve the next set of items.
*
*
* @param listHapgsRequest
* @return Result of the ListHapgs operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ListHapgs
* @see AWS API
* Documentation
*/
@Override
public ListHapgsResult listHapgs(ListHapgsRequest request) {
request = beforeClientExecution(request);
return executeListHapgs(request);
}
@SdkInternalApi
final ListHapgsResult executeListHapgs(ListHapgsRequest listHapgsRequest) {
ExecutionContext executionContext = createExecutionContext(listHapgsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListHapgsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listHapgsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListHapgs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListHapgsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public ListHapgsResult listHapgs() {
return listHapgs(new ListHapgsRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Retrieves the identifiers of all of the HSMs provisioned for the current customer.
*
*
* This operation supports pagination with the use of the NextToken
member. If more results are
* available, the NextToken
member of the response contains a token that you pass in the next call to
* ListHsms
to retrieve the next set of items.
*
*
* @param listHsmsRequest
* @return Result of the ListHsms operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ListHsms
* @see AWS API
* Documentation
*/
@Override
public ListHsmsResult listHsms(ListHsmsRequest request) {
request = beforeClientExecution(request);
return executeListHsms(request);
}
@SdkInternalApi
final ListHsmsResult executeListHsms(ListHsmsRequest listHsmsRequest) {
ExecutionContext executionContext = createExecutionContext(listHsmsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListHsmsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listHsmsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListHsms");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListHsmsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public ListHsmsResult listHsms() {
return listHsms(new ListHsmsRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Lists all of the clients.
*
*
* This operation supports pagination with the use of the NextToken
member. If more results are
* available, the NextToken
member of the response contains a token that you pass in the next call to
* ListLunaClients
to retrieve the next set of items.
*
*
* @param listLunaClientsRequest
* @return Result of the ListLunaClients operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ListLunaClients
* @see AWS API
* Documentation
*/
@Override
public ListLunaClientsResult listLunaClients(ListLunaClientsRequest request) {
request = beforeClientExecution(request);
return executeListLunaClients(request);
}
@SdkInternalApi
final ListLunaClientsResult executeListLunaClients(ListLunaClientsRequest listLunaClientsRequest) {
ExecutionContext executionContext = createExecutionContext(listLunaClientsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListLunaClientsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLunaClientsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLunaClients");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLunaClientsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
@Override
public ListLunaClientsResult listLunaClients() {
return listLunaClients(new ListLunaClientsRequest());
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Returns a list of all tags for the specified AWS CloudHSM resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.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 request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} 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);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Modifies an existing high-availability partition group.
*
*
* @param modifyHapgRequest
* @return Result of the ModifyHapg operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ModifyHapg
* @see AWS API
* Documentation
*/
@Override
public ModifyHapgResult modifyHapg(ModifyHapgRequest request) {
request = beforeClientExecution(request);
return executeModifyHapg(request);
}
@SdkInternalApi
final ModifyHapgResult executeModifyHapg(ModifyHapgRequest modifyHapgRequest) {
ExecutionContext executionContext = createExecutionContext(modifyHapgRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ModifyHapgRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyHapgRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyHapg");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyHapgResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Modifies an HSM.
*
*
*
* This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is
* reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is
* configured for high availability, and consider executing this operation during a maintenance window.
*
*
*
* @param modifyHsmRequest
* Contains the inputs for the ModifyHsm operation.
* @return Result of the ModifyHsm operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.ModifyHsm
* @see AWS API
* Documentation
*/
@Override
public ModifyHsmResult modifyHsm(ModifyHsmRequest request) {
request = beforeClientExecution(request);
return executeModifyHsm(request);
}
@SdkInternalApi
final ModifyHsmResult executeModifyHsm(ModifyHsmRequest modifyHsmRequest) {
ExecutionContext executionContext = createExecutionContext(modifyHsmRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ModifyHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyHsmRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyHsm");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyHsmResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Modifies the certificate used by the client.
*
*
* This action can potentially start a workflow to install the new certificate on the client's HSMs.
*
*
* @param modifyLunaClientRequest
* @return Result of the ModifyLunaClient operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @sample AWSCloudHSM.ModifyLunaClient
* @see AWS API
* Documentation
*/
@Override
public ModifyLunaClientResult modifyLunaClient(ModifyLunaClientRequest request) {
request = beforeClientExecution(request);
return executeModifyLunaClient(request);
}
@SdkInternalApi
final ModifyLunaClientResult executeModifyLunaClient(ModifyLunaClientRequest modifyLunaClientRequest) {
ExecutionContext executionContext = createExecutionContext(modifyLunaClientRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ModifyLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyLunaClientRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyLunaClient");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyLunaClientResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.
*
*
* For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.
*
*
* Removes one or more tags from the specified AWS CloudHSM resource.
*
*
* To remove a tag, specify only the tag key to remove (not the value). To overwrite the value for an existing tag,
* use AddTagsToResource.
*
*
* @param removeTagsFromResourceRequest
* @return Result of the RemoveTagsFromResource operation returned by the service.
* @throws CloudHsmServiceException
* Indicates that an exception occurred in the AWS CloudHSM service.
* @throws CloudHsmInternalException
* Indicates that an internal error occurred.
* @throws InvalidRequestException
* Indicates that one or more of the request parameters are not valid.
* @sample AWSCloudHSM.RemoveTagsFromResource
* @see AWS API Documentation
*/
@Override
public RemoveTagsFromResourceResult removeTagsFromResource(RemoveTagsFromResourceRequest request) {
request = beforeClientExecution(request);
return executeRemoveTagsFromResource(request);
}
@SdkInternalApi
final RemoveTagsFromResourceResult executeRemoveTagsFromResource(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 RemoveTagsFromResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(removeTagsFromResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveTagsFromResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} 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);
}
}
/**
* 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) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* 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, null, null);
}
/**
* 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, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
@Override
public void shutdown() {
super.shutdown();
}
}