public interface ComponentService
Several methods in this interface consume resource references derived from the
GenericReference
class. These references
must be publicly visible properties of the MaskingComponent object using this service
provider, or methods consuming them will fail with
InvalidDependencyException
. This requirement
exists in order to allow the masking engine to discover the dependencies of any MaskingComponent
via reflection.
Modifier and Type | Method and Description |
---|---|
void |
cookJaninoExpression(org.codehaus.janino.ExpressionEvaluator evaluator,
java.lang.String expression)
"Cooks" (reads, scans, parses, and compiles) a one-line Java expression with the given Janino
expression evaluator.
|
org.codehaus.janino.ExpressionEvaluator |
createJaninoExpressionEvaluator()
Creates a Janino expression evaluator.
|
default <U> MaskingAlgorithm<U> |
getAlgorithmByName(AlgorithmInstanceReference reference,
MaskingAlgorithm.MaskingType type)
Get a MaskingAlgorithm object for the algorithm specified by the reference and type.
|
<U> MaskingAlgorithm<U> |
getAlgorithmByName(AlgorithmInstanceReference reference,
MaskingAlgorithm.MaskingType type,
MaskValueMetadata metadata)
Get a MaskingAlgorithm object for the algorithm specified by the reference and type.
|
CryptoService |
getCryptoService(KeyReference reference)
Get a cryptographic service provider that wraps the key assigned to this component.
|
java.lang.String |
getInstanceName()
Get the name of this component instance.
|
JobInfo |
getJobInfo()
Get a JobInfo object, which contains references to the schema, table names, and column names
in a masking rule set.
|
LogService |
getLogService()
Get a Logger object that can be used to log messages.
|
MaskingAlgorithm.MaskingType |
getMaskingTypeForInstanceReference(AlgorithmInstanceReference algorithmReference)
Useful for confirming masking type on algorithms from JSON configuration of chaining
algorithms.
|
MaskValueMetadata |
getMaskValueMetadata()
Retrieve the metadata access interface for the masked field.
|
default SingleOperationTaskInfo |
getSingleOperationTaskInfo()
Returns a SingleOperationTaskInfo object for SingleOperationTask where
SingleOperationTaskInfo is a class to provide the input values/information table wise for
specific SingleOperationTask.
|
java.sql.Connection |
getTargetConnection()
Get a Connection object, through which a DriverSupport Task will execute prepared statements
on the target database.
|
java.io.InputStream |
openInputFile(FileReference fileReference)
Method to open a file resource by URI.
|
java.sql.Connection |
openJdbcConnection(JdbcReference jdbcReference)
Method to open a JDBC resource.
|
java.sql.Connection |
openMappingConnection(MappingSetReference mappingSetReference)
Method to open a connection to mapping database.
|
java.lang.String getInstanceName()
java.io.InputStream openInputFile(@Nonnull FileReference fileReference)
fileReference
- A reference to the file to be opened.java.sql.Connection openJdbcConnection(@Nonnull JdbcReference jdbcReference)
Connection
remains valid for the life
of the calling MaskingAlgorithm object, but may be closed be when no longer needed to free
resources.jdbcReference
- A JdbcReference
object to provide the jdbc connection
information.Connection
object.java.sql.Connection openMappingConnection(@Nonnull MappingSetReference mappingSetReference)
mappingSetReference
- A MappingSetReference
object which provides all the needed
information to establish the connection.Connection
object.default <U> MaskingAlgorithm<U> getAlgorithmByName(@Nonnull AlgorithmInstanceReference reference, @Nonnull MaskingAlgorithm.MaskingType type)
MaskingAlgorithm.MaskingMode
value as the caller.U
- The data type masked by the returned algorithm, must exactly match what is
requested in typereference
- A reference describing the algorithm instance to gettype
- The masking data type the named algorithm is expected mask<U> MaskingAlgorithm<U> getAlgorithmByName(@Nonnull AlgorithmInstanceReference reference, @Nonnull MaskingAlgorithm.MaskingType type, @Nonnull MaskValueMetadata metadata)
MaskingAlgorithm.MaskingMode
value as the caller.U
- The data type masked by the returned algorithm, must exactly match what is
requested in typereference
- A reference describing the algorithm instance to gettype
- The masking data type the named algorithm is expected maskmetadata
- The mask value metadata for the values that will be passed to the instance
being createdMaskingAlgorithm.MaskingType getMaskingTypeForInstanceReference(@Nonnull AlgorithmInstanceReference algorithmReference)
algorithmReference
- The reference to the algorithm instance from which to get the
masking type.CryptoService getCryptoService(KeyReference reference)
reference
- A reference to the key to use. Currently, the reference value must be "",
referring to the default algorithm key assigned to this algorithm.org.codehaus.janino.ExpressionEvaluator createJaninoExpressionEvaluator()
void cookJaninoExpression(org.codehaus.janino.ExpressionEvaluator evaluator, java.lang.String expression) throws java.lang.Exception
evaluator
- The Janino expression evaluator that will cook the expressionexpression
- The expression to be cooked by the Janino expression evaluatorjava.lang.Exception
- If the expression cannot be evaluatedLogService getLogService()
MaskingLogService
object.@Nullable MaskValueMetadata getMaskValueMetadata()
JobInfo getJobInfo()
java.sql.Connection getTargetConnection()
Connection
objectdefault SingleOperationTaskInfo getSingleOperationTaskInfo()
SingleOperationTaskInfo
objectSingleOperationTaskInfo
object (null by default)