00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00043
00044
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
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
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 }