2 * Copyright (c) 2015 Brocade Communications 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.config;
10 import java.util.Collection;
11 import java.util.HashMap;
14 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
17 * Encapsulates configuration for a module.
19 * @author Thomas Pantelis
21 public class ModuleConfig {
22 private final String name;
23 private String nameSpace;
24 private ShardStrategy shardStrategy;
25 private final Map<String, ShardConfig> shardConfigs = new HashMap<>();
27 public ModuleConfig(final String name) {
31 public String getName() {
35 public String getNameSpace() {
39 public ShardStrategy getShardStrategy() {
43 public ShardConfig getShardConfig(String name) {
44 return shardConfigs.get(name);
47 public Collection<ShardConfig> getShardConfigs() {
48 return shardConfigs.values();
51 public Collection<String> getShardNames() {
52 return shardConfigs.keySet();
55 public void addShardConfig(String name, Set<String> replicas) {
56 shardConfigs.put(name, new ShardConfig(name, replicas));
59 public void setNameSpace(String nameSpace) {
60 this.nameSpace = nameSpace;
63 public void setShardStrategy(ShardStrategy shardStrategy) {
64 this.shardStrategy = shardStrategy;