2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.cluster.datastore.messages;
11 import com.google.common.base.Preconditions;
12 import java.io.Serializable;
15 * The FindPrimary message is used to locate the primary of any given shard.
17 public class FindPrimary implements Serializable {
18 private static final long serialVersionUID = 1L;
20 private final String shardName;
21 private final boolean waitUntilReady;
23 public FindPrimary(String shardName, boolean waitUntilReady) {
25 Preconditions.checkNotNull(shardName, "shardName should not be null");
27 this.shardName = shardName;
28 this.waitUntilReady = waitUntilReady;
31 public String getShardName() {
35 public boolean isWaitUntilReady() {
36 return waitUntilReady;
40 public String toString() {
41 StringBuilder builder = new StringBuilder();
42 builder.append(getClass().getName()).append(" [shardName=").append(shardName).append(", waitUntilReady=")
43 .append(waitUntilReady).append("]");
44 return builder.toString();