Record Class UpdateRecord

java.lang.Object
java.lang.Record
org.opends.server.replication.server.changelog.api.UpdateRecord
Record Components:
baseDn - the base DN of the replication domain the message belongs to
updateMsg - the update message
All Implemented Interfaces:
Comparable<UpdateRecord>

public record UpdateRecord(Dn baseDn, UpdateMsg updateMsg) extends Record implements Comparable<UpdateRecord>
Represents an update message with the base DN of the replication domain it belongs to, with support for easy retrieval of the CSN and the replica ID corresponding to the message.
  • Constructor Details

    • UpdateRecord

      public UpdateRecord(Dn baseDn, UpdateMsg updateMsg)
      Creates an instance of a UpdateRecord record class.
      Parameters:
      baseDn - the value for the baseDn record component
      updateMsg - the value for the updateMsg record component
  • Method Details

    • newUpdateRecord

      public static UpdateRecord newUpdateRecord(Dn baseDn, UpdateMsg msg)
      Creates a new update record with the provided base DN and message.
      Parameters:
      baseDn - the base DN of the replication domain the message belongs to
      msg - the update message
      Returns:
      a new update record with the provided base DN and message.
    • getCsn

      public CSN getCsn()
      Returns the CSN of the message.
      Returns:
      the CSN of the message
    • getReplicaId

      public ReplicaId getReplicaId()
      Returns the replica ID of the replica the message belongs to.
      Returns:
      the replica ID of the replica the message belongs to
    • hashCode

      public 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 boolean equals(Object obj)
      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:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • 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
    • compareTo

      public int compareTo(UpdateRecord other)
      Specified by:
      compareTo in interface Comparable<UpdateRecord>
    • baseDn

      public Dn baseDn()
      Returns the value of the baseDn record component.
      Returns:
      the value of the baseDn record component
    • updateMsg

      public UpdateMsg updateMsg()
      Returns the value of the updateMsg record component.
      Returns:
      the value of the updateMsg record component