MailFactoryPropertiesForm.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: 
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.jonasadmin.resource;
00027 
00028 import javax.servlet.http.HttpServletRequest;
00029 
00030 import org.apache.struts.action.ActionError;
00031 import org.apache.struts.action.ActionErrors;
00032 import org.apache.struts.action.ActionForm;
00033 import org.apache.struts.action.ActionMapping;
00034 
00035 public class MailFactoryPropertiesForm extends ActionForm {
00036 
00037 // --------------------------------------------------------- Constants
00038 
00039 // --------------------------------------------------------- Properties variables
00040     private String mailFactoryName = null;
00041     private String jndiName = null;
00042     private String type = null;
00043      // authentication props
00044     private String username = null;
00045     private String password = null;
00046     // mail session props
00047     private String sessionProps = null;
00048     // mimepart datasource message props
00049     private String to = null;
00050     private String subject = null;
00051     private String cc = null;
00052     private String bcc = null;
00053    
00054 // --------------------------------------------------------- Public Methods
00055 
00063     public void reset(ActionMapping mapping, HttpServletRequest request) {
00064         mailFactoryName = null;
00065         jndiName = null;
00066         type = null;
00067         // authentication props
00068         username = null;
00069         password = null;
00070         // mail session props
00071         sessionProps = null;
00072         // mimepart datasource message props
00073         to = null;
00074         subject = null;
00075         cc = null;
00076         bcc = null;
00077     }
00078 
00089     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00090         ActionErrors oErrors = new ActionErrors();  
00091         if ((jndiName == null) || (jndiName.length() == 0)) {
00092             oErrors.add("jndiName", new ActionError("error.mailservice.mailfactory.emptyjndiname"));
00093         } 
00094         if ((mailFactoryName == null) || (mailFactoryName.length() == 0)) {
00095             oErrors.add("jndiName", new ActionError("error.mailservice.mailfactory.emptyname"));
00096         } 
00097         if ((type == null) || (type.length() == 0)) {
00098             oErrors.add("jndiName", new ActionError("error.mailservice.mailfactory.emptytype"));
00099         }
00100         return oErrors;
00101     }
00102 
00103 // --------------------------------------------------------- Properties Methods
00104 
00105     public String getMailFactoryName() {
00106         return mailFactoryName;
00107     }
00108 
00109     public void setMailFactoryName(String mailFactoryName) {
00110         this.mailFactoryName = mailFactoryName;
00111     }
00112 
00113     public String getJndiName() {
00114         return jndiName;
00115     }
00116 
00117     public void setJndiName(String jndiName) {
00118         this.jndiName = jndiName;
00119     }
00120     
00121     public String getType() {
00122         return type;
00123     }
00124 
00125     public void setType(String type) {
00126         this.type = type;
00127     }
00128 
00129     public String getUsername() {
00130         return username;
00131     }
00132 
00133     public void setUsername(String username) {
00134         this.username = username;
00135     }
00136 
00137     public String getPassword() {
00138         return password;
00139     }
00140 
00141     public void setPassword(String password) {
00142         this.password = password;
00143     }
00144 
00145     public String getSessionProps() {
00146         return sessionProps;
00147     }
00148 
00149     public void setSessionProps(String sessionProps) {
00150         this.sessionProps = sessionProps;
00151     }
00152 
00153     public String getTo() {
00154         return to;
00155     }
00156 
00157     public void setTo(String to) {
00158         this.to = to;
00159     }
00160 
00161     public String getSubject() {
00162         return subject;
00163     }
00164 
00165     public void setSubject(String subject) {
00166         this.subject = subject;
00167     }
00168 
00169     public String getCc() {
00170         return cc;
00171     }
00172 
00173     public void setCc(String cc) {
00174         this.cc = cc;
00175     }
00176 
00177     public String getBcc() {
00178         return bcc;
00179     }
00180 
00181     public void setBcc(String bcc) {
00182         this.bcc = bcc;
00183     }
00184 
00185 }

Generated on Tue Feb 15 15:05:30 2005 for JOnAS by  doxygen 1.3.9.1