Fix warnings/javadocs in sal-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / shardmanager / ShardManagerInfoMBean.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.datastore.shardmanager;
10
11 import java.util.List;
12
13 public interface ShardManagerInfoMBean {
14     /**
15      * Returns the list of all the local shard names.
16      *
17      * @return a list of all the local shard names
18      */
19     List<String> getLocalShards();
20
21     /**
22      * Returns the overall sync status for all shards.
23      *
24      * @return true if all local shards are in sync with their corresponding leaders
25      */
26     boolean getSyncStatus();
27
28     /**
29      * Returns the name of the local member.
30      *
31      * @return the local member name
32      */
33     String getMemberName();
34
35     /**
36      * Switches the raft behavior of all the local shards to the newBehavior.
37      *
38      * @param newBehavior should be either Leader/Follower only
39      * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any
40      *             modifications made to state will be written with this term. This term will then be used by the Raft
41      *             replication implementation to decide which modifications should stay and which ones should be
42      *             removed. Ideally the term provided when switching to a new Leader should always be higher than the
43      *             previous term.
44      */
45     void switchAllLocalShardsState(String newBehavior, long term);
46
47     /**
48      * Switches the raft behavior of the shard specified by shardName to the newBehavior.
49      *
50      * @param shardName a shard that is local to this shard manager
51      * @param newBehavior should be either Leader/Follower only
52      * @param term when switching to the Leader specifies for which term the Shard would be the Leader. Any
53      *             modifications made to state will be written with this term. This term will then be used by the Raft
54      *             replication implementation to decide which modifications should stay and which ones should be
55      *             removed. Ideally the term provided when switching to a new Leader should always be higher than the
56      *             previous term.
57      */
58     void switchShardState(String shardName, String newBehavior, long term);
59 }