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