X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FFindPrimary.java;h=52709dd705828d2080dbd588052f7a973279b4c9;hp=f2497e6517f376e4d7173efdbd4aeb21596d3990;hb=HEAD;hpb=e64d758b45360b2ed8b7d8967fc1c7caaa7aa58f diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/FindPrimary.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/FindPrimary.java index f2497e6517..52709dd705 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/FindPrimary.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/FindPrimary.java @@ -5,27 +5,37 @@ * 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 com.google.common.base.Preconditions; +import static java.util.Objects.requireNonNull; + +import java.io.Serializable; /** - * The FindPrimary message is used to locate the primary of any given shard - * - * TODO : Make this serializable + * The FindPrimary message is used to locate the primary of any given shard. */ -public class FindPrimary{ - private final String shardName; - - public FindPrimary(String shardName){ +public class FindPrimary implements Serializable { + private static final long serialVersionUID = 1L; - Preconditions.checkNotNull(shardName, "shardName should not be null"); + private final String shardName; + private final boolean waitUntilReady; - this.shardName = shardName; + public FindPrimary(final String shardName, final boolean waitUntilReady) { + this.shardName = requireNonNull(shardName, "shardName should not be null"); + this.waitUntilReady = waitUntilReady; } public String getShardName() { return shardName; } + + public boolean isWaitUntilReady() { + return waitUntilReady; + } + + @Override + public String toString() { + return getClass().getName() + " [shardName=" + shardName + + ", waitUntilReady=" + waitUntilReady + "]"; + } }