Class JMXAlertHandler
java.lang.Object
javax.management.NotificationBroadcasterSupport
org.opends.server.extensions.JMXAlertHandler
- All Implemented Interfaces:
DynamicMBean, NotificationBroadcaster, NotificationEmitter, ConfigurationChangeListener<JmxAlertHandlerCfg>, AlertHandler<JmxAlertHandlerCfg>, DirectoryServerMBean
public final class JMXAlertHandler
extends NotificationBroadcasterSupport
implements AlertHandler<JmxAlertHandlerCfg>, ConfigurationChangeListener<JmxAlertHandlerCfg>, DynamicMBean, DirectoryServerMBean
This class provides an implementation of a Directory Server alert handler that will send alerts using JMX
notifications.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyConfigurationChange(JmxAlertHandlerCfg configuration) Applies the configuration changes to this change listener.Returns the current configuration for this alert handler.getAttribute(String attribute) getAttributes(String[] attributes) Returns information about the types of JMX notifications that may be generated.Returns the JMX object name for this JMX alert handler.voidinitializeAlertHandler(ServerContext serverContext, JmxAlertHandlerCfg configuration) Initializes this alert handler based on the information in the provided configuration entry.booleanisConfigurationAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this alert handler.booleanisConfigurationChangeAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.voidsendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Sends an alert notification based on the provided information.voidsetAttribute(Attribute attribute) setAttributes(AttributeList attributes) Methods inherited from class NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AlertHandler
finalizeAlertHandler
-
Constructor Details
-
JMXAlertHandler
public JMXAlertHandler()
-
-
Method Details
-
initializeAlertHandler
public void initializeAlertHandler(ServerContext serverContext, JmxAlertHandlerCfg configuration) throws InitializationException Description copied from interface:AlertHandlerInitializes this alert handler based on the information in the provided configuration entry.- Specified by:
initializeAlertHandlerin interfaceAlertHandler<JmxAlertHandlerCfg>- Parameters:
serverContext- The server contextconfiguration- The configuration to use to initialize this alert handler.- Throws:
InitializationException- If a problem occurs during initialization that is not related to the server configuration.
-
getAlertHandlerConfiguration
Description copied from interface:AlertHandlerReturns the current configuration for this alert handler.- Specified by:
getAlertHandlerConfigurationin interfaceAlertHandler<JmxAlertHandlerCfg>- Returns:
- the current configuration for this alert handler
-
getObjectName
Returns the JMX object name for this JMX alert handler.- Specified by:
getObjectNamein interfaceDirectoryServerMBean- Returns:
- the JMX object name for this JMX alert handler
-
sendAlertNotification
public void sendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Description copied from interface:AlertHandlerSends an alert notification based on the provided information.- Specified by:
sendAlertNotificationin interfaceAlertHandler<JmxAlertHandlerCfg>- Parameters:
generator- The alert generator that created the alert.alertType- The alert type name for this alert.alertMessage- A message (possiblynull) that can provide more information about this alert.
-
getNotificationInfo
Returns information about the types of JMX notifications that may be generated.- Specified by:
getNotificationInfoin interfaceNotificationBroadcaster- Overrides:
getNotificationInfoin classNotificationBroadcasterSupport- Returns:
- information about the types of JMX notifications that may be generated
-
getAttribute
- Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundException
-
setAttribute
- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundException
-
getAttributes
- Specified by:
getAttributesin interfaceDynamicMBean
-
setAttributes
- Specified by:
setAttributesin interfaceDynamicMBean
-
invoke
- Specified by:
invokein interfaceDynamicMBean- Throws:
MBeanException
-
getMBeanInfo
- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:AlertHandlerIndicates whether the provided configuration is acceptable for this alert handler.- Specified by:
isConfigurationAcceptablein interfaceAlertHandler<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:
trueif the provided configuration is acceptable, orfalseif it is not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(JmxAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<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
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<JmxAlertHandlerCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-