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;
022import org.forgerock.opendj.ldap.schema.AttributeType;
023
024
025
026/**
027 * A server-side interface for querying SMTP Account Status
028 * Notification Handler settings.
029 * <p>
030 * The SMTP Account Status Notification Handler is a notification
031 * handler that sends email messages to end users and/or administrators
032 * whenever an account status notification is generated.
033 */
034public interface SMTPAccountStatusNotificationHandlerCfg extends AccountStatusNotificationHandlerCfg {
035
036  /**
037   * Gets the configuration class associated with this SMTP Account Status Notification Handler.
038   *
039   * @return Returns the configuration class associated with this SMTP Account Status Notification Handler.
040   */
041  Class<? extends SMTPAccountStatusNotificationHandlerCfg> configurationClass();
042
043
044
045  /**
046   * Register to be notified when this SMTP Account Status Notification Handler is changed.
047   *
048   * @param listener
049   *          The SMTP Account Status Notification Handler configuration change listener.
050   */
051  void addSMTPChangeListener(ConfigurationChangeListener<SMTPAccountStatusNotificationHandlerCfg> listener);
052
053
054
055  /**
056   * Deregister an existing SMTP Account Status Notification Handler configuration change listener.
057   *
058   * @param listener
059   *          The SMTP Account Status Notification Handler configuration change listener.
060   */
061  void removeSMTPChangeListener(ConfigurationChangeListener<SMTPAccountStatusNotificationHandlerCfg> listener);
062
063
064
065  /**
066   * Gets the "email-address-attribute-type" property.
067   * <p>
068   * Specifies which attribute in the user's entries may be used to
069   * obtain the email address when notifying the end user.
070   * <p>
071   * You can specify more than one email address as separate values.
072   * In this case, the OpenDJ server sends a notification to all email
073   * addresses identified.
074   *
075   * @return Returns an unmodifiable set containing the values of the "email-address-attribute-type" property.
076   */
077  SortedSet<AttributeType> getEmailAddressAttributeType();
078
079
080
081  /**
082   * Gets the "java-class" property.
083   * <p>
084   * Specifies the fully-qualified name of the Java class that
085   * provides the SMTP Account Status Notification Handler
086   * implementation.
087   *
088   * @return Returns the value of the "java-class" property.
089   */
090  String getJavaClass();
091
092
093
094  /**
095   * Gets the "message-subject" property.
096   * <p>
097   * Specifies the subject that should be used for email messages
098   * generated by this account status notification handler.
099   * <p>
100   * The values for this property should begin with the name of an
101   * account status notification type followed by a colon and the
102   * subject that should be used for the associated notification
103   * message. If an email message is generated for an account status
104   * notification type for which no subject is defined, then that
105   * message is given a generic subject.
106   *
107   * @return Returns an unmodifiable set containing the values of the "message-subject" property.
108   */
109  SortedSet<String> getMessageSubject();
110
111
112
113  /**
114   * Gets the "message-template-file" property.
115   * <p>
116   * Specifies the path to the file containing the message template to
117   * generate the email notification messages.
118   * <p>
119   * The values for this property should begin with the name of an
120   * account status notification type followed by a colon and the path
121   * to the template file that should be used for that notification
122   * type. If an account status notification has a notification type
123   * that is not associated with a message template file, then no email
124   * message is generated for that notification.
125   *
126   * @return Returns an unmodifiable set containing the values of the "message-template-file" property.
127   */
128  SortedSet<String> getMessageTemplateFile();
129
130
131
132  /**
133   * Gets the "recipient-address" property.
134   * <p>
135   * Specifies an email address to which notification messages are
136   * sent, either instead of or in addition to the end user for whom
137   * the notification has been generated.
138   * <p>
139   * This may be used to ensure that server administrators also
140   * receive a copy of any notification messages that are generated.
141   *
142   * @return Returns an unmodifiable set containing the values of the "recipient-address" property.
143   */
144  SortedSet<String> getRecipientAddress();
145
146
147
148  /**
149   * Gets the "send-email-as-html" property.
150   * <p>
151   * Indicates whether an email notification message should be sent as
152   * HTML.
153   * <p>
154   * If this value is true, email notification messages are marked as
155   * text/html. Otherwise outgoing email messages are assumed to be
156   * plaintext and marked as text/plain.
157   *
158   * @return Returns the value of the "send-email-as-html" property.
159   */
160  boolean isSendEmailAsHtml();
161
162
163
164  /**
165   * Gets the "sender-address" property.
166   * <p>
167   * Specifies the email address from which the message is sent. Note
168   * that this does not necessarily have to be a legitimate email
169   * address.
170   *
171   * @return Returns the value of the "sender-address" property.
172   */
173  String getSenderAddress();
174
175
176
177  /**
178   * Gets the "send-message-without-end-user-address" property.
179   * <p>
180   * Indicates whether an email notification message should be
181   * generated and sent to the set of notification recipients even if
182   * the user entry does not contain any values for any of the email
183   * address attributes (that is, in cases when it is not be possible
184   * to notify the end user).
185   * <p>
186   * This is only applicable if both one or more email address
187   * attribute types and one or more additional recipient addresses are
188   * specified.
189   *
190   * @return Returns the value of the "send-message-without-end-user-address" property.
191   */
192  boolean isSendMessageWithoutEndUserAddress();
193
194}