| | |
| | | import javax.management.NotificationBroadcasterSupport; |
| | | import javax.management.ObjectName; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.AlertHandlerCfg; |
| | | import org.opends.server.api.AlertGenerator; |
| | | import org.opends.server.api.AlertHandler; |
| | |
| | | import org.opends.server.config.JMXMBean; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | |
| | | */ |
| | | public class JMXAlertHandler |
| | | extends NotificationBroadcasterSupport |
| | | implements AlertHandler<AlertHandlerCfg>, DynamicMBean, |
| | | implements AlertHandler<AlertHandlerCfg>, |
| | | ConfigurationChangeListener<AlertHandlerCfg>, DynamicMBean, |
| | | DirectoryServerMBean |
| | | { |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | // The current configuration for this alert handler. |
| | | private AlertHandlerCfg currentConfig; |
| | | |
| | | // The sequence number generator used for this alert handler. |
| | | private AtomicLong sequenceNumber; |
| | | |
| | |
| | | throw new InitializationException(msgID, message, e); |
| | | } |
| | | } |
| | | |
| | | configuration.addChangeListener(this); |
| | | currentConfig = configuration; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public AlertHandlerCfg getAlertHandlerConfiguration() |
| | | { |
| | | return currentConfig; |
| | | } |
| | | |
| | | |
| | |
| | | new MBeanAttributeInfo[0], new MBeanConstructorInfo[0], |
| | | new MBeanOperationInfo[0], getNotificationInfo()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable(AlertHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AlertHandlerCfg configuration) |
| | | { |
| | | currentConfig = configuration; |
| | | |
| | | return new ConfigChangeResult(ResultCode.SUCCESS, false); |
| | | } |
| | | } |
| | | |