Custom Cleanse Functions
Implement your own cleanse function by writing a Java module (JAR file).
The following properties are used to customize the configuration of a cleanse function:
Name | Required | Description |
---|---|---|
type
|
Yes | This is the class name of the cleanse function. This also indicates the Name of the S3 bucket where the properties file is located. |
module
|
Yes | Path to the Java module with the cleanse function implementation inside S3 file storage. |
You can also specify any other parameters in the options
section of the
configuration. All these parameters are passed to the cleanse function. The cleanse
function class consists of the following details:
- Implement the cleanse function interface:
public interface ICleanseFunction { List<CleanseOutputs> cleanseValues(List<CleanseInputs> inputs, Map<String,String> securedOptions, Map<String,String> unsecuredOptions) throws CleanseException; }
- Include the default constructor where,
cleanseInputs
- Indicates the input data for the cleanse function, where, oneCleanseInputs
element belongs to one entity to cleanse. The values to cleanse may be obtained by thegetAttributesToCleanse
call. It outputsMap<String,Object>
, where the key is the attribute name and thevalue-is
is the value. Depending on theinputMappings
configuration, the type of the value may be String, List<String>, Map<String, String>, or Map<String, List<String>>.Note: For more information, see Configure cleanse rules.securedOptions
- Indicates the properties specified in the tenant cleanse configuration (under theoptions
section).unsecuredOptions
- Indicates the properties specified in the cleanse rules configuration.
CleanseInput
, the function generates
CleanseOutputs
(to create an instance of the
CleanseOutputs
, use createOutputs
method of the
CleanseInput
object). If the entity cannot be cleansed, you cannot
create the CleanseOutputs
for it. All the generated
CleanseOutputs
are returned by the function.System Properties
Get system properties using a System.getProperty(<property name>)
call using Java code.
JAVA_OPTS
parameter
inside the /opt/tomcat/bin/setenv.sh file.export JAVA_OPTS="$JAVA_OPTS... -DloqateDefaultCountry=USA..."