Class JMXAlertHandler

    • Constructor Detail

      • JMXAlertHandler

        public JMXAlertHandler()
        Creates a new instance of this JMX alert handler. No initialization should be done here, as it should all be performed in the initializeAlertHandler method.
    • Method Detail

      • isConfigurationAcceptable

        public boolean isConfigurationAcceptable​(AlertHandlerCfg configuration,
                                                 List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
        Description copied from interface: AlertHandler
        Indicates whether the provided configuration is acceptable for this alert handler.
        Specified by:
        isConfigurationAcceptable in interface AlertHandler<JMXAlertHandlerCfg>
        Parameters:
        configuration - The configuration for which to make tje determination.
        unacceptableReasons - A list to which human-readable reasons may be added to explain why the configuration is not acceptable.
        Returns:
        true if the provided configuration is acceptable, or false if it is not.
      • getObjectName

        public ObjectName getObjectName()
        Retrieves the JMX object name for this JMX alert handler.
        Specified by:
        getObjectName in interface DirectoryServerMBean
        Returns:
        The JMX object name for this JMX alert handler.
      • sendAlertNotification

        public void sendAlertNotification​(AlertGenerator generator,
                                          String alertType,
                                          org.forgerock.i18n.LocalizableMessage alertMessage)
        Description copied from interface: AlertHandler
        Sends an alert notification based on the provided information.
        Specified by:
        sendAlertNotification in interface AlertHandler<JMXAlertHandlerCfg>
        Parameters:
        generator - The alert generator that created the alert.
        alertType - The alert type name for this alert.
        alertMessage - A message (possibly null) that can provide more information about this alert.
      • getAttributes

        public AttributeList getAttributes​(String[] attributes)
        Get the values of several attributes of the Dynamic MBean.
        Specified by:
        getAttributes in interface DynamicMBean
        Parameters:
        attributes - A list of the attributes to be retrieved.
        Returns:
        The list of attributes retrieved.
      • setAttributes

        public AttributeList setAttributes​(AttributeList attributes)
        Sets the values of several attributes of the Dynamic MBean.
        Specified by:
        setAttributes in interface DynamicMBean
        Parameters:
        attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
        Returns:
        The list of attributes that were set with their new values.
      • invoke

        public Object invoke​(String actionName,
                             Object[] params,
                             String[] signature)
                      throws MBeanException
        Allows an action to be invoked on the Dynamic MBean.
        Specified by:
        invoke in interface DynamicMBean
        Parameters:
        actionName - The name of the action to be invoked.
        params - An array containing the parameters to be set when the action is invoked.
        signature - An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which action is invoked.
        Returns:
        The object returned by the action, which represents the result of invoking the action on the MBean specified.
        Throws:
        MBeanException - If a problem is encountered while invoking the method.
      • getMBeanInfo

        public MBeanInfo getMBeanInfo()
        Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
        Specified by:
        getMBeanInfo in interface DynamicMBean
        Returns:
        An instance of MBeanInfo allowing all attributes and actions exposed by this Dynamic MBean to be retrieved.
      • isConfigurationChangeAcceptable

        public boolean isConfigurationChangeAcceptable​(JMXAlertHandlerCfg configuration,
                                                       List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
        Description copied from interface: ConfigurationChangeListener
        Indicates whether the proposed change to the configuration is acceptable to this change listener.
        Specified by:
        isConfigurationChangeAcceptable in interface ConfigurationChangeListener<JMXAlertHandlerCfg>
        Parameters:
        configuration - The new configuration containing the changes.
        unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
        Returns:
        Returns true if the proposed change is acceptable, or false if it is not.