+ @Override public Optional<String> getModuleNameFromNameSpace(final String nameSpace) {
+
+ Preconditions.checkNotNull(nameSpace, "nameSpace should not be null");
+
+ for(Module m : modules){
+ if(m.getNameSpace().equals(nameSpace)){
+ return Optional.of(m.getName());
+ }
+ }
+ return Optional.absent();
+ }
+
+ @Override public Map<String, ShardStrategy> getModuleNameToShardStrategyMap() {
+ Map<String, ShardStrategy> map = new HashMap<>();
+ for(Module m : modules){
+ map.put(m.getName(), m.getShardStrategy());
+ }
+ return map;
+ }
+
+ @Override public List<String> getShardNamesFromModuleName(final String moduleName) {
+
+ Preconditions.checkNotNull(moduleName, "moduleName should not be null");
+
+ for(ModuleShard m : moduleShards){
+ if(m.getModuleName().equals(moduleName)){
+ List<String> l = new ArrayList<>();
+ for(Shard s : m.getShards()){
+ l.add(s.getName());
+ }
+ return l;
+ }
+ }
+
+ return Collections.emptyList();
+ }
+
+ @Override public List<String> getMembersFromShardName(final String shardName) {
+
+ Preconditions.checkNotNull(shardName, "shardName should not be null");