Merge "BUG-190 Simplify reconnect logic in protocol-framework."
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / Configuration.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;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
13
14 import java.util.List;
15 import java.util.Map;
16
17 public interface Configuration {
18
19     /**
20      * Given a memberName find all the shards that belong on that member and
21      * return the names of those shards
22      *
23      * @param memberName
24      * @return
25      */
26     List<String> getMemberShardNames(String memberName);
27
28     /**
29      * Given a module namespace return the name of a module
30      * @param nameSpace
31      * @return
32      */
33     Optional<String> getModuleNameFromNameSpace(String nameSpace);
34
35     /**
36      * Get a mapping of the module names to it's corresponding ShardStrategy
37      * @return
38      */
39     Map<String, ShardStrategy> getModuleNameToShardStrategyMap();
40
41     /**
42      * Given a module name find all the shardNames corresponding to it
43      * @param moduleName
44      * @return
45      */
46     List<String> getShardNamesFromModuleName(String moduleName);
47
48     /**
49      * Given a shardName find all the members on which it belongs
50      *
51      * @param shardName
52      * @return
53      */
54     List<String> getMembersFromShardName(String shardName);
55 }