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