public class JMXAlertHandler extends NotificationBroadcasterSupport implements AlertHandler<JmxAlertHandlerCfg>, ConfigurationChangeListener<JmxAlertHandlerCfg>, DynamicMBean, DirectoryServerMBean
Constructor and Description |
---|
JMXAlertHandler()
Creates a new instance of this JMX alert handler.
|
Modifier and Type | Method and Description |
---|---|
ConfigChangeResult |
applyConfigurationChange(JmxAlertHandlerCfg configuration)
Applies the configuration changes to this change listener.
|
void |
finalizeAlertHandler()
Performs any necessary cleanup that may be necessary when this alert handler is finalized.
|
AlertHandlerCfg |
getAlertHandlerConfiguration()
Retrieves the current configuration for this alert handler.
|
Attribute |
getAttribute(String attribute)
Obtain the value of a specific attribute of the Dynamic MBean.
|
AttributeList |
getAttributes(String[] attributes)
Get the values of several attributes of the Dynamic MBean.
|
MBeanInfo |
getMBeanInfo()
Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
|
MBeanNotificationInfo[] |
getNotificationInfo()
Retrieves information about the types of JMX notifications that may be generated.
|
ObjectName |
getObjectName()
Retrieves the JMX object name for this JMX alert handler.
|
void |
initializeAlertHandler(JmxAlertHandlerCfg configuration)
Initializes this alert handler based on the information in the provided configuration entry.
|
Object |
invoke(String actionName,
Object[] params,
String[] signature)
Allows an action to be invoked on the Dynamic MBean.
|
boolean |
isConfigurationAcceptable(JmxAlertHandlerCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this alert handler.
|
boolean |
isConfigurationChangeAcceptable(JmxAlertHandlerCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable
to this change listener.
|
void |
sendAlertNotification(AlertGenerator generator,
String alertType,
LocalizableMessage alertMessage)
Sends an alert notification based on the provided information.
|
void |
setAttribute(Attribute attribute)
Set the value of a specific attribute of the Dynamic MBean.
|
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of several attributes of the Dynamic MBean.
|
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
public JMXAlertHandler()
initializeAlertHandler
method.public void initializeAlertHandler(JmxAlertHandlerCfg configuration) throws ConfigException, InitializationException
AlertHandler
initializeAlertHandler
in interface AlertHandler<JmxAlertHandlerCfg>
configuration
- The configuration to use to initialize this alert handler.ConfigException
- If the provided entry does not contain a valid configuration for this alert handler.InitializationException
- If a problem occurs during initialization that is not related to the server configuration.public AlertHandlerCfg getAlertHandlerConfiguration()
AlertHandler
getAlertHandlerConfiguration
in interface AlertHandler<JmxAlertHandlerCfg>
public void finalizeAlertHandler()
AlertHandler
finalizeAlertHandler
in interface AlertHandler<JmxAlertHandlerCfg>
public ObjectName getObjectName()
getObjectName
in interface DirectoryServerMBean
public void sendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage)
AlertHandler
sendAlertNotification
in interface AlertHandler<JmxAlertHandlerCfg>
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.public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
getNotificationInfo
in class NotificationBroadcasterSupport
public Attribute getAttribute(String attribute) throws AttributeNotFoundException
getAttribute
in interface DynamicMBean
attribute
- The name of the attribute to be retrieved.AttributeNotFoundException
- If the specified attribute is not associated with this MBean.public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException
setAttribute
in interface DynamicMBean
attribute
- The identification of the attribute to be set and the value it is to be set to.AttributeNotFoundException
- If the specified attribute is not associated with this MBean.InvalidAttributeValueException
- If the provided value is not acceptable for this MBean.public AttributeList getAttributes(String[] attributes)
getAttributes
in interface DynamicMBean
attributes
- A list of the attributes to be retrieved.public AttributeList setAttributes(AttributeList attributes)
setAttributes
in interface DynamicMBean
attributes
- A list of attributes: The identification of the attributes to be set and the values they are to be set
to.public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException
invoke
in interface DynamicMBean
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.MBeanException
- If a problem is encountered while invoking the method.public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean
MBeanInfo
allowing all attributes and actions exposed by this Dynamic MBean
to be retrieved.public boolean isConfigurationAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons)
AlertHandler
isConfigurationAcceptable
in interface AlertHandler<JmxAlertHandlerCfg>
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.true
if the provided configuration is acceptable, or false
if it is not.public boolean isConfigurationChangeAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListener
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<JmxAlertHandlerCfg>
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.true
if the proposed change is acceptable,
or false
if it is not.public ConfigChangeResult applyConfigurationChange(JmxAlertHandlerCfg configuration)
ConfigurationChangeListener
applyConfigurationChange
in interface ConfigurationChangeListener<JmxAlertHandlerCfg>
configuration
- The new configuration containing the changes.Copyright 2010-2022 ForgeRock AS.