blob: e9326f3022d7ea17748343be9bd53ea3e2db61f0 [file] [log] [blame]
tomd33e6402014-09-30 03:14:43 -07001package org.onlab.onos.store.cluster.messaging;
2
3import org.onlab.onos.cluster.NodeId;
4
5/**
6 * Goodbye message that nodes use to leave the cluster for good.
7 */
8public 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}