Interface CollectiveRepositoryMBean
The ObjectName for this MBean is "WebSphere:feature=collectiveController,type=CollectiveRepository,name=CollectiveRepository".
The Collective Repository stores data in a tree structure of "Nodes". Each Node has path like name, starting from the root Node "/". Nodes may hold data and may have child Nodes.
Example Node tree:
- /a
- /a/b1
- /a/b1/c1
- /a/b2
All Node paths are normalized such that additional delimiter slashes are collapsed into a single slash. e.g. "////" resolves to "/" and "/a//b/" resolve to "/a/b". The slash "/" character is the Node path delimiter, and the slash "\" is treated as a normal character (not a delimiter), but its use is highly discouraged. Any trailing whitespace is removed. Any leading whitespace is not valid. Embedded whitespace is preserved. e.g. "/a/b c/d" is a valid path, "/a/b/c " will resolve to "/a/b/c" and " /a/b/c" is not valid.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringA String representing theObjectNamethat this MBean maps to. -
Method Summary
Modifier and TypeMethodDescriptionallocateDeployVariables(String host, String[] names) Allocates a list of named deployment variables for a host.booleanThe create operation creates a new Node with the specified nodeName in the repository.booleanThe delete operation deletes the specified Node and all nodes under it.voidderegisterMember(String memberId) The deregsiterMember operation instructs the repository to unregister the specified member and discard any active repository services presently associated with the member.voidThe dump operation writes the content of the specified Node to a file or the server log.booleanThe exists operation indicates whether or not the specified Node exists.getChildren(String nodeName, boolean absolutePath) The getChildren operation returns a collection of the names of the children Nodes of the specified Node.The getData operation retrieves the data stored in the specified Node.getDescendantData(String nodeName) The getDescendantData operation retrieves the data stored in the specified Node and the data of all of its descendants.registerMember(int heartBeatInterval, Map<String, Object> memberData) The registerMember operation registers this member with the repository and starts the repository monitoring of this member.voidreleaseDeployVariables(String host, Map<String, Integer> deployVars) Releases values for a set of deployment variables for a host.Retrieve the member root certificate from the controller.voidsendHeartBeat(String memberId) The sendHeartBeat operation sends a heart beat for the specified member to the repository.voidsendHeartBeat(String memberId, int newHeartBeatInterval) This form of the sendHeartBeat operation allows the member to specify a new heart beat interval.booleanThe setData operation stores data in the specified Node.
-
Field Details
-
OBJECT_NAME
A String representing theObjectNamethat this MBean maps to.- See Also:
-
DEPLOYVAR_NAME_KEY
- See Also:
-
DEPLOYVAR_INCREMENT_KEY
- See Also:
-
DEPLOYVAR_INITIAL_KEY
- See Also:
-
-
Method Details
-
create
The create operation creates a new Node with the specified nodeName in the repository. The repository automatically creates all intermediary Nodes necessary to reach the leaf name of the specified Node if they do not already exist.If the Node already exists, no action is taken (the data is not altered).
The root "/" Node always exists and therefore can not be created.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".data- The data to store in the Node,nullis supported.- Returns:
trueif the creation was successful,falseif the node already existed.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not validIllegalStateException- If the service is deactivated
-
delete
The delete operation deletes the specified Node and all nodes under it.The root "/" Node can not be deleted.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".- Returns:
trueif the Node was deleted,falseif the Node did not exist.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not valid
-
exists
The exists operation indicates whether or not the specified Node exists.The root "/" Node always exists.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".- Returns:
trueif the specified Node exists,falseotherwise.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not valid
-
getData
Object getData(String nodeName) throws IOException, IllegalArgumentException, NoSuchElementException The getData operation retrieves the data stored in the specified Node.The root "/" Node never has any data.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".- Returns:
- Object stored in the specified Node,
nullmay be returned. - Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not validNoSuchElementException- If the node does not exist
-
getDescendantData
Map<String,Object> getDescendantData(String nodeName) throws IOException, IllegalArgumentException, NoSuchElementException The getDescendantData operation retrieves the data stored in the specified Node and the data of all of its descendants.The root "/" Node never has any data.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".- Returns:
- A map containing the data of the specified node and all of its descendants.
The keys of the map are the paths.
The value of an entry in the map will be
nullif the node has no value. - Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not validNoSuchElementException- If the node does not exist
-
setData
The setData operation stores data in the specified Node.The data replaces any data already stored in the specified Node. This will not create the Node if it does note exist.
The root "/" Node can never store data.
- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".data- The data to store in the Node,nullis supported.- Returns:
trueif the Node was updated,falseif the Node did not exist.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not valid
-
getChildren
Collection<String> getChildren(String nodeName, boolean absolutePath) throws IOException, IllegalArgumentException The getChildren operation returns a collection of the names of the children Nodes of the specified Node. This operation is not recursive.- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".absolutePath- True if the returned collection should contain fully qualified node names.- Returns:
- String array of Node names.
nullis returned if the Node does not exist. If the Node exists and no children exist, the array will be empty. - Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the nodeName is not valid
-
registerMember
String registerMember(int heartBeatInterval, Map<String, Object> memberData) throws IOException, IllegalArgumentExceptionThe registerMember operation registers this member with the repository and starts the repository monitoring of this member. The repository expects a heart beat from the member at least once within every specified heart beat interval. If the repository detects three missing heart beats in a row, the member is considered terminated, is unregistered and any active repository services associated with that member are discarded.NOTE: when the liberty.userdir is provided in the memberData for a member, it must be UTF8 encoded with no trailing slashes to match the joined member.
- Parameters:
heartBeatInterval- The heart beat interval, in seconds, for this member.memberData- Provides data unique to this member;nullmay be provided if no data is required- Returns:
- the ID assigned to this member; this ID must be provided in other member operations
- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the heartBeatInterval is not valid
-
deregisterMember
The deregsiterMember operation instructs the repository to unregister the specified member and discard any active repository services presently associated with the member.If the member is already disconnected, this operation has no effect.
- Parameters:
memberId- The member unregistering with the repository.- Throws:
IOException- If there was any problem completing the request
-
sendHeartBeat
The sendHeartBeat operation sends a heart beat for the specified member to the repository. This operation must be invoked at at least as frequently as the heart beat interval to ensure the member remains considered an active member.- Parameters:
memberId- The member identifier to which the heart beat belongs.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the memberId is not valid
-
sendHeartBeat
void sendHeartBeat(String memberId, int newHeartBeatInterval) throws IOException, IllegalArgumentException This form of the sendHeartBeat operation allows the member to specify a new heart beat interval. Otherwise, this operation behaves likesendHeartBeat(String).- Parameters:
memberId- The member identifier to which the heart beat belongs.newHeartBeatInterval- The new heart beat interval, in seconds, for this member.- Throws:
IOException- If there was any problem completing the requestIllegalArgumentException- If the memberId or newHeartBeatInterval is not valid
-
dump
void dump(String nodeName, String fileName, String correlator) throws IOException, IllegalArgumentException The dump operation writes the content of the specified Node to a file or the server log. The Node, its data and all its children and their data will be dumped if the node exists. If the Node does not exist, there will be no operation.- Parameters:
nodeName- The fully qualified Node name, starting from the root "/".fileName- The file to dump the content to. Default to server log ifnullor empty. WebSphere Application Server symbols in the fileName will be resolved.correlator- An optional string to identify the dump. It will be the first line of the dump if notnullor empty.- Throws:
IOException- If there was any problem completing the request.IllegalArgumentException- If the nodeName is invalid.
-
retrieveMemberRootCertificate
Certificate retrieveMemberRootCertificate() throws IOException, KeyStoreException, AccessControlExceptionRetrieve the member root certificate from the controller. Only members are permitted to invoke this operation.- Throws:
IOException- If there was any problem completing the request.KeyStoreException- If there was a problem accessing the certificate.AccessControlException- If the requester is not a member.
-
allocateDeployVariables
Allocates a list of named deployment variables for a host. These variables must already be stored in the collective repository based on a controller configuration.- Parameters:
host- the host that will use the deployment variablesnames- the deployement variable names to allocate- Returns:
- a Map that has the name of each allocated deployment variable as the key and the value is the allocated value for the variable
- Throws:
IOException- If there was any problem completing the request.
-
releaseDeployVariables
Releases values for a set of deployment variables for a host. Previously allocated values may eventually cease to be used and can be released so that they can be used again on the host. These variables must already be stored in the collective repository and have been allocated.- Parameters:
host- the host that will use the deployment variablesdeployVars- a Map that has the name of each allocated deployment variable to release. The key is the name of the variable and the value is the allocated value to be released- Throws:
IOException- If there was any problem completing the request.
-