blob: d25a341f4a8422a0e86245b6a57727c004231024 [file] [log] [blame]
tom1d416c52014-09-29 20:55:24 -07001package org.onlab.onos.store.cluster.messaging;
2
3import org.onlab.onos.cluster.NodeId;
4
5/**l
6 * Echo heart-beat message that nodes send to each other.
7 */
8public class EchoMessage extends ClusterMessage {
9
10 private NodeId nodeId;
11
12 // For serialization
13 private EchoMessage() {
14 super(MessageSubject.HELLO);
15 nodeId = null;
16 }
17
18 /**
19 * Creates a new heart-beat echo message.
20 *
21 * @param nodeId sending node identification
22 */
23 public EchoMessage(NodeId nodeId) {
24 super(MessageSubject.HELLO);
25 nodeId = nodeId;
26 }
27
28 /**
29 * Returns the sending node identifer.
30 *
31 * @return node identifier
32 */
33 public NodeId nodeId() {
34 return nodeId;
35 }
36
37}