DatasourceRealmForm.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: DatasourceRealmForm.java,v 1.6 2004/03/19 14:31:48 sauthieg Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.jonasadmin.security;
00027 
00028 import java.util.List;
00029 
00030 import javax.servlet.http.HttpServletRequest;
00031 
00032 import org.apache.struts.action.ActionError;
00033 import org.apache.struts.action.ActionErrors;
00034 import org.apache.struts.action.ActionMapping;
00035 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
00036 
00040 public class DatasourceRealmForm extends FactoryRealmForm {
00041 
00042 // --------------------------------------------------------- Constants
00043 
00044 // --------------------------------------------------------- Properties variables
00045 
00046     private String dsName = null;
00047     private String roleTable = null;
00048     private String roleTableRolenameCol = null;
00049     private String roleTableUsernameCol = null;
00050     private String userTable = null;
00051     private String userTablePasswordCol = null;
00052     private String userTableUsernameCol = null;
00053     private String algorithm = null;
00054 
00055     private List securityAlgorithms = Jlists.getSecurityAlgorithms();
00056 
00057 // --------------------------------------------------------- Public Methods
00058 
00070     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00071         ActionErrors oErrors = new ActionErrors();
00072 
00073         if ((getName() == null) || (getName().length() == 0)) {
00074             oErrors.add("name"
00075                 , new ActionError("error.security.factory.datasource.realm.name.required"));
00076         }
00077         if ((dsName == null) || (dsName.length() == 0)) {
00078             oErrors.add("dsName"
00079                 , new ActionError("error.security.factory.datasource.realm.dsName.required"));
00080         }
00081         if ((roleTable == null) || (roleTable.length() == 0)) {
00082             oErrors.add("roleTable"
00083                 , new ActionError("error.security.factory.datasource.realm.roleTable.required"));
00084         }
00085         if ((roleTableRolenameCol == null) || (roleTableRolenameCol.length() == 0)) {
00086             oErrors.add("roleTableRolenameCol"
00087                 , new ActionError("error.security.factory.datasource.realm.roleTableRolenameCol.required"));
00088         }
00089         if ((roleTableUsernameCol == null) || (roleTableUsernameCol.length() == 0)) {
00090             oErrors.add("roleTableUsernameCol"
00091                 , new ActionError("error.security.factory.datasource.realm.roleTableUsernameCol.required"));
00092         }
00093         if ((userTable == null) || (userTable.length() == 0)) {
00094             oErrors.add("userTable"
00095                 , new ActionError("error.security.factory.datasource.realm.userTable.required"));
00096         }
00097         if ((userTablePasswordCol == null) || (userTablePasswordCol.length() == 0)) {
00098             oErrors.add("userTablePasswordCol"
00099                 , new ActionError("error.security.factory.datasource.realm.userTablePasswordCol.required"));
00100         }
00101         if ((userTableUsernameCol == null) || (userTableUsernameCol.length() == 0)) {
00102             oErrors.add("userTableUsernameCol"
00103                 , new ActionError("error.security.factory.datasource.realm.userTableUsernameCol.required"));
00104         }
00105 
00106         return oErrors;
00107     }
00108 
00109 // --------------------------------------------------------- Properties Methods
00110 
00111     public String getDsName() {
00112         return dsName;
00113     }
00114 
00115     public void setDsName(String dsName) {
00116         this.dsName = dsName;
00117     }
00118 
00119     public String getRoleTable() {
00120         return roleTable;
00121     }
00122 
00123     public void setRoleTable(String roleTable) {
00124         this.roleTable = roleTable;
00125     }
00126 
00127     public String getRoleTableRolenameCol() {
00128         return roleTableRolenameCol;
00129     }
00130 
00131     public void setRoleTableRolenameCol(String roleTableRolenameCol) {
00132         this.roleTableRolenameCol = roleTableRolenameCol;
00133     }
00134 
00135     public String getRoleTableUsernameCol() {
00136         return roleTableUsernameCol;
00137     }
00138 
00139     public void setRoleTableUsernameCol(String roleTableUsernameCol) {
00140         this.roleTableUsernameCol = roleTableUsernameCol;
00141     }
00142 
00143     public String getUserTable() {
00144         return userTable;
00145     }
00146 
00147     public void setUserTable(String userTable) {
00148         this.userTable = userTable;
00149     }
00150 
00151     public String getUserTablePasswordCol() {
00152         return userTablePasswordCol;
00153     }
00154 
00155     public void setUserTablePasswordCol(String userTablePasswordCol) {
00156         this.userTablePasswordCol = userTablePasswordCol;
00157     }
00158 
00159     public String getUserTableUsernameCol() {
00160         return userTableUsernameCol;
00161     }
00162 
00163     public void setUserTableUsernameCol(String userTableUsernameCol) {
00164         this.userTableUsernameCol = userTableUsernameCol;
00165     }
00166 
00167     public String getAlgorithm() {
00168         return algorithm;
00169     }
00170 
00171     public void setAlgorithm(String algorithm) {
00172         this.algorithm = algorithm;
00173     }
00174 
00175     public List getSecurityAlgorithms() {
00176         return securityAlgorithms;
00177     }
00178 
00179 }

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