Class BinaryAnonymizer

java.lang.Object
org.apache.directory.api.ldap.model.ldif.anonymizer.AbstractAnonymizer<byte[]>
org.apache.directory.api.ldap.model.ldif.anonymizer.BinaryAnonymizer
All Implemented Interfaces:
Anonymizer<byte[]>

public class BinaryAnonymizer extends AbstractAnonymizer<byte[]>
A default anonymizer for attributes that are not HR
Author:
Apache Directory Project
  • Field Details

    • latestBytesMap

      protected Map<Integer,byte[]> latestBytesMap
      The latest anonymized byte[] value map
  • Constructor Details

    • BinaryAnonymizer

      public BinaryAnonymizer()
      Creates a new instance of BinaryAnonymizer.
    • BinaryAnonymizer

      public BinaryAnonymizer(Map<Integer,byte[]> latestBytesMap)
      Creates a new instance of BinaryAnonymizer.
      Parameters:
      latestBytesMap - The map containing the latest value for each length
  • Method Details

    • anonymize

      public Attribute anonymize(Map<Value,Value> valueMap, Set<Value> valueSet, Attribute attribute)
      Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
      Parameters:
      valueMap - The existing map of value to the associated anonymized counterpart
      valueSet - The existing set of anonymized counterpart
      attribute - The attribute to anonymize
      Returns:
      The anonymized attribute
    • getLatestBytesMap

      public Map<Integer,byte[]> getLatestBytesMap()
      Get the map of anonymized byte[] values
      Specified by:
      getLatestBytesMap in interface Anonymizer<byte[]>
      Overrides:
      getLatestBytesMap in class AbstractAnonymizer<byte[]>
      Returns:
      The latest byte[] anonymized value map
    • setLatestBytesMap

      public void setLatestBytesMap(Map<Integer,byte[]> latestBytesMap)
      Set a new map of anynomized binary values
      Specified by:
      setLatestBytesMap in interface Anonymizer<byte[]>
      Overrides:
      setLatestBytesMap in class AbstractAnonymizer<byte[]>
      Parameters:
      latestBytesMap - The latest byte[] anonymized value map