001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.admin.std.client;
027
028
029
030import java.util.Collection;
031import java.util.SortedSet;
032import org.opends.server.admin.ManagedObjectDefinition;
033import org.opends.server.admin.PropertyException;
034import org.opends.server.admin.std.server.SMTPAccountStatusNotificationHandlerCfg;
035import org.opends.server.types.AttributeType;
036
037
038
039/**
040 * A client-side interface for reading and modifying SMTP Account
041 * Status Notification Handler settings.
042 * <p>
043 * The SMTP Account Status Notification Handler is a notification
044 * handler that sends email messages to end users and/or administrators
045 * whenever an account status notification is generated.
046 */
047public interface SMTPAccountStatusNotificationHandlerCfgClient extends AccountStatusNotificationHandlerCfgClient {
048
049  /**
050   * Get the configuration definition associated with this SMTP Account Status Notification Handler.
051   *
052   * @return Returns the configuration definition associated with this SMTP Account Status Notification Handler.
053   */
054  ManagedObjectDefinition<? extends SMTPAccountStatusNotificationHandlerCfgClient, ? extends SMTPAccountStatusNotificationHandlerCfg> definition();
055
056
057
058  /**
059   * Gets the "email-address-attribute-type" property.
060   * <p>
061   * Specifies which attribute in the user's entries may be used to
062   * obtain the email address when notifying the end user.
063   * <p>
064   * You can specify more than one email address as separate values.
065   * In this case, the OpenDJ server sends a notification to all email
066   * addresses identified.
067   *
068   * @return Returns the values of the "email-address-attribute-type" property.
069   */
070  SortedSet<AttributeType> getEmailAddressAttributeType();
071
072
073
074  /**
075   * Sets the "email-address-attribute-type" property.
076   * <p>
077   * Specifies which attribute in the user's entries may be used to
078   * obtain the email address when notifying the end user.
079   * <p>
080   * You can specify more than one email address as separate values.
081   * In this case, the OpenDJ server sends a notification to all email
082   * addresses identified.
083   *
084   * @param values The values of the "email-address-attribute-type" property.
085   * @throws PropertyException
086   *           If one or more of the new values are invalid.
087   */
088  void setEmailAddressAttributeType(Collection<AttributeType> values) throws PropertyException;
089
090
091
092  /**
093   * Gets the "java-class" property.
094   * <p>
095   * Specifies the fully-qualified name of the Java class that
096   * provides the SMTP Account Status Notification Handler
097   * implementation.
098   *
099   * @return Returns the value of the "java-class" property.
100   */
101  String getJavaClass();
102
103
104
105  /**
106   * Sets the "java-class" property.
107   * <p>
108   * Specifies the fully-qualified name of the Java class that
109   * provides the SMTP Account Status Notification Handler
110   * implementation.
111   *
112   * @param value The value of the "java-class" property.
113   * @throws PropertyException
114   *           If the new value is invalid.
115   */
116  void setJavaClass(String value) throws PropertyException;
117
118
119
120  /**
121   * Gets the "message-subject" property.
122   * <p>
123   * Specifies the subject that should be used for email messages
124   * generated by this account status notification handler.
125   * <p>
126   * The values for this property should begin with the name of an
127   * account status notification type followed by a colon and the
128   * subject that should be used for the associated notification
129   * message. If an email message is generated for an account status
130   * notification type for which no subject is defined, then that
131   * message is given a generic subject.
132   *
133   * @return Returns the values of the "message-subject" property.
134   */
135  SortedSet<String> getMessageSubject();
136
137
138
139  /**
140   * Sets the "message-subject" property.
141   * <p>
142   * Specifies the subject that should be used for email messages
143   * generated by this account status notification handler.
144   * <p>
145   * The values for this property should begin with the name of an
146   * account status notification type followed by a colon and the
147   * subject that should be used for the associated notification
148   * message. If an email message is generated for an account status
149   * notification type for which no subject is defined, then that
150   * message is given a generic subject.
151   *
152   * @param values The values of the "message-subject" property.
153   * @throws PropertyException
154   *           If one or more of the new values are invalid.
155   */
156  void setMessageSubject(Collection<String> values) throws PropertyException;
157
158
159
160  /**
161   * Gets the "message-template-file" property.
162   * <p>
163   * Specifies the path to the file containing the message template to
164   * generate the email notification messages.
165   * <p>
166   * The values for this property should begin with the name of an
167   * account status notification type followed by a colon and the path
168   * to the template file that should be used for that notification
169   * type. If an account status notification has a notification type
170   * that is not associated with a message template file, then no email
171   * message is generated for that notification.
172   *
173   * @return Returns the values of the "message-template-file" property.
174   */
175  SortedSet<String> getMessageTemplateFile();
176
177
178
179  /**
180   * Sets the "message-template-file" property.
181   * <p>
182   * Specifies the path to the file containing the message template to
183   * generate the email notification messages.
184   * <p>
185   * The values for this property should begin with the name of an
186   * account status notification type followed by a colon and the path
187   * to the template file that should be used for that notification
188   * type. If an account status notification has a notification type
189   * that is not associated with a message template file, then no email
190   * message is generated for that notification.
191   *
192   * @param values The values of the "message-template-file" property.
193   * @throws PropertyException
194   *           If one or more of the new values are invalid.
195   */
196  void setMessageTemplateFile(Collection<String> values) throws PropertyException;
197
198
199
200  /**
201   * Gets the "recipient-address" property.
202   * <p>
203   * Specifies an email address to which notification messages are
204   * sent, either instead of or in addition to the end user for whom
205   * the notification has been generated.
206   * <p>
207   * This may be used to ensure that server administrators also
208   * receive a copy of any notification messages that are generated.
209   *
210   * @return Returns the values of the "recipient-address" property.
211   */
212  SortedSet<String> getRecipientAddress();
213
214
215
216  /**
217   * Sets the "recipient-address" property.
218   * <p>
219   * Specifies an email address to which notification messages are
220   * sent, either instead of or in addition to the end user for whom
221   * the notification has been generated.
222   * <p>
223   * This may be used to ensure that server administrators also
224   * receive a copy of any notification messages that are generated.
225   *
226   * @param values The values of the "recipient-address" property.
227   * @throws PropertyException
228   *           If one or more of the new values are invalid.
229   */
230  void setRecipientAddress(Collection<String> values) throws PropertyException;
231
232
233
234  /**
235   * Gets the "send-email-as-html" property.
236   * <p>
237   * Indicates whether an email notification message should be sent as
238   * HTML.
239   * <p>
240   * If this value is true, email notification messages are marked as
241   * text/html. Otherwise outgoing email messages are assumed to be
242   * plaintext and marked as text/plain.
243   *
244   * @return Returns the value of the "send-email-as-html" property.
245   */
246  boolean isSendEmailAsHtml();
247
248
249
250  /**
251   * Sets the "send-email-as-html" property.
252   * <p>
253   * Indicates whether an email notification message should be sent as
254   * HTML.
255   * <p>
256   * If this value is true, email notification messages are marked as
257   * text/html. Otherwise outgoing email messages are assumed to be
258   * plaintext and marked as text/plain.
259   *
260   * @param value The value of the "send-email-as-html" property.
261   * @throws PropertyException
262   *           If the new value is invalid.
263   */
264  void setSendEmailAsHtml(Boolean value) throws PropertyException;
265
266
267
268  /**
269   * Gets the "sender-address" property.
270   * <p>
271   * Specifies the email address from which the message is sent. Note
272   * that this does not necessarily have to be a legitimate email
273   * address.
274   *
275   * @return Returns the value of the "sender-address" property.
276   */
277  String getSenderAddress();
278
279
280
281  /**
282   * Sets the "sender-address" property.
283   * <p>
284   * Specifies the email address from which the message is sent. Note
285   * that this does not necessarily have to be a legitimate email
286   * address.
287   *
288   * @param value The value of the "sender-address" property.
289   * @throws PropertyException
290   *           If the new value is invalid.
291   */
292  void setSenderAddress(String value) throws PropertyException;
293
294
295
296  /**
297   * Gets the "send-message-without-end-user-address" property.
298   * <p>
299   * Indicates whether an email notification message should be
300   * generated and sent to the set of notification recipients even if
301   * the user entry does not contain any values for any of the email
302   * address attributes (that is, in cases when it is not be possible
303   * to notify the end user).
304   * <p>
305   * This is only applicable if both one or more email address
306   * attribute types and one or more additional recipient addresses are
307   * specified.
308   *
309   * @return Returns the value of the "send-message-without-end-user-address" property.
310   */
311  boolean isSendMessageWithoutEndUserAddress();
312
313
314
315  /**
316   * Sets the "send-message-without-end-user-address" property.
317   * <p>
318   * Indicates whether an email notification message should be
319   * generated and sent to the set of notification recipients even if
320   * the user entry does not contain any values for any of the email
321   * address attributes (that is, in cases when it is not be possible
322   * to notify the end user).
323   * <p>
324   * This is only applicable if both one or more email address
325   * attribute types and one or more additional recipient addresses are
326   * specified.
327   *
328   * @param value The value of the "send-message-without-end-user-address" property.
329   * @throws PropertyException
330   *           If the new value is invalid.
331   */
332  void setSendMessageWithoutEndUserAddress(boolean value) throws PropertyException;
333
334}