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<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 |
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 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) throws LdapException
attributeType - the AttributeType that we don't want to be anonymizedLdapException - If the attributeType cannot be removedpublic 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
ldif - The ldif content to anonymizeLdapException - 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 void setValueMap(Map<Value<?>,Value<?>> valueMap)
valueMap - the valueMap 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 stdoutIOExceptionLdapExceptionCopyright © 2021. All rights reserved.