NodeIDType
- The point of this class is to retain the supplied nodeConfig only
for actives so that the supplier can change them at will. We make
a separate copy of the reconfigurators as they have to be changed
carefully.
As the purpose of this class is also to serve as the "underlying"
node config to ConsistentNodeConfig, we allow getNodeIDs() to be
called here.public class SimpleReconfiguratorNodeConfig<NodeIDType> extends java.lang.Object implements ModifiableReconfigurableNodeConfig<NodeIDType>
Constructor and Description |
---|
SimpleReconfiguratorNodeConfig(ReconfigurableNodeConfig<NodeIDType> nc) |
Modifier and Type | Method and Description |
---|---|
java.net.InetSocketAddress |
addActiveReplica(NodeIDType id,
java.net.InetSocketAddress sockAddr) |
java.net.InetSocketAddress |
addReconfigurator(NodeIDType id,
java.net.InetSocketAddress sockAddr) |
java.util.Set<NodeIDType> |
getActiveReplicas() |
java.net.InetAddress |
getBindAddress(NodeIDType id) |
java.net.InetAddress |
getNodeAddress(NodeIDType id) |
java.util.Set<NodeIDType> |
getNodeIDs() |
int |
getNodePort(NodeIDType id) |
java.util.Set<NodeIDType> |
getReconfigurators() |
java.util.Set<NodeIDType> |
getValuesFromJSONArray(org.json.JSONArray array) |
java.util.Set<NodeIDType> |
getValuesFromStringSet(java.util.Set<java.lang.String> strNodes)
Converts a set of string node ids using valueOf.
|
long |
getVersion()
Unused.
|
boolean |
nodeExists(NodeIDType id) |
java.net.InetSocketAddress |
removeActiveReplica(NodeIDType id) |
java.net.InetSocketAddress |
removeReconfigurator(NodeIDType id) |
NodeIDType |
valueOf(java.lang.String strValue)
Converts a string representation of a node id into the appropriate node
id type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getActiveReplicasMap
getActiveReplicasReadOnly, getReconfiguratorsReadOnly
public SimpleReconfiguratorNodeConfig(ReconfigurableNodeConfig<NodeIDType> nc)
nc
- public java.util.Set<NodeIDType> getActiveReplicas()
getActiveReplicas
in interface ReconfigurableNodeConfig<NodeIDType>
public java.util.Set<NodeIDType> getReconfigurators()
getReconfigurators
in interface ReconfigurableNodeConfig<NodeIDType>
public boolean nodeExists(NodeIDType id)
nodeExists
in interface NodeConfig<NodeIDType>
public java.net.InetAddress getNodeAddress(NodeIDType id)
getNodeAddress
in interface NodeConfig<NodeIDType>
id
.public java.net.InetAddress getBindAddress(NodeIDType id)
getBindAddress
in interface NodeConfig<NodeIDType>
id
.public int getNodePort(NodeIDType id)
getNodePort
in interface NodeConfig<NodeIDType>
id
.public java.util.Set<NodeIDType> getNodeIDs()
getNodeIDs
in interface NodeConfig<NodeIDType>
public NodeIDType valueOf(java.lang.String strValue)
Stringifiable
valueOf
in interface Stringifiable<NodeIDType>
public java.util.Set<NodeIDType> getValuesFromStringSet(java.util.Set<java.lang.String> strNodes)
Stringifiable
getValuesFromStringSet
in interface Stringifiable<NodeIDType>
public java.util.Set<NodeIDType> getValuesFromJSONArray(org.json.JSONArray array) throws org.json.JSONException
getValuesFromJSONArray
in interface Stringifiable<NodeIDType>
org.json.JSONException
public long getVersion()
ModifiableActiveConfig
getVersion
in interface ModifiableActiveConfig<NodeIDType>
public java.net.InetSocketAddress addReconfigurator(NodeIDType id, java.net.InetSocketAddress sockAddr)
addReconfigurator
in interface ModifiableRCConfig<NodeIDType>
public java.net.InetSocketAddress removeReconfigurator(NodeIDType id)
removeReconfigurator
in interface ModifiableRCConfig<NodeIDType>
id
was mapped.public java.net.InetSocketAddress addActiveReplica(NodeIDType id, java.net.InetSocketAddress sockAddr)
addActiveReplica
in interface ModifiableActiveConfig<NodeIDType>
public java.net.InetSocketAddress removeActiveReplica(NodeIDType id)
removeActiveReplica
in interface ModifiableActiveConfig<NodeIDType>
id
was mapped.