public class LdifAnonymizer extends Object
Constructor and Description |
---|
LdifAnonymizer()
Creates a default instance of LdifAnonymizer.
|
LdifAnonymizer(SchemaManager schemaManager)
Creates a default instance of LdifAnonymizer.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnonAttributeType(AttributeType attributeType)
Add an attributeType that has to be anonymized
|
void |
addAnonAttributeType(AttributeType attributeType,
Anonymizer<?> anonymizer)
Add an attributeType that has to be anonymized, with its associated anonymizer.
|
void |
addNamingContext(String dn)
Add a new NamingContext
|
String |
anonymize(String ldif)
Anonymize a LDIF
|
void |
anonymizeFile(String ldifFile,
Writer writer)
Anonymize a LDIF
|
Map<String,Anonymizer> |
getAttributeAnonymizers() |
Map<Integer,byte[]> |
getLatestBytesMap() |
Map<Integer,String> |
getLatestStringMap() |
Map<Value,Value> |
getValueMap() |
static void |
main(String[] args)
The entry point, when used as a standalone application.
|
void |
removeAnonAttributeType(AttributeType attributeType)
Remove an attributeType that has to be anonymized
|
void |
setAttributeLatestValueMap(AttributeType attributeType,
Map<Integer,?> latestValueMap)
Set the latest value map to a defined anonymizer - if it exists -.
|
void |
setLatestBytesMap(Map<Integer,byte[]> latestBytesMap) |
void |
setLatestStringMap(Map<Integer,String> latestStringMap) |
void |
setOut(PrintStream out)
Set the PrintStream to use to print information about the processing
|
void |
setValueMap(Map<Value,Value> valueMap) |
public LdifAnonymizer()
public LdifAnonymizer(SchemaManager schemaManager)
schemaManager
- The SchemaManager instance we will usepublic void setOut(PrintStream out)
out
- The PrintStream to usepublic void setAttributeLatestValueMap(AttributeType attributeType, Map<Integer,?> latestValueMap)
attributeType
- The AttributeType we are targettinglatestValueMap
- The latest value map for this attributepublic void addAnonAttributeType(AttributeType attributeType) throws LdapException
attributeType
- the AttributeType that has to be anonymizedLdapException
- If the attributeType cannot be addedpublic void addAnonAttributeType(AttributeType attributeType, Anonymizer<?> anonymizer) throws LdapException
attributeType
- the AttributeType that has to be anonymizedanonymizer
- the instance of anonymizer to use with this AttributeTypeLdapException
- If the attributeType cannot be addedpublic void removeAnonAttributeType(AttributeType attributeType)
attributeType
- the AttributeType that we don't want to be anonymizedpublic Map<String,Anonymizer> getAttributeAnonymizers()
public void addNamingContext(String dn) throws LdapInvalidDnException
dn
- The naming context to addLdapInvalidDnException
- if it's an invalid naming contextpublic void anonymizeFile(String ldifFile, Writer writer) throws LdapException, IOException
ldifFile
- The ldif file to anonymizewriter
- The Writer to use to write the resultLdapException
- If we got some LDAP related exceptionIOException
- If we had some issue during some IO operationspublic String anonymize(String ldif) throws LdapException, IOException
ldif
- The ldif content to anonymizeLdapException
- If we got some LDAP related exceptionIOException
- If we had some issue during some IO operationspublic Map<Value,Value> getValueMap()
public void setValueMap(Map<Value,Value> valueMap)
valueMap
- the valueMap to setpublic Map<Integer,String> getLatestStringMap()
public void setLatestStringMap(Map<Integer,String> latestStringMap)
latestStringMap
- the latest String Value Map to setpublic Map<Integer,byte[]> getLatestBytesMap()
public void setLatestBytesMap(Map<Integer,byte[]> latestBytesMap)
latestBytesMap
- the latest byte[] Value Map to setpublic static void main(String[] args) throws IOException, LdapException
args
- Contains the arguments : the file to convert. The anonymized
LDIF will be printed on stdoutIOException
- If we had an issue opening the file to anonymise ot writing the resultLdapException
- If we had some issue while processing the LDAP dataCopyright © 2003–2019 The Apache Software Foundation. All rights reserved.