Class DBScannerConvertEncryption
java.lang.Object
overit.geocall.basic.bl.encryption.DBScannerConvertEncryption
- All Implemented Interfaces:
DBScanner
This scanner allows to convert the encryption of values storage in the database. It converts only the values inside
the columns specified in the input of the constructor. It uses the
decryptKey to decrypt value and encryptKey
to encrypt value. The two keys can be empty to manage the value in clear, but they must not be null.
If there is an error with one value, all the conversions will be rollback and a SQLException will be thrown.
It uses the ResultSet to looping on the table, so it doesn't load in memory all rows of the table.-
Constructor Summary
ConstructorsConstructorDescriptionDBScannerConvertEncryption(String decryptKey, String encryptKey, List<String> columns) Constructor of this database scanner. -
Method Summary
Modifier and TypeMethodDescriptionbooleanExplicit the needing of the"update"grant to update the ResultSet.voidApplies this function to the given argument.
-
Constructor Details
-
DBScannerConvertEncryption
Constructor of this database scanner.- Parameters:
decryptKey- the key to decrypt the value storage in the database. It could be empty to manage the value in clear, * but it must not benullencryptKey- the key to encrypt the value after the decryption. It could be empty to manage the value in clear, but it must not benullcolumns- theListof strings that defines which columns contains the encrypted values.
-
-
Method Details
-
scan
Description copied from interface:DBScannerApplies this function to the given argument.- Specified by:
scanin interfaceDBScanner- Parameters:
dbc- the cursor opend over the statement- Throws:
SQLException- in case of an sql error
-
isForUpdate
public boolean isForUpdate()Description copied from interface:DBScannerExplicit the needing of the"update"grant to update the ResultSet. The grant is read only of default.- Specified by:
isForUpdatein interfaceDBScanner- Returns:
- if the DBScanner needs the
"update"grant returntrue, otherwisefalse. The default isfalse
-