001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.server;
017
018
019
020import java.util.SortedSet;
021import org.forgerock.opendj.config.server.ConfigurationChangeListener;
022
023
024
025/**
026 * A server-side interface for querying SMTP Alert Handler settings.
027 * <p>
028 * The SMTP Alert Handler may be used to send e-mail messages to
029 * notify administrators of significant events that occur within the
030 * server.
031 */
032public interface SMTPAlertHandlerCfg extends AlertHandlerCfg {
033
034  /**
035   * Gets the configuration class associated with this SMTP Alert Handler.
036   *
037   * @return Returns the configuration class associated with this SMTP Alert Handler.
038   */
039  Class<? extends SMTPAlertHandlerCfg> configurationClass();
040
041
042
043  /**
044   * Register to be notified when this SMTP Alert Handler is changed.
045   *
046   * @param listener
047   *          The SMTP Alert Handler configuration change listener.
048   */
049  void addSMTPChangeListener(ConfigurationChangeListener<SMTPAlertHandlerCfg> listener);
050
051
052
053  /**
054   * Deregister an existing SMTP Alert Handler configuration change listener.
055   *
056   * @param listener
057   *          The SMTP Alert Handler configuration change listener.
058   */
059  void removeSMTPChangeListener(ConfigurationChangeListener<SMTPAlertHandlerCfg> listener);
060
061
062
063  /**
064   * Gets the "java-class" property.
065   * <p>
066   * Specifies the fully-qualified name of the Java class that
067   * provides the SMTP Alert Handler implementation.
068   *
069   * @return Returns the value of the "java-class" property.
070   */
071  String getJavaClass();
072
073
074
075  /**
076   * Gets the "message-body" property.
077   * <p>
078   * Specifies the body that should be used for email messages
079   * generated by this alert handler.
080   * <p>
081   * The token "%%%%alert-type%%%%" is dynamically replaced with the
082   * alert type string. The token "%%%%alert-id%%%%" is dynamically
083   * replaced with the alert ID value. The token
084   * "%%%%alert-message%%%%" is dynamically replaced with the alert
085   * message. The token "\\n" is replaced with an end-of-line marker.
086   *
087   * @return Returns the value of the "message-body" property.
088   */
089  String getMessageBody();
090
091
092
093  /**
094   * Gets the "message-subject" property.
095   * <p>
096   * Specifies the subject that should be used for email messages
097   * generated by this alert handler.
098   * <p>
099   * The token "%%%%alert-type%%%%" is dynamically replaced with the
100   * alert type string. The token "%%%%alert-id%%%%" is dynamically
101   * replaced with the alert ID value. The token
102   * "%%%%alert-message%%%%" is dynamically replaced with the alert
103   * message. The token "\\n" is replaced with an end-of-line marker.
104   *
105   * @return Returns the value of the "message-subject" property.
106   */
107  String getMessageSubject();
108
109
110
111  /**
112   * Gets the "recipient-address" property.
113   * <p>
114   * Specifies an email address to which the messages should be sent.
115   * <p>
116   * Multiple values may be provided if there should be more than one
117   * recipient.
118   *
119   * @return Returns an unmodifiable set containing the values of the "recipient-address" property.
120   */
121  SortedSet<String> getRecipientAddress();
122
123
124
125  /**
126   * Gets the "sender-address" property.
127   * <p>
128   * Specifies the email address to use as the sender for messages
129   * generated by this alert handler.
130   *
131   * @return Returns the value of the "sender-address" property.
132   */
133  String getSenderAddress();
134
135}