Class PingResponse

java.lang.Object
io.permazen.kv.raft.msg.Message
io.permazen.kv.raft.msg.PingResponse

public class PingResponse extends Message
Response to a PingRequest.
  • Constructor Details

    • PingResponse

      public PingResponse(int clusterId, String senderId, String recipientId, long term, Timestamp timestamp)
      Constructor.
      Parameters:
      clusterId - cluster ID
      senderId - identity of sender
      recipientId - identity of recipient
      term - sender's current term
      timestamp - request timestamp from the PingRequest
  • Method Details

    • visit

      public void visit(MessageSwitch handler)
      Description copied from class: Message
      Apply the visitor pattern based on this instance's type.
      Specified by:
      visit in class Message
      Parameters:
      handler - target for visit
    • getTimestamp

      public Timestamp getTimestamp()
      Get the ping request timestamp.
      Returns:
      ping request timestamp
    • writeTo

      public void writeTo(ByteBuffer dest, int version)
      Description copied from class: Message
      Serialize this instance into the given buffer.
      Overrides:
      writeTo in class Message
      Parameters:
      dest - destination for encoded data
      version - protocol encoding version number
    • calculateSize

      protected int calculateSize(int version)
      Description copied from class: Message
      Calculate the number of bytes required by writeTo().
      Overrides:
      calculateSize in class Message
      Parameters:
      version - protocol encoding version
      Returns:
      an upper bound on the number of encoded bytes
    • toString

      public String toString()
      Specified by:
      toString in class Message