import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
/**
*/
public class ModuleConfig {
private final String name;
- private final String nameSpace;
+ private final String namespace;
private final ShardStrategy shardStrategy;
private final Map<String, ShardConfig> shardConfigs;
- private ModuleConfig(String name, String nameSpace, ShardStrategy shardStrategy,
+ private ModuleConfig(String name, String namespace, ShardStrategy shardStrategy,
Map<String, ShardConfig> shardConfigs) {
this.name = name;
- this.nameSpace = nameSpace;
+ this.namespace = namespace;
this.shardStrategy = shardStrategy;
this.shardConfigs = shardConfigs;
}
}
@Nullable
- public String getNameSpace() {
- return nameSpace;
+ public String getNamespace() {
+ return namespace;
}
@Nullable
}
@Nullable
- public ShardConfig getShardConfig(String name) {
- return shardConfigs.get(name);
+ public ShardConfig getShardConfig(String forName) {
+ return shardConfigs.get(forName);
}
@Nonnull
private Builder(ModuleConfig moduleConfig) {
this.name = moduleConfig.getName();
- this.nameSpace = moduleConfig.getNameSpace();
+ this.nameSpace = moduleConfig.getNamespace();
this.shardStrategy = moduleConfig.getShardStrategy();
for (ShardConfig shardConfig : moduleConfig.getShardConfigs()) {
shardConfigs.put(shardConfig.getName(), shardConfig);
}
}
- public Builder name(String name) {
- this.name = name;
+ public Builder name(String newName) {
+ this.name = newName;
return this;
}
- public Builder nameSpace(String nameSpace) {
- this.nameSpace = nameSpace;
+ public Builder nameSpace(String newNameSpace) {
+ this.nameSpace = newNameSpace;
return this;
}
- public Builder shardStrategy(ShardStrategy shardStrategy) {
- this.shardStrategy = shardStrategy;
+ public Builder shardStrategy(ShardStrategy newShardStrategy) {
+ this.shardStrategy = newShardStrategy;
return this;
}
- public Builder shardConfig(String name, Collection<String> replicas) {
- shardConfigs.put(name, new ShardConfig(name, replicas));
+ public Builder shardConfig(String shardName, Collection<MemberName> replicas) {
+ shardConfigs.put(shardName, new ShardConfig(shardName, replicas));
return this;
}