| | |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.util.EMailMessage; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a Directory Server alert handler that may be used to |
| | | * send administrative alerts via SMTP. |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | |
| | | /** The current configuration for this alert handler. */ |
| | | private SMTPAlertHandlerCfg currentConfig; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of this SMTP alert handler. |
| | | */ |
| | | /** Creates a new instance of this SMTP alert handler. */ |
| | | public SMTPAlertHandler() |
| | | { |
| | | super(); |
| | |
| | | // All initialization should be done in the initializeAlertHandler method. |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeAlertHandler(SMTPAlertHandlerCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | currentConfig = configuration; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AlertHandlerCfg getAlertHandlerConfiguration() |
| | | { |
| | | return currentConfig; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(AlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeAlertHandler() |
| | | { |
| | | // No action is required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void sendAlertNotification(AlertGenerator generator, String alertType, |
| | | LocalizableMessage alertMessage) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Replaces any occurrences of special tokens in the given string with the |
| | | * appropriate value. Tokens supported include: |
| | |
| | | replace("\\n", "\r\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SMTPAlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SMTPAlertHandlerCfg configuration) |
| | | { |