@Override
    public ConnectCustomKeyStoreResult connectCustomKeyStore(ConnectCustomKeyStoreRequest request) {
        request = beforeClientExecution(request);
        return executeConnectCustomKeyStore(request);
    }
@ Override public ConnectCustomKeyStoreResult connectCustomKeyStore ( ConnectCustomKeyStoreRequest request ) { request = beforeClientExecution ( request ) ; return executeConnectCustomKeyStore ( request ) ; }
<p>
Connects or reconnects a <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/key-store-overview.html">custom key store</a> to its
associated AWS CloudHSM cluster.
</p>
<p>
The custom key store must be connected before you can create customer master keys (CMKs) in the key store or use
the CMKs it contains. You can disconnect and reconnect a custom key store at any time.
</p>
<p>
To connect a custom key store, its associated AWS CloudHSM cluster must have at least one active HSM. To get the
number of active HSMs in a cluster, use the <a
href="http://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters">DescribeClusters</a>
operation. To add HSMs to the cluster, use the <a
href="http://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm">CreateHsm</a> operation.
</p>
<p>
The connection process can take an extended amount of time to complete; up to 20 minutes. This operation starts
the connection process, but it does not wait for it to complete. When it succeeds, this operation quickly returns
an HTTP 200 response and a JSON object with no properties. However, this response does not indicate that the
custom key store is connected. To get the connection state of the custom key store, use the
<a>DescribeCustomKeyStores</a> operation.
</p>
<p>
During the connection process, AWS KMS finds the AWS CloudHSM cluster that is associated with the custom key
store, creates the connection infrastructure, connects to the cluster, logs into the AWS CloudHSM client as the
<a href="http://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser">
<code>kmsuser</code> crypto user</a> (CU), and rotates its password.
</p>
<p>
The <code>ConnectCustomKeyStore</code> operation might fail for various reasons. To find the reason, use the
<a>DescribeCustomKeyStores</a> operation and see the <code>ConnectionErrorCode</code> in the response. For help
interpreting the <code>ConnectionErrorCode</code>, see <a>CustomKeyStoresListEntry</a>.
</p>
<p>
To fix the failure, use the <a>DisconnectCustomKeyStore</a> operation to disconnect the custom key store, correct
the error, use the <a>UpdateCustomKeyStore</a> operation if necessary, and then use
<code>ConnectCustomKeyStore</code> again.
</p>
<p>
If you are having trouble connecting or disconnecting a custom key store, see <a
href="http://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html">Troubleshooting a Custom Key
Store</a> in the <i>AWS Key Management Service Developer Guide</i>.
</p>

@param connectCustomKeyStoreRequest
@return Result of the ConnectCustomKeyStore operation returned by the service.
@throws CloudHsmClusterNotActiveException
The request was rejected because the AWS CloudHSM cluster that is associated with the custom key store is
not active. Initialize and activate the cluster and try the command again. For detailed instructions, see
<a href="http://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html">Getting Started</a>
in the <i>AWS CloudHSM User Guide</i>.
@throws CustomKeyStoreInvalidStateException
The request was rejected because of the <code>ConnectionState</code> of the custom key store. To get the
<code>ConnectionState</code> of a custom key store, use the <a>DescribeCustomKeyStores</a> operation.</p>
<p>
This exception is thrown under the following conditions:
</p>
<ul>
<li>
<p>
You requested the <a>CreateKey</a> or <a>GenerateRandom</a> operation in a custom key store that is not
connected. These operations are valid only when the custom key store <code>ConnectionState</code> is
<code>CONNECTED</code>.
</p>
</li>
<li>
<p>
You requested the <a>UpdateCustomKeyStore</a> or <a>DeleteCustomKeyStore</a> operation on a custom key
store that is not disconnected. This operation is valid only when the custom key store
<code>ConnectionState</code> is <code>DISCONNECTED</code>.
</p>
</li>
<li>
<p>
You requested the <a>ConnectCustomKeyStore</a> operation on a custom key store with a
<code>ConnectionState</code> of <code>DISCONNECTING</code> or <code>FAILED</code>. This operation is
valid for all other <code>ConnectionState</code> values.
</p>
</li>
@throws CustomKeyStoreNotFoundException
The request was rejected because AWS KMS cannot find a custom key store with the specified key store name
or ID.
@throws KMSInternalException
The request was rejected because an internal exception occurred. The request can be retried.
@throws CloudHsmClusterInvalidConfigurationException
The request was rejected because the associated AWS CloudHSM cluster did not meet the configuration
requirements for a custom key store. The cluster must be configured with private subnets in at least two
different Availability Zones in the Region. Also, it must contain at least as many HSMs as the operation
requires.</p>
<p>
For the <a>CreateCustomKeyStore</a>, <a>UpdateCustomKeyStore</a>, and <a>CreateKey</a> operations, the
AWS CloudHSM cluster must have at least two active HSMs, each in a different Availability Zone. For the
<a>ConnectCustomKeyStore</a> operation, the AWS CloudHSM must contain at least one active HSM.
</p>
<p>
For information about creating a private subnet for a AWS CloudHSM cluster, see <a
href="http://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html">Create a Private
Subnet</a> in the <i>AWS CloudHSM User Guide</i>. To add HSMs, use the AWS CloudHSM <a
href="http://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html">CreateHsm</a>
operation.
@sample AWSKMS.ConnectCustomKeyStore
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ConnectCustomKeyStore" target="_top">AWS API
Documentation</a>