Interface CollectiveRepositoryMBean
-
public interface CollectiveRepositoryMBeanThe CollectiveRepositoryMBean defines basic CRUD and membership operations to the Collective Repository.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
Fields Modifier and Type Field Description static java.lang.StringDEPLOYVAR_INCREMENT_KEYstatic java.lang.StringDEPLOYVAR_INITIAL_KEYstatic java.lang.StringDEPLOYVAR_NAME_KEYstatic java.lang.StringOBJECT_NAMEA String representing theObjectNamethat this MBean maps to.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Integer>allocateDeployVariables(java.lang.String host, java.lang.String[] names)Allocates a list of named deployment variables for a host.booleancreate(java.lang.String nodeName, java.lang.Object data)The create operation creates a new Node with the specified nodeName in the repository.booleandelete(java.lang.String nodeName)The delete operation deletes the specified Node and all nodes under it.voidderegisterMember(java.lang.String memberId)The deregsiterMember operation instructs the repository to unregister the specified member and discard any active repository services presently associated with the member.voiddump(java.lang.String nodeName, java.lang.String fileName, java.lang.String correlator)The dump operation writes the content of the specified Node to a file or the server log.booleanexists(java.lang.String nodeName)The exists operation indicates whether or not the specified Node exists.java.util.Collection<java.lang.String>getChildren(java.lang.String nodeName, boolean absolutePath)The getChildren operation returns a collection of the names of the children Nodes of the specified Node.java.lang.ObjectgetData(java.lang.String nodeName)The getData operation retrieves the data stored in the specified Node.java.util.Map<java.lang.String,java.lang.Object>getDescendantData(java.lang.String nodeName)The getDescendantData operation retrieves the data stored in the specified Node and the data of all of its descendants.java.lang.StringregisterMember(int heartBeatInterval, java.util.Map<java.lang.String,java.lang.Object> memberData)The registerMember operation registers this member with the repository and starts the repository monitoring of this member.voidreleaseDeployVariables(java.lang.String host, java.util.Map<java.lang.String,java.lang.Integer> deployVars)Releases values for a set of deployment variables for a host.java.security.cert.CertificateretrieveMemberRootCertificate()Retrieve the member root certificate from the controller.voidsendHeartBeat(java.lang.String memberId)The sendHeartBeat operation sends a heart beat for the specified member to the repository.voidsendHeartBeat(java.lang.String memberId, int newHeartBeatInterval)This form of the sendHeartBeat operation allows the member to specify a new heart beat interval.booleansetData(java.lang.String nodeName, java.lang.Object data)The setData operation stores data in the specified Node.
-
-
-
Field Detail
-
OBJECT_NAME
static final java.lang.String OBJECT_NAME
A String representing theObjectNamethat this MBean maps to.- See Also:
- Constant Field Values
-
DEPLOYVAR_NAME_KEY
static final java.lang.String DEPLOYVAR_NAME_KEY
- See Also:
- Constant Field Values
-
DEPLOYVAR_INCREMENT_KEY
static final java.lang.String DEPLOYVAR_INCREMENT_KEY
- See Also:
- Constant Field Values
-
DEPLOYVAR_INITIAL_KEY
static final java.lang.String DEPLOYVAR_INITIAL_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
boolean create(java.lang.String nodeName, java.lang.Object data) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not validjava.lang.IllegalStateException- If the service is deactivated
-
delete
boolean delete(java.lang.String nodeName) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not valid
-
exists
boolean exists(java.lang.String nodeName) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not valid
-
getData
java.lang.Object getData(java.lang.String nodeName) throws java.io.IOException, java.lang.IllegalArgumentException, java.util.NoSuchElementExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not validjava.util.NoSuchElementException- If the node does not exist
-
getDescendantData
java.util.Map<java.lang.String,java.lang.Object> getDescendantData(java.lang.String nodeName) throws java.io.IOException, java.lang.IllegalArgumentException, java.util.NoSuchElementExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not validjava.util.NoSuchElementException- If the node does not exist
-
setData
boolean setData(java.lang.String nodeName, java.lang.Object data) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not valid
-
getChildren
java.util.Collection<java.lang.String> getChildren(java.lang.String nodeName, boolean absolutePath) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the nodeName is not valid
-
registerMember
java.lang.String registerMember(int heartBeatInterval, java.util.Map<java.lang.String,java.lang.Object> memberData) throws java.io.IOException, java.lang.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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the heartBeatInterval is not valid
-
deregisterMember
void deregisterMember(java.lang.String memberId) throws java.io.IOExceptionThe 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:
java.io.IOException- If there was any problem completing the request
-
sendHeartBeat
void sendHeartBeat(java.lang.String memberId) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the memberId is not valid
-
sendHeartBeat
void sendHeartBeat(java.lang.String memberId, int newHeartBeatInterval) throws java.io.IOException, java.lang.IllegalArgumentExceptionThis 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:
java.io.IOException- If there was any problem completing the requestjava.lang.IllegalArgumentException- If the memberId or newHeartBeatInterval is not valid
-
dump
void dump(java.lang.String nodeName, java.lang.String fileName, java.lang.String correlator) throws java.io.IOException, java.lang.IllegalArgumentExceptionThe 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:
java.io.IOException- If there was any problem completing the request.java.lang.IllegalArgumentException- If the nodeName is invalid.
-
retrieveMemberRootCertificate
java.security.cert.Certificate retrieveMemberRootCertificate() throws java.io.IOException, java.security.KeyStoreException, java.security.AccessControlExceptionRetrieve the member root certificate from the controller. Only members are permitted to invoke this operation.- Throws:
java.io.IOException- If there was any problem completing the request.java.security.KeyStoreException- If there was a problem accessing the certificate.java.security.AccessControlException- If the requester is not a member.
-
allocateDeployVariables
java.util.Map<java.lang.String,java.lang.Integer> allocateDeployVariables(java.lang.String host, java.lang.String[] names) throws java.io.IOExceptionAllocates 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:
java.io.IOException- If there was any problem completing the request.
-
releaseDeployVariables
void releaseDeployVariables(java.lang.String host, java.util.Map<java.lang.String,java.lang.Integer> deployVars) throws java.io.IOExceptionReleases 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:
java.io.IOException- If there was any problem completing the request.
-
-