Package io.permazen.kv.raft.msg
Class PingResponse
java.lang.Object
io.permazen.kv.raft.msg.Message
io.permazen.kv.raft.msg.PingResponse
Response to a
PingRequest.-
Constructor Summary
ConstructorsConstructorDescriptionPingResponse(int clusterId, String senderId, String recipientId, long term, Timestamp timestamp) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalculateSize(int version) Calculate the number of bytes required bywriteTo().Get the ping request timestamp.toString()voidvisit(MessageSwitch handler) Apply the visitor pattern based on this instance's type.voidwriteTo(ByteBuffer dest, int version) Serialize this instance into the given buffer.Methods inherited from class io.permazen.kv.raft.msg.Message
calculateSize, calculateSize, calculateSize, decode, decodeProtocolVersion, encode, getBoolean, getByteBuffer, getClusterId, getCurrentProtocolVersion, getRecipientId, getSenderId, getString, getTerm, getTimestamp, isLeaderMessage, putBoolean, putByteBuffer, putString, putTimestamp
-
Constructor Details
-
PingResponse
public PingResponse(int clusterId, String senderId, String recipientId, long term, Timestamp timestamp) Constructor.- Parameters:
clusterId- cluster IDsenderId- identity of senderrecipientId- identity of recipientterm- sender's current termtimestamp- request timestamp from thePingRequest
-
-
Method Details
-
visit
Description copied from class:MessageApply the visitor pattern based on this instance's type. -
getTimestamp
Get the ping request timestamp.- Returns:
- ping request timestamp
-
writeTo
Description copied from class:MessageSerialize this instance into the given buffer. -
calculateSize
protected int calculateSize(int version) Description copied from class:MessageCalculate the number of bytes required bywriteTo().- Overrides:
calculateSizein classMessage- Parameters:
version- protocol encoding version- Returns:
- an upper bound on the number of encoded bytes
-
toString
-