public class MaskStrings extends Object implements ColumnMapper
ColumnMapper implementation that ensures that string values are masked.
Based on the constructor different masking methods could be used.| Modifier and Type | Class and Description |
|---|---|
protected static class |
MaskStrings.HashValueConverter |
protected static class |
MaskStrings.MaskingValueConverter |
| Modifier and Type | Field and Description |
|---|---|
private Function<Column,ValueConverter> |
converterFromColumn |
| Constructor and Description |
|---|
MaskStrings(byte[] salt,
String hashAlgorithm)
Create a
ColumnMapper that masks string values by hashing the input value. |
MaskStrings(String maskValue)
Create a
ColumnMapper that masks string values with a predefined value. |
| Modifier and Type | Method and Description |
|---|---|
void |
alterFieldSchema(Column column,
org.apache.kafka.connect.data.SchemaBuilder schemaBuilder)
Optionally annotate the schema with properties to better capture the mapping behavior.
|
ValueConverter |
create(Column column)
Create for the given column a function that maps values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeprivate final Function<Column,ValueConverter> converterFromColumn
public MaskStrings(String maskValue)
ColumnMapper that masks string values with a predefined value.maskValue - the value that should be used in place of the actual value; may not be nullIllegalArgumentException - if the is nullpublic MaskStrings(byte[] salt,
String hashAlgorithm)
ColumnMapper that masks string values by hashing the input value.
The hash is automatically shortened to the length of the column.salt - the salt that is used within the hash functionhashAlgorithm - the hash function that is used to mask the columns string values written in source records;
must be on of Java Cryptography Architecture Standard Algorithm MessageDigest.IllegalArgumentException - if the or are nullpublic ValueConverter create(Column column)
ColumnMappercreate in interface ColumnMappercolumn - the column description; never nullpublic void alterFieldSchema(Column column, org.apache.kafka.connect.data.SchemaBuilder schemaBuilder)
ColumnMapperalterFieldSchema in interface ColumnMappercolumn - the column definition; never nullschemaBuilder - the builder for the Field's schema; never nullCopyright © 2021 JBoss by Red Hat. All rights reserved.