public class LdifAnonymizer extends Object
| Constructor and Description |
|---|
LdifAnonymizer()
Creates a default instance of LdifAnonymizer.
|
LdifAnonymizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Creates a default instance of LdifAnonymizer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Add an attributeType that has to be anonymized
|
void |
addAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType,
org.apache.directory.api.ldap.model.ldif.anonymizer.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,org.apache.directory.api.ldap.model.ldif.anonymizer.Anonymizer> |
getAttributeAnonymizers() |
Map<Integer,byte[]> |
getLatestBytesMap() |
Map<Integer,String> |
getLatestStringMap() |
Map<org.apache.directory.api.ldap.model.entry.Value<?>,org.apache.directory.api.ldap.model.entry.Value<?>> |
getValueMap() |
static void |
main(String[] args)
The entry point, when used as a standalone application.
|
void |
removeAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Remove an attributeType that has to be anonymized
|
void |
setAttributeLatestValueMap(org.apache.directory.api.ldap.model.schema.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<org.apache.directory.api.ldap.model.entry.Value<?>,org.apache.directory.api.ldap.model.entry.Value<?>> valueMap) |
public LdifAnonymizer()
public LdifAnonymizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
schemaManager - The SchemaManager instance we will usepublic void setOut(PrintStream out)
out - The PrintStream to usepublic void setAttributeLatestValueMap(org.apache.directory.api.ldap.model.schema.AttributeType attributeType,
Map<Integer,?> latestValueMap)
attributeType - The AttributeType we are targettinglatestValueMap - The latest value map for this attributepublic void addAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType - the AttributeType that has to be anonymizedorg.apache.directory.api.ldap.model.exception.LdapException - If the attributeType cannot be addedpublic void addAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType,
org.apache.directory.api.ldap.model.ldif.anonymizer.Anonymizer<?> anonymizer)
throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType - the AttributeType that has to be anonymizedanonymizer - the instance of anonymizer to use with this AttributeTypeorg.apache.directory.api.ldap.model.exception.LdapException - If the attributeType cannot be addedpublic void removeAnonAttributeType(org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
throws org.apache.directory.api.ldap.model.exception.LdapException
attributeType - the AttributeType that we don't want to be anonymizedorg.apache.directory.api.ldap.model.exception.LdapException - If the attributeType cannot be removedpublic Map<String,org.apache.directory.api.ldap.model.ldif.anonymizer.Anonymizer> getAttributeAnonymizers()
public void addNamingContext(String dn) throws org.apache.directory.api.ldap.model.exception.LdapInvalidDnException
dn - The naming context to addorg.apache.directory.api.ldap.model.exception.LdapInvalidDnException - if it's an invalid naming contextpublic void anonymizeFile(String ldifFile, Writer writer) throws org.apache.directory.api.ldap.model.exception.LdapException, IOException
ldif - The ldif content to anonymizeorg.apache.directory.api.ldap.model.exception.LdapException - If we got some LDAP related exceptionIOException - If we had some issue during some IO operationspublic String anonymize(String ldif) throws org.apache.directory.api.ldap.model.exception.LdapException, IOException
ldif - The ldif content to anonymizeorg.apache.directory.api.ldap.model.exception.LdapException - If we got some LDAP related exceptionIOException - If we had some issue during some IO operationspublic Map<org.apache.directory.api.ldap.model.entry.Value<?>,org.apache.directory.api.ldap.model.entry.Value<?>> getValueMap()
public void setValueMap(Map<org.apache.directory.api.ldap.model.entry.Value<?>,org.apache.directory.api.ldap.model.entry.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, org.apache.directory.api.ldap.model.exception.LdapException
args - Contains the arguments : the file to convert. The anonymized
LDIF will be printed on stdoutIOExceptionorg.apache.directory.api.ldap.model.exception.LdapExceptionCopyright © 2009–2016 The Apache Software Foundation. All rights reserved.