Interface ConfigManagementMBean


  • public interface ConfigManagementMBean

    The ConfigManagementMBean interface defines operations related to declarative state import and export.

    Since:
    Rhino 3.0.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String OBJECT_NAME
      The JMX Object Name of this MBean.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void configureDefaultDesiredStateFromNode​(int sourceNodeID)
      Set the default desired state of the SLEE, Services, and Resource Adaptor Entities based on the desired state of the specified node, then delete all per-node desired state (including state associated with non-member nodes).
      byte[] exportConfiguration()
      Export the current state of the SLEE.
      String getConvergenceStatus​(boolean differencesOnly)
      Get the current mappings between desired state and actual state for the stateful entities in the SLEE on all event router nodes.
      String getConvergenceStatus​(int[] nodeIDs, boolean differencesOnly)
      Get the current mappings between desired state and actual state for the stateful entities in the SLEE on the specified nodes.
      String importConfiguration​(byte[] configBundle, ImportOptions options)
      Update the current desired state of the SLEE from a declarative configuration bundle supplied as a zip archive.
      boolean isConvergedToDesiredState()
      Determine if Rhino’s actual state is currently equal to the desired state.
      boolean isConvergedToDesiredState​(int[] nodeIDs)
      Determine if Rhino’s actual state is currently equal to the desired state on the specified nodes.
    • Field Detail

    • Method Detail

      • exportConfiguration

        byte[] exportConfiguration()
                            throws ManagementException

        Export the current state of the SLEE.

        The output from this method is binary data representing a zip archive of a declarative configuration bundle. YAML documents within the configuration bundle are UTF-8 encoded.

        Returns:
        binary data representing a zip archive of a declarative configuration bundle.
        Throws:
        ManagementException - if the export fails due to a system-level error.
        Since:
        Rhino 3.0.0
      • importConfiguration

        String importConfiguration​(byte[] configBundle,
                                   ImportOptions options)
                            throws NullPointerException,
                                   MalformedConfigBundleException,
                                   ManagementException

        Update the current desired state of the SLEE from a declarative configuration bundle supplied as a zip archive. YAML documents within the configuration bundle are expected to be UTF-8 encoded and will be parsed as such.

        This method takes the component and activation state information contained in the configuration bundle and attempts to update the desired state of the SLEE to match that requested by the imported configuration. As part of this process, the SLEE will validate the content of the configuration bundle to check whether or not it can be applied in its current form. Validation may fail for a number of reasons, including (but not limited to):

        • the configuration contains references to components that are expected to exist in the SLEE but don’t;

        • the configuration contains references to component properties such as SBB environment entries, resource adaptor configuration properties, profile attributes, etc, that don’t exist; or

        • the configuration specifies multiple different values for a single component property or other configuration item.

        This method returns a JSON-formatted string that reports the result of the import operation.

        …​FORMAT TBD…​

        Parameters:
        configBundle - binary data representing a zip archive of a declarative configuration bundle (UTF-8 encoded).
        options - options that parameterise import behaviour. May be null, in which case the default options will be used.
        Returns:
        a JSON-formatted string reporting the immediate result of the import operation.
        Throws:
        NullPointerException - if configBundle is null.
        MalformedConfigBundleException - if the format of the configuration bundle binary cannot be recognised or cannot be interpreted as containing the required documents.
        ManagementException - if the import fails due to a system-level error.
        Since:
        Rhino 3.0.0
      • isConvergedToDesiredState

        boolean isConvergedToDesiredState()
                                   throws ManagementException

        Determine if Rhino’s actual state is currently equal to the desired state. This method checks the state of the SLEE, services, and resource adaptor entities, in all namespaces.

        This method checks all event router nodes in the cluster. If any node is not converged to its desired state then this method will return false.

        Returns:
        true if the current actual state equals the desired state on all event router nodes, false otherwise.
        Throws:
        ManagementException - if the current state cannot be determined due to a system-level error.
        Since:
        Rhino 3.0.0
      • isConvergedToDesiredState

        boolean isConvergedToDesiredState​(int[] nodeIDs)
                                   throws NullPointerException,
                                          InvalidArgumentException,
                                          ManagementException

        Determine if Rhino’s actual state is currently equal to the desired state on the specified nodes. This method checks the state of the SLEE, services, and resource adaptor entities, in all namespaces.

        If any of the specified nodes are not converged to their desired state then this method will return false.

        When using the pool clustering mode, this method can only be used to check the convergence state of this node. Any other specified node ID will result in an InvalidArgumentException being thrown.

        Returns:
        true if the current actual state equals the desired state on the specified nodes, false otherwise.
        Throws:
        NullPointerException - if nodeIDs is null.
        InvalidArgumentException - if nodeIDs is zero-length, contains invalid node IDs, or contains a node ID that is not a current cluster member as determined by RhinoHousekeepingMBean.getAllClusterNodes().
        ManagementException - if the current state cannot be determined due to a system-level error.
        Since:
        Rhino 3.0.0
      • getConvergenceStatus

        String getConvergenceStatus​(boolean differencesOnly)
                             throws ManagementException

        Get the current mappings between desired state and actual state for the stateful entities in the SLEE on all event router nodes.

        This method returns a JSON-formatted string that reports the desired state and actual state for each service and resource adaptor entity in the SLEE, along with the desired state and actual state of the SLEE itself, across all namespaces. The output JSON document may optionally be restricted so that it only reports on entities where their desired state and actual state differ, thus allowing a user to quickly see outstanding convergence processes that are still running.

        Parameters:
        differencesOnly - boolean flag indicating whether this method should return information only on entities where the desired state and actual state differ (true) or whether information for all entities should be returned regardless (false).
        Returns:
        a JSON-formatted string reporting the current desired state vs actual state mappings.
        Throws:
        ManagementException - if the current state cannot be determined due to a system-level error.
        Since:
        Rhino 3.0.0
      • getConvergenceStatus

        String getConvergenceStatus​(int[] nodeIDs,
                                    boolean differencesOnly)
                             throws InvalidArgumentException,
                                    ManagementException

        Get the current mappings between desired state and actual state for the stateful entities in the SLEE on the specified nodes.

        This method returns a JSON-formatted string that reports the desired state and actual state for each service and resource adaptor entity in the SLEE, along with the desired state and actual state of the SLEE itself, across all namespaces. The output JSON document may optionally be restricted so that it only reports on entities where their desired state and actual state differ, thus allowing a user to quickly see outstanding convergence processes that are still running.

        When using the pool clustering mode, this method can only be used to obtain the convergence state of this node. Any other specified node ID will result in an InvalidArgumentException being thrown.

        Parameters:
        differencesOnly - boolean flag indicating whether this method should return information only on entities where the desired state and actual state differ (true) or whether information for all entities should be returned regardless (false).
        Returns:
        a JSON-formatted string reporting the current desired state vs actual state mappings.
        Throws:
        NullPointerException - if nodeIDs is null.
        InvalidArgumentException - if nodeIDs is zero-length, contains invalid node IDs, or contains a node ID that is not a current cluster member as determined by RhinoHousekeepingMBean.getAllClusterNodes().
        ManagementException - if the current state cannot be determined due to a system-level error.
        Since:
        Rhino 3.0.0
      • configureDefaultDesiredStateFromNode

        void configureDefaultDesiredStateFromNode​(int sourceNodeID)
                                           throws InvalidArgumentException,
                                                  ManagementException

        Set the default desired state of the SLEE, Services, and Resource Adaptor Entities based on the desired state of the specified node, then delete all per-node desired state (including state associated with non-member nodes).

        If the pool clustering mode is being used, this method has no useful purpose and will always throw a ManagementException.

        Parameters:
        sourceNodeID - the node ID of the node to set the default desired state from.
        Throws:
        InvalidArgumentException - if targetNodeID is an invalid node ID, or has no unique per-node state.
        ManagementException - if the default desired state could not be updated due to a system-level failure.
        Since:
        Rhino 3.0.0