BUG-5280: use MemberName instead of String
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / RemoveShardReplica.java
1 /*
2  * Copyright (c) 2015 Dell Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.cluster.datastore.messages;
10
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.controller.cluster.access.concepts.MemberName;
14
15 /**
16  * A message sent to the ShardManager to dynamically remove a local shard
17  *  replica available in this node.
18  */
19 public class RemoveShardReplica {
20
21     private final String shardName;
22     private final MemberName memberName;
23
24     /**
25      * Constructor.
26      *
27      * @param shardName name of the local shard that is to be dynamically removed.
28      */
29     public RemoveShardReplica (@Nonnull String shardName, @Nonnull MemberName memberName) {
30         this.shardName = Preconditions.checkNotNull(shardName, "shardName should not be null");
31         this.memberName = Preconditions.checkNotNull(memberName, "memberName should not be null");
32     }
33
34     public String getShardName(){
35         return shardName;
36     }
37
38     public MemberName getMemberName() {
39         return memberName;
40     }
41
42     @Override
43     public String toString() {
44         return "RemoveShardReplica [shardName=" + shardName + ", memberName=" + memberName + "]";
45     }
46 }