Class AbstractAnonymizer<K>
- java.lang.Object
-
- org.apache.directory.api.ldap.model.ldif.anonymizer.AbstractAnonymizer<K>
-
- Type Parameters:
K- The type of object being anonymized
- All Implemented Interfaces:
Anonymizer<K>
- Direct Known Subclasses:
BinaryAnonymizer,CaseSensitiveStringAnonymizer,IntegerAnonymizer,StringAnonymizer
public abstract class AbstractAnonymizer<K> extends Object implements Anonymizer<K>
An abstract class implementing the default behavior of an Aninymizer instance- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Anonymizer<K>>attributeAnonymizersThe map of AttributeType'sOID we want to anonymize.protected booleancaseSensitiveA flag set to true if the AttributeType is case sensitiveprotected SchemaManagerschemaManagerThe SchemaManager instance
-
Constructor Summary
Constructors Constructor Description AbstractAnonymizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]computeNewValue(byte[] valBytes)Compute the next byte[] valueprotected StringcomputeNewValue(String valStr)Compute the next String valueMap<Integer,byte[]>getLatestBytesMap()Map<Integer,String>getLatestStringMap()voidsetAnonymizers(Map<String,Anonymizer<K>> attributeAnonymizers)Set the list of existing anonymizersvoidsetLatestBytesMap(Map<Integer,byte[]> latestBytesMap)voidsetLatestStringMap(Map<Integer,String> latestStringMap)voidsetSchemaManager(SchemaManager schemaManager)Inject a SchemaManager instance in this Anonymizer-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.ldif.anonymizer.Anonymizer
anonymize
-
-
-
-
Field Detail
-
schemaManager
protected SchemaManager schemaManager
The SchemaManager instance
-
attributeAnonymizers
protected Map<String,Anonymizer<K>> attributeAnonymizers
The map of AttributeType'sOID we want to anonymize. They are all associated with anonymizers
-
caseSensitive
protected boolean caseSensitive
A flag set to true if the AttributeType is case sensitive
-
-
Method Detail
-
setSchemaManager
public void setSchemaManager(SchemaManager schemaManager)
Inject a SchemaManager instance in this Anonymizer- Specified by:
setSchemaManagerin interfaceAnonymizer<K>- Parameters:
schemaManager- The SchemaManager instance
-
setAnonymizers
public void setAnonymizers(Map<String,Anonymizer<K>> attributeAnonymizers)
Set the list of existing anonymizers- Specified by:
setAnonymizersin interfaceAnonymizer<K>- Parameters:
attributeAnonymizers- The list of existing anonymizers
-
getLatestStringMap
public Map<Integer,String> getLatestStringMap()
- Specified by:
getLatestStringMapin interfaceAnonymizer<K>- Returns:
- The latest String anonymized value map
-
setLatestStringMap
public void setLatestStringMap(Map<Integer,String> latestStringMap)
- Specified by:
setLatestStringMapin interfaceAnonymizer<K>- Parameters:
latestStringMap- The latest String anonymized value map
-
getLatestBytesMap
public Map<Integer,byte[]> getLatestBytesMap()
- Specified by:
getLatestBytesMapin interfaceAnonymizer<K>- Returns:
- The latest byte[] anonymized value map
-
setLatestBytesMap
public void setLatestBytesMap(Map<Integer,byte[]> latestBytesMap)
- Specified by:
setLatestBytesMapin interfaceAnonymizer<K>- Parameters:
latestBytesMap- The latest byte[] anonymized value map
-
computeNewValue
protected String computeNewValue(String valStr)
Compute the next String value- Parameters:
valStr- The original value- Returns:
- The anonymized value
-
computeNewValue
protected byte[] computeNewValue(byte[] valBytes)
Compute the next byte[] value- Parameters:
valBytes- The original value- Returns:
- The anonymized value
-
-