Interface RepositoryConfigurationMBean
The ObjectName for this MBean is "WebSphere:feature=collectiveController,type=RepositoryConfiguration,name=RepositoryConfiguration".
Replicas may be added and removed from a live replica set. Additionally, the entire replica set may be redefined, as long as one of the replicas in the previous set exists in the new set.
All endpoints specified to this MBean expect the replicaHost and replicaPort values defined in the server.xml of each replica. For example:
<collectiveController replicaHost="localhost" replicaPort="10011" />The endpoint would be "localhost:10011".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA String representing theObjectNamethat this MBean maps to. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddReplica(String endpoint) Adds a replica endpoint to the active replica set.This method returns the active replicas as SetThis method returns the union of the active set, the standby set, and the configured set as set of Map<String, String>This method returns the configured replicas as SetThis method returns all known replicas in a collective as a SetThis method returns the ID of the current replicaThis method returns the standby replicas as SetbooleanreconfigureReplicas(String endpoints) Redefines the active replica set.booleanremoveReplica(String endpoint) Removes a replica endpoint from the existing active replica set.
-
Field Details
-
OBJECT_NAME
A String representing theObjectNamethat this MBean maps to.- See Also:
-
-
Method Details
-
getConfiguredReplicas
Set<String> getConfiguredReplicas() throws IOException, IllegalArgumentException, IllegalStateExceptionThis method returns the configured replicas as SetA replica gets into this set:
- Automatically when it is in the initial replica set in the configuration
- When the "addReplica" command is invoked after the replica has been started
- "removeReplica" command is invoked
- Returns:
- A copy of configured in the form of a set of Strings of the endpoints "replica_hostname:replicaPort". Returns an empty list if there are no configured endpoints.
- Throws:
IOExceptionIllegalArgumentExceptionIllegalStateException
-
getActiveReplicas
This method returns the active replicas as SetA replica gets into this set:
- Automatically when it is in the initial replica set in the configuration
- When the "addReplica" command is invoked after the replica has been started
- "removeReplica" command is invoked
- The server is stopped or unreachable
- Returns:
- A copy of the active in the form of a set of Strings of the endpoints in the form "replica_hostname:replicaPort". Returns an empty list if there are no active endpoints.
- Throws:
IOExceptionIllegalArgumentExceptionIllegalStateException
-
getStandbyReplicas
Set<String> getStandbyReplicas() throws IOException, IllegalArgumentException, IllegalStateExceptionThis method returns the standby replicas as SetA replica gets into this set when:
- It is started out of the configuration
- It was removed (while running) using "removeReplica
- "addReplica" command is invoked
- The server is stopped or unreachable
- Returns:
- list of endpoint Strings of the form "replica_hostname:replicaPort". Returns an empty list if there are no standby endpoints.
- Throws:
IOExceptionIllegalArgumentExceptionIllegalStateException
-
getAllReplicas
Set<Map<String,String>> getAllReplicas() throws IOException, IllegalArgumentException, IllegalStateExceptionThis method returns the union of the active set, the standby set, and the configured set as set of Map<String, String>This method assigns values of endpoint, status(STARTED/STOPPED), standby(TRUE/FALSE) to all of the replicas
- Returns:
- a set of the union of the active set, the standby set, and the configured set
- Throws:
IOExceptionIllegalArgumentExceptionIllegalStateException
-
addReplica
boolean addReplica(String endpoint) throws IOException, IllegalArgumentException, UnknownHostException, IllegalStateException Adds a replica endpoint to the active replica set.Only endpoints that are part of the stand-by set can be added. If the endpoint is not part of the active or stand-by replica sets, then an IllegalStateException will be thrown. If the endpoint is already part of the active replica set, then no change will be made and
falsewill be returned.If the endpoint is malformed, an IllegalArgumentException will be thrown.
- Parameters:
endpoint- The identifier for a replica in the form "host:port".- Returns:
trueif the replica endpoint was added,falseif the replica endpoint was already part of the set- Throws:
IOException- If there was a problem completing the request.IllegalArgumentException- If the endpoint is not properly formatted. The input must be in the format "host:port".UnknownHostException- If the host specified in the endpoint cannot be resolved via DNS.IllegalStateException- If the endpoint is properly formatted but it is not part of the stand-by or active replica set.
-
reconfigureReplicas
boolean reconfigureReplicas(String endpoints) throws IOException, IllegalArgumentException, UnknownHostException Redefines the active replica set.The new active replica set will be comprised solely of the supplied endpoints. The replicas for reconfiguration are represented as a space delimited list endpoints. Only endpoints that are part of the active or stand-by replica sets can be specified. If the endpoints are not part of the active or stand-by replica sets, then an IllegalStateException will be thrown.
If any of endpoints are malformed, an IllegalArgumentException will be thrown.
- Parameters:
endpoints- A space delimited list of the replicas of the reconfigured replica set in the form "host:port host:port".- Returns:
trueif the replica reconfiguration was successful,falseif the operation was not successful.- Throws:
IOException- If there was a problem completing the request.IllegalArgumentException- If the endpoint is not properly formatted. The input must be in the format "host:port".UnknownHostException- If any of the hosts specified in the endpoints cannot be resolved via DNS.IllegalStateException- If the endpoints are properly formatted but at least one is not part of the stand-by or active replica set.
-
removeReplica
boolean removeReplica(String endpoint) throws IOException, IllegalArgumentException, UnknownHostException Removes a replica endpoint from the existing active replica set.Only endpoints that are part of the configured replica set can be removed. If the endpoint is not part of the active replica set, then no change will be made and
falsewill be returned.If the endpoint is malformed, an IllegalArgumentException will be thrown.
- Parameters:
endpoint- The identifier for a replica in the form "host:port".- Returns:
trueif the replica endpoint was removed,falseif the endpoint was not part of the active replica set.- Throws:
IOException- If there was a problem completing the request.IllegalArgumentException- If the endpoint is not properly formatted. The input must be in the format "host:port"UnknownHostException- If the host specified in the endpoint cannot be resolved via DNS.
-
getReplicaId
String getReplicaId()This method returns the ID of the current replica- Returns:
- the current replica ID as a String in the format HOST:PORT
-
getKnownReplicas
This method returns all known replicas in a collective as a Set- Returns:
- a set of all known replicas in a collective
- Throws:
IOExceptionIllegalArgumentExceptionIllegalStateException
-