Class DbConfigurationManagerConstructorParameters<CommonAccessException extends Exception>
java.lang.Object
com.saperion.common.config.manager.DbConfigurationManagerConstructorParameters<CommonAccessException>
- Type Parameters:
CommonAccessException- the common access exception type of the underlyingDataSourceand so of theDbConfigurationManagerto be created.
public final class DbConfigurationManagerConstructorParameters<CommonAccessException extends Exception>
extends Object
The
DbConfigurationManagerConstructorParameters accumulates the parameters for construction of a
DbConfigurationManager and their defaults. See the individual setter-methods for the concrete default values.-
Constructor Summary
ConstructorsConstructorDescriptionDbConfigurationManagerConstructorParameters(DataSource<CommonAccessException, IllegalStateException> dataSource) Creates newDbConfigurationManagerConstructorParameterswith the specifiedDataSourceand all other values set to defaults. -
Method Summary
Modifier and TypeMethodDescriptionReturns theCipherthat should be used to encrypt/decrypt the configuration values.Returns theDataSource.Returns theNotFoundReactionTypethat defines forDbConfigurationManager.get...()-methodsthe behavior if the requested configuration value was not found.Returns the defaultStorageTypethat applies for all get...()-methods ofDbConfigurationManagerthat have noStorageType-parameter or for those that have one called withStorageType.DEFAULT.Returns the root name.Returns the name of the underlying database table to load and store the configuration value to/from.setDefaultNotFoundReactionType(NotFoundReactionType defaultNotFoundReactionType) Sets the defaultNotFoundReactionTypethat defines forDbConfigurationManager.get...()-methodsthe behavior if the requested configuration value was not found.setDefaultStorageType(StorageType defaultStorageType) Sets the defaultStorageTypethat applies for all get...()-methods ofDbConfigurationManagerthat have noStorageType-parameter or for those that have one called withStorageType.DEFAULT.setEncryptionKeys(Cipher cipher, Pair<Key, Key> pairEncryptionKeys) voidsetRootName(HierarchicalName rootName) Sets the root name.setTableName(String tableName) Sets the name of the underlying database table to load and store the configuration value to/from.toString()
-
Constructor Details
-
DbConfigurationManagerConstructorParameters
public DbConfigurationManagerConstructorParameters(DataSource<CommonAccessException, IllegalStateException> dataSource) Creates newDbConfigurationManagerConstructorParameterswith the specifiedDataSourceand all other values set to defaults. See the individual setter-methods for the default values.- Parameters:
dataSource-DataSource
-
-
Method Details
-
getDataSource
Returns theDataSource.- Returns:
- the
DataSource
-
getTableName
Returns the name of the underlying database table to load and store the configuration value to/from.- Returns:
- the name of the underlying database table
-
setTableName
public DbConfigurationManagerConstructorParameters<CommonAccessException> setTableName(String tableName) Sets the name of the underlying database table to load and store the configuration value to/from. The name must not benullor empty and must matchthe regular expression for table names. Defaults to "configuration".- Parameters:
tableName- the name of the underlying database table- Returns:
- this
DbConfigurationManagerConstructorParameters
-
getRootName
Returns the root name. All entry-keys will start with this root name. If the key specified as a method parameter alreadystarts withthe root name it will be used unchanged, else the parameter will beaddedto the root name before use. The root name may benullin which case it has no effects, i.e. all key parameters will be used as provided.- Returns:
- the root name
-
setRootName
Sets the root name. All entry-keys will start with this root name. If the key specified as a method parameter alreadystarts withthe root name it will be used unchanged, else the parameter will beaddedto the root name before use. The root name may benullin which case it has no effects, i.e. all key parameters will be used as provided. Defaults tonull.- Parameters:
rootName- root name
-
getDefaultStorageType
Returns the defaultStorageTypethat applies for all get...()-methods ofDbConfigurationManagerthat have noStorageType-parameter or for those that have one called withStorageType.DEFAULT.- Returns:
- the default
StorageType
-
setDefaultStorageType
public DbConfigurationManagerConstructorParameters<CommonAccessException> setDefaultStorageType(StorageType defaultStorageType) Sets the defaultStorageTypethat applies for all get...()-methods ofDbConfigurationManagerthat have noStorageType-parameter or for those that have one called withStorageType.DEFAULT. The defaultStorageTypemust not benulland must not beStorageType.DEFAULT. Defaults toStorageType.DB_IF_NOTHING_IN_MEMORY.- Parameters:
defaultStorageType- defaultStorageType- Returns:
- this
DbConfigurationManagerConstructorParameters
-
getDefaultNotFoundReactionType
Returns theNotFoundReactionTypethat defines forDbConfigurationManager.get...()-methodsthe behavior if the requested configuration value was not found.- Returns:
- the
NotFoundReactionType
-
setDefaultNotFoundReactionType
public DbConfigurationManagerConstructorParameters<CommonAccessException> setDefaultNotFoundReactionType(NotFoundReactionType defaultNotFoundReactionType) Sets the defaultNotFoundReactionTypethat defines forDbConfigurationManager.get...()-methodsthe behavior if the requested configuration value was not found. The defaultNotFoundReactionTypemust not benull. Defaults toNotFoundReactionType.EXCEPTION.- Parameters:
defaultNotFoundReactionType- defaultNotFoundReactionType- Returns:
- this
DbConfigurationManagerConstructorParameters
-
getCipher
Returns theCipherthat should be used to encrypt/decrypt the configuration values. Returnsnullif encryption/decryption is not active.- Returns:
- the
Cipher
-
getEncryptionKeys
Returns aPairofKeys that should be used to encrypt/decrypt the configuration values. If the encryption algorithm is asymmetric the first is the public key (used for encryption) and the second is the private key (used for decryption). If the encryption algorithm is symmetric both keys are the same instance. * Returnsnullif encryption/decryption is not active. -
setEncryptionKeys
public DbConfigurationManagerConstructorParameters<CommonAccessException> setEncryptionKeys(Cipher cipher, Pair<Key, Key> pairEncryptionKeys) Sets aCipherand aPairofKeys that should be used to encrypt/decrypt the configuration values. Either both (Cipherand aPair) must be valid and suiting to each other or both must benull(to deactivate encryption/decryption). If the encryption algorithm is asymmetric the first must be the public key (used for encryption) and the second must be the private key (used for decryption). If the encryption algorithm is symmetric both keys must be the same instance. Defaults tonull/null.- Parameters:
cipher- theCipherto use ornullpairEncryptionKeys- thePairofKeys to use ornull- Returns:
- this
DbConfigurationManagerConstructorParameters
-
toString
-