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

software.amazon.awssdk.services.cloudhsm.DefaultCloudHsmClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.cloudhsm;

import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.cloudhsm.model.AddTagsToResourceRequest;
import software.amazon.awssdk.services.cloudhsm.model.AddTagsToResourceResponse;
import software.amazon.awssdk.services.cloudhsm.model.CloudHsmException;
import software.amazon.awssdk.services.cloudhsm.model.CloudHsmInternalException;
import software.amazon.awssdk.services.cloudhsm.model.CloudHsmServiceException;
import software.amazon.awssdk.services.cloudhsm.model.CreateHapgRequest;
import software.amazon.awssdk.services.cloudhsm.model.CreateHapgResponse;
import software.amazon.awssdk.services.cloudhsm.model.CreateHsmRequest;
import software.amazon.awssdk.services.cloudhsm.model.CreateHsmResponse;
import software.amazon.awssdk.services.cloudhsm.model.CreateLunaClientRequest;
import software.amazon.awssdk.services.cloudhsm.model.CreateLunaClientResponse;
import software.amazon.awssdk.services.cloudhsm.model.DeleteHapgRequest;
import software.amazon.awssdk.services.cloudhsm.model.DeleteHapgResponse;
import software.amazon.awssdk.services.cloudhsm.model.DeleteHsmRequest;
import software.amazon.awssdk.services.cloudhsm.model.DeleteHsmResponse;
import software.amazon.awssdk.services.cloudhsm.model.DeleteLunaClientRequest;
import software.amazon.awssdk.services.cloudhsm.model.DeleteLunaClientResponse;
import software.amazon.awssdk.services.cloudhsm.model.DescribeHapgRequest;
import software.amazon.awssdk.services.cloudhsm.model.DescribeHapgResponse;
import software.amazon.awssdk.services.cloudhsm.model.DescribeHsmRequest;
import software.amazon.awssdk.services.cloudhsm.model.DescribeHsmResponse;
import software.amazon.awssdk.services.cloudhsm.model.DescribeLunaClientRequest;
import software.amazon.awssdk.services.cloudhsm.model.DescribeLunaClientResponse;
import software.amazon.awssdk.services.cloudhsm.model.GetConfigRequest;
import software.amazon.awssdk.services.cloudhsm.model.GetConfigResponse;
import software.amazon.awssdk.services.cloudhsm.model.InvalidRequestException;
import software.amazon.awssdk.services.cloudhsm.model.ListAvailableZonesRequest;
import software.amazon.awssdk.services.cloudhsm.model.ListAvailableZonesResponse;
import software.amazon.awssdk.services.cloudhsm.model.ListHapgsRequest;
import software.amazon.awssdk.services.cloudhsm.model.ListHapgsResponse;
import software.amazon.awssdk.services.cloudhsm.model.ListHsmsRequest;
import software.amazon.awssdk.services.cloudhsm.model.ListHsmsResponse;
import software.amazon.awssdk.services.cloudhsm.model.ListLunaClientsRequest;
import software.amazon.awssdk.services.cloudhsm.model.ListLunaClientsResponse;
import software.amazon.awssdk.services.cloudhsm.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.cloudhsm.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.cloudhsm.model.ModifyHapgRequest;
import software.amazon.awssdk.services.cloudhsm.model.ModifyHapgResponse;
import software.amazon.awssdk.services.cloudhsm.model.ModifyHsmRequest;
import software.amazon.awssdk.services.cloudhsm.model.ModifyHsmResponse;
import software.amazon.awssdk.services.cloudhsm.model.ModifyLunaClientRequest;
import software.amazon.awssdk.services.cloudhsm.model.ModifyLunaClientResponse;
import software.amazon.awssdk.services.cloudhsm.model.RemoveTagsFromResourceRequest;
import software.amazon.awssdk.services.cloudhsm.model.RemoveTagsFromResourceResponse;
import software.amazon.awssdk.services.cloudhsm.transform.AddTagsToResourceRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.CreateHapgRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.CreateHsmRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.CreateLunaClientRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DeleteHapgRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DeleteHsmRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DeleteLunaClientRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DescribeHapgRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DescribeHsmRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.DescribeLunaClientRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.GetConfigRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ListAvailableZonesRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ListHapgsRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ListHsmsRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ListLunaClientsRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ModifyHapgRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ModifyHsmRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.ModifyLunaClientRequestMarshaller;
import software.amazon.awssdk.services.cloudhsm.transform.RemoveTagsFromResourceRequestMarshaller;

