public class JMXAlertHandler extends NotificationBroadcasterSupport implements AlertHandler<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>, org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>, DynamicMBean, DirectoryServerMBean
Constructor and Description |
---|
JMXAlertHandler()
Creates a new instance of this JMX alert handler.
|
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg configuration) |
void |
finalizeAlertHandler()
Performs any necessary cleanup that may be necessary when this
alert handler is finalized.
|
org.forgerock.opendj.server.config.server.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(org.forgerock.opendj.server.config.server.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(org.forgerock.opendj.server.config.server.AlertHandlerCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for
this alert handler.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg configuration,
List<LocalizableMessage> unacceptableReasons) |
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(org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg configuration) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
AlertHandler
initializeAlertHandler
in interface AlertHandler<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>
configuration
- The configuration to use to initialize
this alert handler.org.forgerock.opendj.config.server.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 org.forgerock.opendj.server.config.server.AlertHandlerCfg getAlertHandlerConfiguration()
AlertHandler
getAlertHandlerConfiguration
in interface AlertHandler<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>
public boolean isConfigurationAcceptable(org.forgerock.opendj.server.config.server.AlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons)
AlertHandler
isConfigurationAcceptable
in interface AlertHandler<org.forgerock.opendj.server.config.server.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 void finalizeAlertHandler()
AlertHandler
finalizeAlertHandler
in interface AlertHandler<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>
public ObjectName getObjectName()
getObjectName
in interface DirectoryServerMBean
public void sendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage)
AlertHandler
sendAlertNotification
in interface AlertHandler<org.forgerock.opendj.server.config.server.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 isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg configuration)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.JmxAlertHandlerCfg>
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.