com.ibm.websphere.collective.repository

Interface CollectiveRepositoryMBean


  1. public interface CollectiveRepositoryMBean
The 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:

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

Modifier and Type Field and Description
  1. static
  2. java.lang.String
OBJECT_NAME
A String representing the ObjectName that this MBean maps to.

Method Summary

Modifier and Type Method and Description
  1. boolean
create(java.lang.String nodeName,java.lang.Object data)
The create operation creates a new Node with the specified nodeName in the repository.
  1. boolean
delete(java.lang.String nodeName)
The delete operation deletes the specified Node and all nodes under it.
  1. void
deregisterMember(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.
  1. void
dump(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.
  1. boolean
exists(java.lang.String nodeName)
The exists operation indicates whether or not the specified Node exists.
  1. 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.
  1. java.lang.Object
getData(java.lang.String nodeName)
The getData operation retrieves the data stored in the specified Node.
  1. 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.
  1. java.lang.String
registerMember(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.
  1. void
sendHeartBeat(java.lang.String memberId)
The sendHeartBeat operation sends a heart beat for the specified member to the repository.
  1. void
sendHeartBeat(java.lang.String memberId,int newHeartBeatInterval)
This form of the sendHeartBeat operation allows the member to specify a new heart beat interval.
  1. boolean
setData(java.lang.String nodeName,java.lang.Object data)
The setData operation stores data in the specified Node.

Field Detail

OBJECT_NAME

  1. static final java.lang.String OBJECT_NAME
A String representing the ObjectName that this MBean maps to.
See Also:

Method Detail

create

  1. boolean create(java.lang.String nodeName,
  2. java.lang.Object data)
  3. throws java.io.IOException
  4. java.lang.IllegalArgumentException
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, null is supported.
Returns:
true if the creation was successful, false if the node already existed.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid
java.lang.IllegalStateException - If the service is deactivated

delete

  1. boolean delete(java.lang.String nodeName)
  2. throws java.io.IOException
  3. java.lang.IllegalArgumentException
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:
true if the Node was deleted, false if the Node did not exist.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid

exists

  1. boolean exists(java.lang.String nodeName)
  2. throws java.io.IOException
  3. java.lang.IllegalArgumentException
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:
true if the specified Node exists, false otherwise.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid

getData

  1. java.lang.Object getData(java.lang.String nodeName)
  2. throws java.io.IOException
  3. java.lang.IllegalArgumentException
  4. java.util.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, null may be returned.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid
java.util.NoSuchElementException - If the node does not exist

getDescendantData

  1. java.util.Map<java.lang.String,java.lang.Object> getDescendantData( java.lang.String nodeName)
  2. throws java.io.IOException
  3. java.lang.IllegalArgumentException
  4. java.util.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 null if the node has no value.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid
java.util.NoSuchElementException - If the node does not exist

setData

  1. boolean setData(java.lang.String nodeName,
  2. java.lang.Object data)
  3. throws java.io.IOException
  4. java.lang.IllegalArgumentException
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, null is supported.
Returns:
true if the Node was updated, false if the Node did not exist.
Throws:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the nodeName is not valid

getChildren

  1. java.util.Collection<java.lang.String> getChildren( java.lang.String nodeName,
  2. boolean absolutePath)
  3. throws java.io.IOException
  4. java.lang.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. null is 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 request
java.lang.IllegalArgumentException - If the nodeName is not valid

registerMember

  1. java.lang.String registerMember( int heartBeatInterval,
  2. java.util.Map<java.lang.String,java.lang.Object> memberData)
  3. throws java.io.IOException
  4. java.lang.IllegalArgumentException
The 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.
Parameters:
heartBeatInterval - The heart beat interval, in seconds, for this member.
memberData - Provides data unique to this member; null may 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 request
java.lang.IllegalArgumentException - If the heartBeatInterval is not valid

deregisterMember

  1. void deregisterMember(java.lang.String memberId)
  2. throws java.io.IOException
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:
java.io.IOException - If there was any problem completing the request

sendHeartBeat

  1. void sendHeartBeat(java.lang.String memberId)
  2. throws java.io.IOException
  3. java.lang.IllegalArgumentException
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:
java.io.IOException - If there was any problem completing the request
java.lang.IllegalArgumentException - If the memberId is not valid

sendHeartBeat

  1. void sendHeartBeat(java.lang.String memberId,
  2. int newHeartBeatInterval)
  3. throws java.io.IOException
  4. java.lang.IllegalArgumentException
This form of the sendHeartBeat operation allows the member to specify a new heart beat interval. Otherwise, this operation behaves like sendHeartBeat(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 request
java.lang.IllegalArgumentException - If the memberId or newHeartBeatInterval is not valid

dump

  1. void dump(java.lang.String nodeName,
  2. java.lang.String fileName,
  3. java.lang.String correlator)
  4. throws java.io.IOException
  5. java.lang.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 if null or 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 not null or empty.
Throws:
java.io.IOException - If there was any problem completing the request.
java.lang.IllegalArgumentException - If the nodeName is invalid.