public class EncryptionException
extends java.sql.SQLException
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DECRYPTION_FAILED_STATE |
static java.lang.String |
ENCRYPTION_FAILED_STATE |
static java.lang.String |
INVALID_ALGORITHM_STATE |
static java.lang.String |
INVALID_KEY_STATE |
static java.lang.String |
TYPE_CONVERSION_FAILED_STATE |
| Constructor and Description |
|---|
EncryptionException(java.lang.String message)
Constructs an EncryptionException with the specified detail message.
|
EncryptionException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
Constructs an EncryptionException with the specified detail message, SQL state and cause.
|
EncryptionException(java.lang.String message,
java.lang.Throwable cause)
Constructs an EncryptionException with the specified detail message and cause.
|
EncryptionException(java.lang.Throwable cause)
Constructs an EncryptionException with the specified cause.
|
| Modifier and Type | Method and Description |
|---|---|
static EncryptionException |
decryptionFailed(java.lang.String message,
java.lang.Throwable cause)
Creates an EncryptionException for decryption failures.
|
static EncryptionException |
encryptionFailed(java.lang.String message,
java.lang.Throwable cause)
Creates an EncryptionException for encryption failures.
|
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 EncryptionException |
invalidAlgorithm(java.lang.String algorithm)
Creates an EncryptionException for invalid algorithm errors.
|
static EncryptionException |
invalidKey(java.lang.String message)
Creates an EncryptionException for invalid key errors.
|
static EncryptionException |
typeConversionFailed(java.lang.String fromType,
java.lang.String toType,
java.lang.Throwable cause)
Creates an EncryptionException for type conversion errors.
|
EncryptionException |
withAlgorithm(java.lang.String algorithm)
Adds algorithm to the error context.
|
EncryptionException |
withColumn(java.lang.String columnName)
Adds column name to the error context.
|
EncryptionException |
withContext(java.lang.String key,
java.lang.Object value)
Adds context information to the exception.
|
EncryptionException |
withDataType(java.lang.String dataType)
Adds data type to the error context.
|
EncryptionException |
withOperation(java.lang.String operation)
Adds operation type to the error context.
|
EncryptionException |
withTable(java.lang.String tableName)
Adds table name 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 ENCRYPTION_FAILED_STATE
public static final java.lang.String DECRYPTION_FAILED_STATE
public static final java.lang.String INVALID_ALGORITHM_STATE
public static final java.lang.String INVALID_KEY_STATE
public static final java.lang.String TYPE_CONVERSION_FAILED_STATE
public EncryptionException(java.lang.String message)
message - the detail messagepublic EncryptionException(java.lang.String message,
java.lang.Throwable cause)
message - the detail messagecause - the cause of this exceptionpublic EncryptionException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause)
message - the detail messagesqlState - the SQL statecause - the cause of this exceptionpublic EncryptionException(java.lang.Throwable cause)
cause - the cause of this exceptionpublic EncryptionException withContext(java.lang.String key, java.lang.Object value)
key - the context keyvalue - the context valuepublic EncryptionException withTable(java.lang.String tableName)
tableName - the table namepublic EncryptionException withColumn(java.lang.String columnName)
columnName - the column namepublic EncryptionException withAlgorithm(java.lang.String algorithm)
algorithm - the encryption algorithmpublic EncryptionException withDataType(java.lang.String dataType)
dataType - the data type being processedpublic EncryptionException withOperation(java.lang.String operation)
operation - the operation being performedpublic java.util.Map<java.lang.String,java.lang.Object> getErrorContext()
public java.lang.String getDetailedMessage()
public static EncryptionException encryptionFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static EncryptionException decryptionFailed(java.lang.String message, java.lang.Throwable cause)
message - Error messagecause - Root causepublic static EncryptionException invalidAlgorithm(java.lang.String algorithm)
algorithm - Invalid algorithm namepublic static EncryptionException invalidKey(java.lang.String message)
message - Error messagepublic static EncryptionException typeConversionFailed(java.lang.String fromType, java.lang.String toType, java.lang.Throwable cause)
fromType - Source typetoType - Target typecause - Root cause