Record Class HistoricalAttributeValue

java.lang.Object
java.lang.Record
org.opends.server.replication.plugin.HistoricalAttributeValue
Record Components:
attributeDescription - the attribute description of this HistVal. Can be null if the HistVal was generated for an ADD Operation
operation - the type of historical operation on the entry
csn - the CSN of this HistVal
histKey - the type modification (add/repl/delete) on an attribute value. Only meaningful when operation is equal to HistoricalAttributeValue.HistOperation.ATTRIBUTE_MODIFICATION.
attributeValue - the attribute value added/replaced/deleted. Only meaningful when operation is equal to HistoricalAttributeValue.HistOperation.ATTRIBUTE_MODIFICATION.

public record HistoricalAttributeValue(AttributeDescription attributeDescription, HistoricalAttributeValue.HistOperation operation, Csn csn, HistAttrModificationKey histKey, ByteString attributeValue) extends Record
Encodes a single ds-sync-hist attribute value of an entry.

This is an internal representation of the operations that happened to an entry during its lifetime.

It encodes/decodes from the String form stored in the DB attribute from/to the internal usable form.

Here are examples of historical attribute values:

  • description:00000108b3a65541000000000001:add:added_value
  • description;FR;France:00000108b3a65541000000000001:add:added_value
  • description:00000108b3a6cbb8000000000001:del:deleted_value
  • description:00000108b3a6cbb8000000000001:repl:new_value
  • description:00000108b3a6cbb8000000000001:attrDel
  • description:00000108b3a65541000000000001:add
  • dn:00000108b3a65541000000000001:add (ADD operation)
  • dn:00000108b3a65541000000000001:moddn (MODIFYDN operation)
So after split:
  1. token[0] will contain the attribute description.
    • Options are stored with the attribute names using ';' as a separator
  2. token[1] will contain the CSN
  3. token[2] will contain the type of historical information
  4. token[3] will contain the attribute value
  • Constructor Details

  • Method Details

    • attributeModification

      public static HistoricalAttributeValue attributeModification(AttributeDescription attrDesc, HistAttrModificationKey histKey, Csn csn, ByteString attributeValue)
      Returns a ds-sync-hist value encoding a modification that adds/replaces with/deletes an attribute value.
      Returns:
      a ds-sync-hist value encoding a modification that adds/replaces with/deletes an attribute value
    • histKey

      public HistAttrModificationKey histKey()
      Returns the value of the histKey record component.
      Returns:
      the value of the histKey record component
    • attributeValue

      public ByteString attributeValue()
      Returns the value of the attributeValue record component.
      Returns:
      the value of the attributeValue record component
    • generateMod

      public Modification generateMod()
      Generate a Modification equivalent to this value of the historical attribute.
      Returns:
      A modification equivalent to this value of the historical attribute.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • attributeDescription

      public AttributeDescription attributeDescription()
      Returns the value of the attributeDescription record component.
      Returns:
      the value of the attributeDescription record component
    • operation

      Returns the value of the operation record component.
      Returns:
      the value of the operation record component
    • csn

      public Csn csn()
      Returns the value of the csn record component.
      Returns:
      the value of the csn record component