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
8 package org.opendaylight.controller.cluster.datastore.messages;
10 import static java.util.Objects.requireNonNull;
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(final String shardName, final boolean waitUntilReady) {
24 this.shardName = requireNonNull(shardName, "shardName should not be null");
25 this.waitUntilReady = waitUntilReady;
28 public String getShardName() {
32 public boolean isWaitUntilReady() {
33 return waitUntilReady;
37 public String toString() {
38 return getClass().getName() + " [shardName=" + shardName
39 + ", waitUntilReady=" + waitUntilReady + "]";