com.ibm.websphere.collective.repository

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 Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String OBJECT_NAME
      A String representing the ObjectName that this MBean maps to.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean create(java.lang.String nodeName, java.lang.Object data)
      The create operation creates a new Node with the specified nodeName in the repository.
      boolean delete(java.lang.String nodeName)
      The delete operation deletes the specified Node and all nodes under it.
      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.
      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.
      boolean exists(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.Object getData(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.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.
      java.security.cert.Certificate retrieveMemberRootCertificate()
      Retrieve the member root certificate from the controller.
      void sendHeartBeat(java.lang.String memberId)
      The sendHeartBeat operation sends a heart beat for the specified member to the repository.
      void sendHeartBeat(java.lang.String memberId, int newHeartBeatInterval)
      This form of the sendHeartBeat operation allows the member to specify a new heart beat interval.
      boolean setData(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 the ObjectName that this MBean maps to.
        See Also:
        Constant Field Values
    • Method Detail

      • create

        boolean create(java.lang.String nodeName,
                     java.lang.Object data)
                       throws java.io.IOException,
                              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

        boolean delete(java.lang.String nodeName)
                       throws java.io.IOException,
                              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

        boolean exists(java.lang.String nodeName)
                       throws java.io.IOException,
                              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

        java.lang.Object getData(java.lang.String nodeName)
                                 throws java.io.IOException,
                                        java.lang.IllegalArgumentException,
                                        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

        java.util.Map<java.lang.String,java.lang.Object> getDescendantData(java.lang.String nodeName)
                                                                           throws java.io.IOException,
                                                                                  java.lang.IllegalArgumentException,
                                                                                  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

        boolean setData(java.lang.String nodeName,
                      java.lang.Object data)
                        throws java.io.IOException,
                               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

        java.util.Collection<java.lang.String> getChildren(java.lang.String nodeName,
                                                         boolean absolutePath)
                                                           throws java.io.IOException,
                                                                  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

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

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

        void deregisterMember(java.lang.String memberId)
                              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

        void sendHeartBeat(java.lang.String memberId)
                           throws java.io.IOException,
                                  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

        void sendHeartBeat(java.lang.String memberId,
                         int newHeartBeatInterval)
                           throws java.io.IOException,
                                  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

        void dump(java.lang.String nodeName,
                java.lang.String fileName,
                java.lang.String correlator)
                  throws java.io.IOException,
                         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.
      • retrieveMemberRootCertificate

        java.security.cert.Certificate retrieveMemberRootCertificate()
                                                                     throws java.io.IOException,
                                                                            java.security.KeyStoreException,
                                                                            java.security.AccessControlException
        Retrieve 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.