public CustomKeyStoresListEntry withConnectionState(ConnectionStateType connectionState) {
        this.connectionState = connectionState.toString();
        return this;
    }
<p>
Indicates whether the custom key store is connected to its backing key store. For an CloudHSM key store, the
<code>ConnectionState</code> indicates whether it is connected to its CloudHSM cluster. For an external key
store, the <code>ConnectionState</code> indicates whether it is connected to the external key store proxy that
communicates with your external key manager.
</p>
<p>
You can create and use KMS keys in your custom key stores only when its <code>ConnectionState</code> is
<code>CONNECTED</code>.
</p>
<p>
The <code>ConnectionState</code> value is <code>DISCONNECTED</code> only if the key store has never been
connected or you use the <a>DisconnectCustomKeyStore</a> operation to disconnect it. If the value is
<code>CONNECTED</code> but you are having trouble using the custom key store, make sure that the backing key
store is reachable and active. For an CloudHSM key store, verify that its associated CloudHSM cluster is active
and contains at least one active HSM. For an external key store, verify that the external key store proxy and
external key manager are connected and enabled.
</p>
<p>
A value of <code>FAILED</code> indicates that an attempt to connect was unsuccessful. The
<code>ConnectionErrorCode</code> field in the response indicates the cause of the failure. For help resolving a
connection failure, see <a
href="https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html">Troubleshooting a custom key
store</a> in the <i>Key Management Service Developer Guide</i>.
</p>

@param connectionState
       Indicates whether the custom key store is connected to its backing key store. For an CloudHSM key store,
       the <code>ConnectionState</code> indicates whether it is connected to its CloudHSM cluster. For an
       external key store, the <code>ConnectionState</code> indicates whether it is connected to the external key
       store proxy that communicates with your external key manager.</p>
       <p>
       You can create and use KMS keys in your custom key stores only when its <code>ConnectionState</code> is
       <code>CONNECTED</code>.
       </p>
       <p>
       The <code>ConnectionState</code> value is <code>DISCONNECTED</code> only if the key store has never been
       connected or you use the <a>DisconnectCustomKeyStore</a> operation to disconnect it. If the value is
       <code>CONNECTED</code> but you are having trouble using the custom key store, make sure that the backing
       key store is reachable and active. For an CloudHSM key store, verify that its associated CloudHSM cluster
       is active and contains at least one active HSM. For an external key store, verify that the external key
       store proxy and external key manager are connected and enabled.
       </p>
       <p>
       A value of <code>FAILED</code> indicates that an attempt to connect was unsuccessful. The
       <code>ConnectionErrorCode</code> field in the response indicates the cause of the failure. For help
       resolving a connection failure, see <a
       href="https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html">Troubleshooting a custom
       key store</a> in the <i>Key Management Service Developer Guide</i>.
@return Returns a reference to this object so that method calls can be chained together.
@see ConnectionStateType
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/CustomKeyStoresListEntry.java