Interface CollectiveRepositoryMBean


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:

  • /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 Details

  • Method Details

    • create

      boolean create(String nodeName, Object data) throws IOException, 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the nodeName is not valid
      IllegalStateException - If the service is deactivated
    • delete

      boolean delete(String nodeName) throws IOException, 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the nodeName is not valid
    • exists

      boolean exists(String nodeName) throws IOException, 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the nodeName is not valid
    • getData

      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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the nodeName is not valid
      NoSuchElementException - If the node does not exist
    • getDescendantData

      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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the nodeName is not valid
      NoSuchElementException - If the node does not exist
    • setData

      boolean setData(String nodeName, Object data) throws IOException, 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - 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. null is 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 request
      IllegalArgumentException - If the nodeName is not valid
    • registerMember

      String registerMember(int heartBeatInterval, Map<String,Object> memberData) throws IOException, 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.

      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; 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - If the heartBeatInterval is not valid
    • deregisterMember

      void deregisterMember(String memberId) throws 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:
      IOException - If there was any problem completing the request
    • sendHeartBeat

      void sendHeartBeat(String memberId) throws IOException, 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - 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 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:
      IOException - If there was any problem completing the request
      IllegalArgumentException - 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 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:
      IOException - If there was any problem completing the request.
      IllegalArgumentException - If the nodeName is invalid.
    • retrieveMemberRootCertificate

      Certificate retrieveMemberRootCertificate() throws IOException, KeyStoreException, AccessControlException
      Retrieve 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

      Map<String,Integer> allocateDeployVariables(String host, String[] names) throws IOException
      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 variables
      names - 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

      void releaseDeployVariables(String host, Map<String,Integer> deployVars) throws IOException
      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 variables
      deployVars - 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.