Class ReplicaOfflineMsg

All Implemented Interfaces:
Comparable<UpdateMsg>

public final class ReplicaOfflineMsg extends UpdateMsg
Class that define messages sent by a replica (DS) to the replication server (RS) to let the RS know the date at which a replica went offline.
  • Constructor Details

    • ReplicaOfflineMsg

      public ReplicaOfflineMsg(CSN offlineCSN)
      Constructor of a replica offline message providing the offline timestamp in a CSN.
      Parameters:
      offlineCSN - the provided offline CSN
    • ReplicaOfflineMsg

      public ReplicaOfflineMsg(byte[] in) throws DataFormatException
      Creates a message by deserializing it from the provided byte array.
      Parameters:
      in - The provided byte array.
      Throws:
      DataFormatException - When an error occurs during decoding .
  • Method Details

    • getBytes

      public byte[] getBytes(short protocolVersion)
      Description copied from class: ReplicationMsg
      Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.
      Specified by:
      getBytes in class UpdateMsg
      Parameters:
      protocolVersion - The protocol version to use for serialization. The version should normally be older than the current one.
      Returns:
      The encoded PDU, or null if the message isn't supported in that protocol version.
    • size

      public int size()
      Description copied from class: UpdateMsg
      Return the number of bytes used by this message.
      Specified by:
      size in class UpdateMsg
      Returns:
      The number of bytes used by this message.
    • accept

      public <E extends Exception> void accept(UpdateMsgVisitor<E> visitor) throws E
      Description copied from class: UpdateMsg
      Applies an UpdateMsgVisitor to this UpdateMsg.
      Specified by:
      accept in class UpdateMsg
      Type Parameters:
      E - The type of the exception thrown by the visitor method if it fails, or NeverThrowsException if the visitor cannot fail.
      Parameters:
      visitor - The message visitor.
      Throws:
      E - If the visitor failed.