public class KeyManagementException
extends java.sql.SQLException
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INVALID_KEY_METADATA_STATE |
static java.lang.String |
KEY_CREATION_FAILED_STATE |
static java.lang.String |
KEY_DECRYPTION_FAILED_STATE |
static java.lang.String |
KEY_RETRIEVAL_FAILED_STATE |
static java.lang.String |
KEY_STORAGE_FAILED_STATE |
static java.lang.String |
KMS_CONNECTION_FAILED_STATE |
| Constructor and Description |
|---|
KeyManagementException(java.lang.String message)
Constructs a KeyManagementException with the specified detail message.
|
KeyManagementException(java.lang.String message,
java.lang.String sqlState,
int vendorCode)
Constructs a KeyManagementException with the specified detail message, SQL state, and vendor
code.
|
KeyManagementException(java.lang.String message,
java.lang.String sqlState,
int vendorCode,
java.lang.Throwable cause)
Constructs a KeyManagementException with the specified detail message, SQL state, vendor code,
and cause.
|
KeyManagementException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
Constructs a KeyManagementException with the specified detail message, SQL state and cause.
|
KeyManagementException(java.lang.String message,
java.lang.Throwable cause)
Constructs a KeyManagementException with the specified detail message and cause.
|
KeyManagementException(java.lang.Throwable cause)
Constructs a KeyManagementException with the specified cause.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDetailedMessage()
Gets a formatted error message including context information.
|
java.util.Map<java.lang.String,java.lang.Object> |
getErrorContext()
Gets the error context map.
|
static KeyManagementException |
invalidKeyMetadata(java.lang.String message)
Creates a KeyManagementException for invalid key metadata.
|
static KeyManagementException |
keyCreationFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a KeyManagementException for key creation failures.
|
static KeyManagementException |
keyDecryptionFailed(java.lang.String keyId,
java.lang.String masterKeyArn,
java.lang.Throwable cause)
Creates a KeyManagementException for key decryption failures.
|
static KeyManagementException |
keyStorageFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a KeyManagementException for key storage failures.
|
static KeyManagementException |
kmsConnectionFailed(java.lang.String message,
java.lang.Throwable cause)
Creates a KeyManagementException for KMS connection failures.
|
KeyManagementException |
withContext(java.lang.String key,
java.lang.Object value)
Adds context information to the exception.
|
KeyManagementException |
withKeyId(java.lang.String keyId)
Adds key ID to the error context (sanitized).
|
KeyManagementException |
withMasterKeyArn(java.lang.String masterKeyArn)
Adds master key ARN to the error context (sanitized).
|
KeyManagementException |
withOperation(java.lang.String operation)
Adds operation type to the error context.
|
KeyManagementException |
withRetryInfo(int attempt,
int maxAttempts)
Adds retry attempt information to the error context.
|
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final java.lang.String KEY_CREATION_FAILED_STATE
public static final java.lang.String KEY_RETRIEVAL_FAILED_STATE
public static final java.lang.String KEY_DECRYPTION_FAILED_STATE
public static final java.lang.String KEY_STORAGE_FAILED_STATE
public static final java.lang.String KMS_CONNECTION_FAILED_STATE
public static final java.lang.String INVALID_KEY_METADATA_STATE
public KeyManagementException(java.lang.String message)
message - the detail messagepublic KeyManagementException(java.lang.String message,
java.lang.Throwable cause)
message - the detail messagecause - the cause of this exceptionpublic KeyManagementException(java.lang.Throwable cause)
cause - the cause of this exceptionpublic KeyManagementException(java.lang.String message,
java.lang.String sqlState,
int vendorCode)
message - the detail messagesqlState - the SQL statevendorCode - the vendor-specific error codepublic KeyManagementException(java.lang.String message,
java.lang.String sqlState,
int vendorCode,
java.lang.Throwable cause)
message - the detail messagesqlState - the SQL statevendorCode - the vendor-specific error codecause - the cause of this exceptionpublic KeyManagementException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
message - the detail messagesqlState - the SQL statecause - the cause of this exceptionpublic KeyManagementException withContext(java.lang.String key, java.lang.Object value)
key - the context keyvalue - the context valuepublic KeyManagementException withKeyId(java.lang.String keyId)
keyId - the key IDpublic KeyManagementException withMasterKeyArn(java.lang.String masterKeyArn)
masterKeyArn - the master key ARNpublic KeyManagementException withOperation(java.lang.String operation)
operation - the operation being performedpublic KeyManagementException withRetryInfo(int attempt, int maxAttempts)
attempt - the current attempt numbermaxAttempts - the maximum number of attemptspublic java.util.Map<java.lang.String,java.lang.Object> getErrorContext()
public java.lang.String getDetailedMessage()
public static KeyManagementException keyCreationFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static KeyManagementException keyDecryptionFailed(java.lang.String keyId, java.lang.String masterKeyArn, java.lang.Throwable cause)
keyId - Key IDmasterKeyArn - Master key ARNcause - Root causepublic static KeyManagementException keyStorageFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static KeyManagementException kmsConnectionFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static KeyManagementException invalidKeyMetadata(java.lang.String message)
message - Error message