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%2FLocalPrimaryShardFound.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FLocalPrimaryShardFound.java;h=e19dcd65b37fab7a453f4452dc074b671d976097;hb=a2c4e27ea137ce9e2929916b2964116c4df188a0;hp=0000000000000000000000000000000000000000;hpb=4ded8407b8cc21fe329f49b378a088a703c707fc;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/LocalPrimaryShardFound.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/LocalPrimaryShardFound.java new file mode 100644 index 0000000000..e19dcd65b3 --- /dev/null +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/LocalPrimaryShardFound.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2015 Brocade Communications 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; +import javax.annotation.Nonnull; +import org.apache.commons.lang3.ObjectUtils; +import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree; + +/** + * Local message sent in reply to FindPrimaryShard to indicate the primary shard is local to the caller. + * + * @author Thomas Pantelis + */ +public class LocalPrimaryShardFound { + + private final String primaryPath; + private final DataTree localShardDataTree; + + public LocalPrimaryShardFound(@Nonnull String primaryPath, @Nonnull DataTree localShardDataTree) { + this.primaryPath = Preconditions.checkNotNull(primaryPath); + this.localShardDataTree = Preconditions.checkNotNull(localShardDataTree); + } + + public @Nonnull String getPrimaryPath() { + return primaryPath; + } + + public @Nonnull DataTree getLocalShardDataTree() { + return localShardDataTree; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("LocalPrimaryShardFound [primaryPath=").append(primaryPath).append(", localShardDataTree=") + .append(ObjectUtils.identityToString(localShardDataTree)).append("]"); + return builder.toString(); + } +}