tom | 1d416c5 | 2014-09-29 20:55:24 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.store.cluster.messaging; |
| 2 | |
| 3 | import org.onlab.onos.cluster.NodeId; |
| 4 | |
| 5 | /**l |
| 6 | * Echo heart-beat message that nodes send to each other. |
| 7 | */ |
| 8 | public 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 | } |