public class MetadataManager
extends java.lang.Object
| Constructor and Description |
|---|
MetadataManager(java.sql.Connection connection,
EncryptionConfig config) |
MetadataManager(javax.sql.DataSource dataSource,
EncryptionConfig config) |
MetadataManager(PluginService pluginService,
EncryptionConfig config) |
| Modifier and Type | Method and Description |
|---|---|
int |
getCacheSize()
Returns the current size of the metadata cache.
|
ColumnEncryptionConfig |
getColumnConfig(java.lang.String tableName,
java.lang.String columnName)
Retrieves the encryption configuration for a specific column.
|
java.time.Instant |
getLastRefreshTime()
Returns the timestamp of the last cache refresh.
|
void |
initialize()
Initializes the metadata cache by loading all configurations from database.
|
boolean |
isColumnEncrypted(java.lang.String tableName,
java.lang.String columnName)
Checks if a specific column is configured for encryption.
|
java.util.Map<java.lang.String,ColumnEncryptionConfig> |
loadEncryptionMetadata()
Loads encryption metadata from database tables and returns a map of column configurations.
|
void |
refreshMetadata()
Refreshes the metadata cache by reloading from the database.
|
void |
shutdown()
Shuts down the metadata manager and cleans up resources.
|
void |
updateConfig(EncryptionConfig newConfig)
Updates the configuration and adjusts refresh behavior accordingly.
|
public MetadataManager(PluginService pluginService, EncryptionConfig config)
public MetadataManager(javax.sql.DataSource dataSource,
EncryptionConfig config)
public MetadataManager(java.sql.Connection connection,
EncryptionConfig config)
public java.util.Map<java.lang.String,ColumnEncryptionConfig> loadEncryptionMetadata() throws MetadataException
MetadataException - if database operations failpublic void refreshMetadata()
throws MetadataException
MetadataException - if refresh operation failspublic boolean isColumnEncrypted(java.lang.String tableName,
java.lang.String columnName)
throws MetadataException
tableName - the table namecolumnName - the column nameMetadataException - if database operations failpublic ColumnEncryptionConfig getColumnConfig(java.lang.String tableName, java.lang.String columnName) throws MetadataException
tableName - the table namecolumnName - the column nameMetadataException - if database operations failpublic void initialize()
throws MetadataException
MetadataException - if initialization failspublic void updateConfig(EncryptionConfig newConfig)
newConfig - New encryption configurationpublic void shutdown()
public java.time.Instant getLastRefreshTime()
public int getCacheSize()