tom | d33e640 | 2014-09-30 03:14:43 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.cluster.messaging; |
| 2 | |
| 3 | import org.onlab.onos.cluster.NodeId; |
| 4 | |
| 5 | /** |
| 6 | * Goodbye message that nodes use to leave the cluster for good. |
| 7 | */ |
| 8 | public class GoodbyeMessage extends ClusterMessage { |
| 9 | |
| 10 | private NodeId nodeId; |
| 11 | |
| 12 | // For serialization |
| 13 | private GoodbyeMessage() { |
| 14 | super(MessageSubject.GOODBYE); |
| 15 | nodeId = null; |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Creates a new goodbye message. |
| 20 | * |
| 21 | * @param nodeId sending node identification |
| 22 | */ |
| 23 | public GoodbyeMessage(NodeId nodeId) { |
| 24 | super(MessageSubject.HELLO); |
| 25 | this.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 | } |