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.utils;
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.cluster.datastore.Configuration;
13 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
15 import java.util.Arrays;
16 import java.util.Collections;
17 import java.util.List;
21 public class MockConfiguration implements Configuration{
22 @Override public List<String> getMemberShardNames(String memberName) {
23 return Arrays.asList("default");
26 @Override public Optional<String> getModuleNameFromNameSpace(
28 return Optional.absent();
32 public Map<String, ShardStrategy> getModuleNameToShardStrategyMap() {
33 return Collections.EMPTY_MAP;
36 @Override public List<String> getShardNamesFromModuleName(
38 return Collections.EMPTY_LIST;
41 @Override public List<String> getMembersFromShardName(String shardName) {
42 if("default".equals(shardName)) {
43 return Arrays.asList("member-1", "member-2");
44 } else if("astronauts".equals(shardName)){
45 return Arrays.asList("member-2", "member-3");
48 return Collections.EMPTY_LIST;
51 @Override public Set<String> getAllShardNames() {
52 return Collections.emptySet();