/**
 * Internal implementation of {@link CloudHsmClient}.
 *
 * @see CloudHsmClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultCloudHsmClient implements CloudHsmClient {
    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultCloudHsmClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.AddTagsToResource * @see AWS API * Documentation */ @Override public AddTagsToResourceResponse addTagsToResource(AddTagsToResourceRequest addTagsToResourceRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AddTagsToResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("AddTagsToResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(addTagsToResourceRequest) .withMarshaller(new AddTagsToResourceRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.CreateHapg * @see AWS API * Documentation */ @Override public CreateHapgResponse createHapg(CreateHapgRequest createHapgRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateHapgResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateHapg").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createHapgRequest) .withMarshaller(new CreateHapgRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.CreateHsm * @see AWS API * Documentation */ @Override public CreateHsmResponse createHsm(CreateHsmRequest createHsmRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateHsmResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateHsm").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createHsmRequest) .withMarshaller(new CreateHsmRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.CreateLunaClient * @see AWS API * Documentation */ @Override public CreateLunaClientResponse createLunaClient(CreateLunaClientRequest createLunaClientRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateLunaClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateLunaClient").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createLunaClientRequest) .withMarshaller(new CreateLunaClientRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DeleteHapg * @see AWS API * Documentation */ @Override public DeleteHapgResponse deleteHapg(DeleteHapgRequest deleteHapgRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteHapgResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteHapg").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteHapgRequest) .withMarshaller(new DeleteHapgRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DeleteHsm * @see AWS API * Documentation */ @Override public DeleteHsmResponse deleteHsm(DeleteHsmRequest deleteHsmRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteHsmResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteHsm").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteHsmRequest) .withMarshaller(new DeleteHsmRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DeleteLunaClient * @see AWS API * Documentation */ @Override public DeleteLunaClientResponse deleteLunaClient(DeleteLunaClientRequest deleteLunaClientRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteLunaClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteLunaClient").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteLunaClientRequest) .withMarshaller(new DeleteLunaClientRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DescribeHapg * @see AWS API * Documentation */ @Override public DescribeHapgResponse describeHapg(DescribeHapgRequest describeHapgRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeHapgResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeHapg").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeHapgRequest) .withMarshaller(new DescribeHapgRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DescribeHsm * @see AWS API * Documentation */ @Override public DescribeHsmResponse describeHsm(DescribeHsmRequest describeHsmRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeHsmResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeHsm").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeHsmRequest) .withMarshaller(new DescribeHsmRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.DescribeLunaClient * @see AWS * API Documentation */ @Override public DescribeLunaClientResponse describeLunaClient(DescribeLunaClientRequest describeLunaClientRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeLunaClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeLunaClient").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeLunaClientRequest) .withMarshaller(new DescribeLunaClientRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.GetConfig * @see AWS API * Documentation */ @Override public GetConfigResponse getConfig(GetConfigRequest getConfigRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetConfig").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getConfigRequest) .withMarshaller(new GetConfigRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ListAvailableZones * @see AWS * API Documentation */ @Override public ListAvailableZonesResponse listAvailableZones(ListAvailableZonesRequest listAvailableZonesRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAvailableZonesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAvailableZones").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listAvailableZonesRequest) .withMarshaller(new ListAvailableZonesRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ListHapgs * @see AWS API * Documentation */ @Override public ListHapgsResponse listHapgs(ListHapgsRequest listHapgsRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListHapgsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListHapgs").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listHapgsRequest) .withMarshaller(new ListHapgsRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ListHsms * @see AWS API * Documentation */ @Override public ListHsmsResponse listHsms(ListHsmsRequest listHsmsRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListHsmsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams().withOperationName("ListHsms") .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withInput(listHsmsRequest) .withMarshaller(new ListHsmsRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ListLunaClients * @see AWS API * Documentation */ @Override public ListLunaClientsResponse listLunaClients(ListLunaClientsRequest listLunaClientsRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListLunaClientsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListLunaClients").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listLunaClientsRequest) .withMarshaller(new ListLunaClientsRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ListTagsForResource * @see AWS * API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ModifyHapg * @see AWS API * Documentation */ @Override public ModifyHapgResponse modifyHapg(ModifyHapgRequest modifyHapgRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ModifyHapgResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ModifyHapg").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(modifyHapgRequest) .withMarshaller(new ModifyHapgRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ModifyHsm * @see AWS API * Documentation */ @Override public ModifyHsmResponse modifyHsm(ModifyHsmRequest modifyHsmRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ModifyHsmResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ModifyHsm").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(modifyHsmRequest) .withMarshaller(new ModifyHsmRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.ModifyLunaClient * @see AWS API * Documentation */ @Override public ModifyLunaClientResponse modifyLunaClient(ModifyLunaClientRequest modifyLunaClientRequest) throws CloudHsmServiceException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ModifyLunaClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ModifyLunaClient").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(modifyLunaClientRequest) .withMarshaller(new ModifyLunaClientRequestMarshaller(protocolFactory))); } /** *

* 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. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CloudHsmException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CloudHsmClient.RemoveTagsFromResource * @see AWS API Documentation */ @Override public RemoveTagsFromResourceResponse removeTagsFromResource(RemoveTagsFromResourceRequest removeTagsFromResourceRequest) throws CloudHsmServiceException, CloudHsmInternalException, InvalidRequestException, AwsServiceException, SdkClientException, CloudHsmException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveTagsFromResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RemoveTagsFromResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(removeTagsFromResourceRequest) .withMarshaller(new RemoveTagsFromResourceRequestMarshaller(protocolFactory))); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(CloudHsmException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("CloudHsmInternalException") .exceptionBuilderSupplier(CloudHsmInternalException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRequestException") .exceptionBuilderSupplier(InvalidRequestException::builder).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CloudHsmServiceException") .exceptionBuilderSupplier(CloudHsmServiceException::builder).build()); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy