io.permazen.kv.raft.msg.PingResponse Maven / Gradle / Ivy
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package io.permazen.kv.raft.msg;
import io.permazen.kv.raft.Timestamp;
import java.nio.ByteBuffer;
/**
* Response to a {@link PingRequest}.
*/
public class PingResponse extends AbstractPingMessage {
// Constructors
/**
* Constructor.
*
* @param clusterId cluster ID
* @param senderId identity of sender
* @param recipientId identity of recipient
* @param term sender's current term
* @param timestamp request timestamp from the {@link PingRequest}
*/
public PingResponse(int clusterId, String senderId, String recipientId, long term, Timestamp timestamp) {
super(Message.PING_RESPONSE_TYPE, clusterId, senderId, recipientId, term, timestamp);
this.checkArguments();
}
PingResponse(ByteBuffer buf, int version) {
super(Message.PING_RESPONSE_TYPE, buf, version);
this.checkArguments();
}
// Message
@Override
public void visit(MessageSwitch handler) {
handler.casePingResponse(this);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy