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 com.google.common.base.Preconditions;
12 import java.util.Collection;
13 import javax.annotation.Nonnull;
14 import javax.annotation.Nullable;
17 * Encapsulates information for adding a new module shard configuration.
19 * @author Thomas Pantelis
21 public class ModuleShardConfiguration {
22 private final URI namespace;
23 private final String moduleName;
24 private final String shardName;
25 private final String shardStrategyName;
26 private final Collection<String> shardMemberNames;
29 * Constructs a new instance.
31 * @param namespace the name space of the module.
32 * @param moduleName the name of the module.
33 * @param shardName the name of the shard.
34 * @param shardStrategyName the name of the sharding strategy (eg "module"). If null the default strategy
36 * @param shardMemberNames the names of the shard's member replicas.
38 public ModuleShardConfiguration(@Nonnull URI namespace, @Nonnull String moduleName, @Nonnull String shardName,
39 @Nullable String shardStrategyName, @Nonnull Collection<String> shardMemberNames) {
40 this.namespace = Preconditions.checkNotNull(namespace, "nameSpace should not be null");
41 this.moduleName = Preconditions.checkNotNull(moduleName, "moduleName should not be null");
42 this.shardName = Preconditions.checkNotNull(shardName, "shardName should not be null");
43 this.shardStrategyName = shardStrategyName;
44 this.shardMemberNames = Preconditions.checkNotNull(shardMemberNames, "shardMemberNames");
47 public URI getNamespace() {
51 public String getModuleName() {
55 public String getShardName() {
59 public String getShardStrategyName() {
60 return shardStrategyName;
63 public Collection<String> getShardMemberNames() {
64 return shardMemberNames;
68 public String toString() {
69 return "ModuleShardConfiguration [namespace=" + namespace + ", moduleName=" + moduleName + ", shardName="
70 + shardName + ", shardMemberNames=" + shardMemberNames + ", shardStrategyName=" + shardStrategyName