BUG 2187 Handle RemoveShardReplica in ShardManager
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / RemoveShardReplica.java
index 86c70234f2b40584b0e9da9f1d8dd2d3f706fbe3..54cec906b626de975d584139da99fd304c2d4efc 100644 (file)
@@ -8,34 +8,38 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import javax.annotation.Nonnull;
 import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
 
 /**
  * A message sent to the ShardManager to dynamically remove a local shard
  *  replica available in this node.
  */
-
 public class RemoveShardReplica {
 
     private final String shardName;
+    private final String memberName;
 
     /**
      * Constructor.
      *
      * @param shardName name of the local shard that is to be dynamically removed.
      */
-
-    public RemoveShardReplica (@Nonnull String shardName){
-        this.shardName = Preconditions.checkNotNull(shardName, "ShardName should not be null");
+    public RemoveShardReplica (@Nonnull String shardName, @Nonnull String memberName) {
+        this.shardName = Preconditions.checkNotNull(shardName, "shardName should not be null");
+        this.memberName = Preconditions.checkNotNull(memberName, "memberName should not be null");
     }
 
     public String getShardName(){
-        return this.shardName;
+        return shardName;
+    }
+
+    public String getMemberName() {
+        return memberName;
     }
 
     @Override
-    public String toString(){
-        return "RemoveShardReplica[ShardName=" + shardName + "]";
+    public String toString() {
+        return "RemoveShardReplica [shardName=" + shardName + ", memberName=" + memberName + "]";
     }
 }