X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FFindPrimary.java;h=a34330bcf6864c26799aae0c6a48990dee1f6f82;hb=365c9751fb9b8b5464e2576c417e97be64732def;hp=0920c284ad5206a2678697d14447a4cf11e38cf2;hpb=63ef05ffdad1413ffb6882db9b662435390e1015;p=controller.git 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 0920c284ad..a34330bcf6 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 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2014 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.datastore.messages; import com.google.common.base.Preconditions; @@ -5,19 +13,35 @@ import com.google.common.base.Preconditions; /** * The FindPrimary message is used to locate the primary of any given shard * - * TODO : Make this serializable */ -public class FindPrimary{ +public class FindPrimary implements SerializableMessage{ + public static final Class SERIALIZABLE_CLASS = FindPrimary.class; + private final String shardName; + private final boolean waitUntilInitialized; - public FindPrimary(String shardName){ + public FindPrimary(String shardName, boolean waitUntilInitialized){ Preconditions.checkNotNull(shardName, "shardName should not be null"); this.shardName = shardName; + this.waitUntilInitialized = waitUntilInitialized; } public String getShardName() { return shardName; } + + public boolean isWaitUntilInitialized() { + return waitUntilInitialized; + } + + @Override + public Object toSerializable() { + return this; + } + + public static FindPrimary fromSerializable(Object message){ + return (FindPrimary) message; + } }