Remove deprecated MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / RemoveShardReplica.java
index 86c70234f2b40584b0e9da9f1d8dd2d3f706fbe3..5da3a201e88a7d71b5800eb44eed63618be89497 100644 (file)
@@ -5,37 +5,42 @@
  * 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.datastore.messages;
 
-import javax.annotation.Nonnull;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.controller.cluster.access.concepts.MemberName;
 
 /**
  * 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 MemberName memberName;
 
     /**
      * Constructor.
      *
      * @param shardName name of the local shard that is to be dynamically removed.
      */
+    public RemoveShardReplica(@NonNull String shardName, @NonNull MemberName memberName) {
+        this.shardName = requireNonNull(shardName, "shardName should not be null");
+        this.memberName = requireNonNull(memberName, "memberName should not be null");
+    }
 
-    public RemoveShardReplica (@Nonnull String shardName){
-        this.shardName = Preconditions.checkNotNull(shardName, "ShardName should not be null");
+    public String getShardName() {
+        return shardName;
     }
 
-    public String getShardName(){
-        return this.shardName;
+    public MemberName getMemberName() {
+        return memberName;
     }
 
     @Override
-    public String toString(){
-        return "RemoveShardReplica[ShardName=" + shardName + "]";
+    public String toString() {
+        return "RemoveShardReplica [shardName=" + shardName + ", memberName=" + memberName + "]";
     }
 }