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.SMTPAlertHandlerCfg;
035
036
037
038/**
039 * A client-side interface for reading and modifying SMTP Alert
040 * Handler settings.
041 * <p>
042 * The SMTP Alert Handler may be used to send e-mail messages to
043 * notify administrators of significant events that occur within the
044 * server.
045 */
046public interface SMTPAlertHandlerCfgClient extends AlertHandlerCfgClient {
047
048  /**
049   * Get the configuration definition associated with this SMTP Alert Handler.
050   *
051   * @return Returns the configuration definition associated with this SMTP Alert Handler.
052   */
053  ManagedObjectDefinition<? extends SMTPAlertHandlerCfgClient, ? extends SMTPAlertHandlerCfg> definition();
054
055
056
057  /**
058   * Gets the "java-class" property.
059   * <p>
060   * Specifies the fully-qualified name of the Java class that
061   * provides the SMTP Alert Handler implementation.
062   *
063   * @return Returns the value of the "java-class" property.
064   */
065  String getJavaClass();
066
067
068
069  /**
070   * Sets the "java-class" property.
071   * <p>
072   * Specifies the fully-qualified name of the Java class that
073   * provides the SMTP Alert Handler implementation.
074   *
075   * @param value The value of the "java-class" property.
076   * @throws PropertyException
077   *           If the new value is invalid.
078   */
079  void setJavaClass(String value) throws PropertyException;
080
081
082
083  /**
084   * Gets the "message-body" property.
085   * <p>
086   * Specifies the body that should be used for email messages
087   * generated by this alert handler.
088   * <p>
089   * The token "%%%%alert-type%%%%" is dynamically replaced with the
090   * alert type string. The token "%%%%alert-id%%%%" is dynamically
091   * replaced with the alert ID value. The token
092   * "%%%%alert-message%%%%" is dynamically replaced with the alert
093   * message. The token "\\n" is replaced with an end-of-line marker.
094   *
095   * @return Returns the value of the "message-body" property.
096   */
097  String getMessageBody();
098
099
100
101  /**
102   * Sets the "message-body" property.
103   * <p>
104   * Specifies the body that should be used for email messages
105   * generated by this alert handler.
106   * <p>
107   * The token "%%%%alert-type%%%%" is dynamically replaced with the
108   * alert type string. The token "%%%%alert-id%%%%" is dynamically
109   * replaced with the alert ID value. The token
110   * "%%%%alert-message%%%%" is dynamically replaced with the alert
111   * message. The token "\\n" is replaced with an end-of-line marker.
112   *
113   * @param value The value of the "message-body" property.
114   * @throws PropertyException
115   *           If the new value is invalid.
116   */
117  void setMessageBody(String value) throws PropertyException;
118
119
120
121  /**
122   * Gets the "message-subject" property.
123   * <p>
124   * Specifies the subject that should be used for email messages
125   * generated by this alert handler.
126   * <p>
127   * The token "%%%%alert-type%%%%" is dynamically replaced with the
128   * alert type string. The token "%%%%alert-id%%%%" is dynamically
129   * replaced with the alert ID value. The token
130   * "%%%%alert-message%%%%" is dynamically replaced with the alert
131   * message. The token "\\n" is replaced with an end-of-line marker.
132   *
133   * @return Returns the value of the "message-subject" property.
134   */
135  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 alert handler.
144   * <p>
145   * The token "%%%%alert-type%%%%" is dynamically replaced with the
146   * alert type string. The token "%%%%alert-id%%%%" is dynamically
147   * replaced with the alert ID value. The token
148   * "%%%%alert-message%%%%" is dynamically replaced with the alert
149   * message. The token "\\n" is replaced with an end-of-line marker.
150   *
151   * @param value The value of the "message-subject" property.
152   * @throws PropertyException
153   *           If the new value is invalid.
154   */
155  void setMessageSubject(String value) throws PropertyException;
156
157
158
159  /**
160   * Gets the "recipient-address" property.
161   * <p>
162   * Specifies an email address to which the messages should be sent.
163   * <p>
164   * Multiple values may be provided if there should be more than one
165   * recipient.
166   *
167   * @return Returns the values of the "recipient-address" property.
168   */
169  SortedSet<String> getRecipientAddress();
170
171
172
173  /**
174   * Sets the "recipient-address" property.
175   * <p>
176   * Specifies an email address to which the messages should be sent.
177   * <p>
178   * Multiple values may be provided if there should be more than one
179   * recipient.
180   *
181   * @param values The values of the "recipient-address" property.
182   * @throws PropertyException
183   *           If one or more of the new values are invalid.
184   */
185  void setRecipientAddress(Collection<String> values) throws PropertyException;
186
187
188
189  /**
190   * Gets the "sender-address" property.
191   * <p>
192   * Specifies the email address to use as the sender for messages
193   * generated by this alert handler.
194   *
195   * @return Returns the value of the "sender-address" property.
196   */
197  String getSenderAddress();
198
199
200
201  /**
202   * Sets the "sender-address" property.
203   * <p>
204   * Specifies the email address to use as the sender for messages
205   * generated by this alert handler.
206   *
207   * @param value The value of the "sender-address" property.
208   * @throws PropertyException
209   *           If the new value is invalid.
210   */
211  void setSenderAddress(String value) throws PropertyException;
212
213}