public class ErrorContext
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
ErrorContext |
algorithm(java.lang.String algorithm)
Adds algorithm to the error context.
|
java.lang.String |
buildDecryptionErrorMessage(java.lang.String baseMessage)
Builds an error message for decryption operations.
|
java.lang.String |
buildEncryptionErrorMessage(java.lang.String baseMessage)
Builds an error message for encryption operations.
|
static ErrorContext |
builder()
Creates a new error context builder.
|
java.lang.String |
buildKeyManagementErrorMessage(java.lang.String baseMessage)
Builds an error message for key management operations.
|
java.lang.String |
buildMessage(java.lang.String baseMessage)
Builds an error message with the provided base message and context.
|
java.lang.String |
buildMetadataErrorMessage(java.lang.String baseMessage)
Builds an error message for metadata operations.
|
ErrorContext |
cacheInfo(java.lang.String cacheType,
boolean cacheHit)
Adds cache information to the error context.
|
ErrorContext |
column(java.lang.String columnName)
Adds column name to the error context.
|
ErrorContext |
columnIndex(int columnIndex)
Adds column index to the error context.
|
ErrorContext |
dataType(java.lang.String dataType)
Adds data type to the error context.
|
java.util.Map<java.lang.String,java.lang.Object> |
getContext()
Gets the context map for external use.
|
ErrorContext |
keyId(java.lang.String keyId)
Adds key ID to the error context.
|
ErrorContext |
masterKeyArn(java.lang.String masterKeyArn)
Adds master key ARN to the error context.
|
ErrorContext |
operation(java.lang.String operation)
Adds operation type to the error context.
|
ErrorContext |
parameterIndex(int parameterIndex)
Adds parameter index to the error context.
|
ErrorContext |
retryAttempt(int attempt,
int maxAttempts)
Adds retry attempt information to the error context.
|
ErrorContext |
sql(java.lang.String sql)
Adds SQL statement to the error context (sanitized).
|
ErrorContext |
table(java.lang.String tableName)
Adds table name to the error context.
|
public static ErrorContext builder()
public ErrorContext table(java.lang.String tableName)
tableName - Table namepublic ErrorContext column(java.lang.String columnName)
columnName - Column namepublic ErrorContext operation(java.lang.String operation)
operation - Operation typepublic ErrorContext keyId(java.lang.String keyId)
keyId - Key IDpublic ErrorContext masterKeyArn(java.lang.String masterKeyArn)
masterKeyArn - Master key ARNpublic ErrorContext algorithm(java.lang.String algorithm)
algorithm - Algorithm namepublic ErrorContext parameterIndex(int parameterIndex)
parameterIndex - Parameter indexpublic ErrorContext columnIndex(int columnIndex)
columnIndex - Column indexpublic ErrorContext sql(java.lang.String sql)
sql - SQL statementpublic ErrorContext dataType(java.lang.String dataType)
dataType - Data typepublic ErrorContext retryAttempt(int attempt, int maxAttempts)
attempt - Current attempt numbermaxAttempts - Maximum number of attemptspublic ErrorContext cacheInfo(java.lang.String cacheType, boolean cacheHit)
cacheType - Type of cachecacheHit - Whether cache was hitpublic java.lang.String buildMessage(java.lang.String baseMessage)
baseMessage - Base error messagepublic java.lang.String buildEncryptionErrorMessage(java.lang.String baseMessage)
baseMessage - Base error messagepublic java.lang.String buildDecryptionErrorMessage(java.lang.String baseMessage)
baseMessage - Base error messagepublic java.lang.String buildKeyManagementErrorMessage(java.lang.String baseMessage)
baseMessage - Base error messagepublic java.lang.String buildMetadataErrorMessage(java.lang.String baseMessage)
baseMessage - Base error messagepublic java.util.Map<java.lang.String,java.lang.Object> getContext()