BUG 2817 - Basic implementation of RemoveServer in the Raft code
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / ServerRemoved.java
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/ServerRemoved.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/ServerRemoved.java
new file mode 100644 (file)
index 0000000..fba601c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.cluster.raft.messages;
+
+import com.google.common.base.Preconditions;
+import java.io.Serializable;
+
+/**
+ * The ServerRemoved message is sent to a server which has been removed successfully from the ServerConfiguration.
+ * The Server can then choose to self destruct or notify it's parents as needed.
+ */
+public class ServerRemoved implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private final String serverId;
+
+    public ServerRemoved(String serverId) {
+        this.serverId = Preconditions.checkNotNull(serverId);
+    }
+
+    public String getServerId() {
+        return serverId;
+    }
+
+    @Override
+    public String toString() {
+        return "ServerRemoved{" +
+                "serverId='" + serverId + '\'' +
+                '}';
+    }
+}