public class KmsEncryptionUtility
extends java.lang.Object
This plugin intercepts JDBC operations to automatically encrypt data before storage and decrypt data upon retrieval based on metadata configuration.
| Constructor and Description |
|---|
KmsEncryptionUtility()
Default constructor for backward compatibility.
|
KmsEncryptionUtility(PluginService pluginService)
Constructor that accepts PluginService for integration with AWS JDBC Wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleans up plugin resources.
|
void |
ensureInitializedWithConnection(java.sql.Connection conn)
Ensures the plugin is initialized with a database connection.
|
EncryptionConfig |
getConfig()
Returns the current configuration.
|
java.lang.String |
getConnectionModeStatus()
Creates a detailed status message about the current connection mode.
|
EncryptionService |
getEncryptionService()
Returns the encryption service.
|
IndependentDataSource |
getIndependentDataSource()
Returns the independent DataSource used by MetadataManager.
|
KeyManager |
getKeyManager()
Returns the key manager.
|
MetadataManager |
getMetadataManager()
Returns the metadata manager.
|
java.lang.String |
getPluginName()
Returns the plugin name for identification.
|
PluginService |
getPluginService()
Returns the plugin service.
|
void |
initialize(java.util.Properties properties)
Initializes the plugin with the provided configuration.
|
boolean |
isClosed()
Checks if the plugin is closed.
|
boolean |
isInitialized()
Checks if the plugin is initialized.
|
boolean |
isUsingIndependentConnections()
Checks if the plugin is using independent connections.
|
void |
logCurrentStatus()
Logs the current connection status and performance metrics.
|
void |
onConnectionClosed(java.sql.Connection conn)
Removes the type registration entry for a connection.
|
void |
setPluginService(PluginService pluginService)
Sets the PluginService instance.
|
public KmsEncryptionUtility(PluginService pluginService)
pluginService - The PluginService instance from AWS JDBC Wrapperpublic KmsEncryptionUtility()
public void setPluginService(PluginService pluginService)
pluginService - The PluginService instance from AWS JDBC Wrapperpublic void initialize(java.util.Properties properties)
throws java.sql.SQLException
properties - Configuration properties for the pluginjava.sql.SQLException - if initialization failspublic void onConnectionClosed(java.sql.Connection conn)
conn - the connection being closedpublic void ensureInitializedWithConnection(java.sql.Connection conn)
throws java.sql.SQLException
conn - the database connection to initialize withjava.sql.SQLException - if the plugin is not initialized or type registration failspublic java.lang.String getPluginName()
public void cleanup()
public EncryptionConfig getConfig()
public MetadataManager getMetadataManager()
public KeyManager getKeyManager()
public EncryptionService getEncryptionService()
public boolean isInitialized()
public boolean isClosed()
public PluginService getPluginService()
public IndependentDataSource getIndependentDataSource()
public boolean isUsingIndependentConnections()
public java.lang.String getConnectionModeStatus()
public void logCurrentStatus()