1 25 26 package org.objectweb.jonas.webapp.jonasadmin.security; 27 28 import java.util.List ; 29 30 import javax.servlet.http.HttpServletRequest ; 31 32 import org.apache.struts.action.ActionMessage; 33 import org.apache.struts.action.ActionErrors; 34 import org.apache.struts.action.ActionMapping; 35 import org.objectweb.jonas.webapp.jonasadmin.Jlists; 36 37 40 public class DatasourceRealmForm extends FactoryRealmForm { 41 42 44 46 private String dsName = null; 47 private String roleTable = null; 48 private String roleTableRolenameCol = null; 49 private String roleTableUsernameCol = null; 50 private String userTable = null; 51 private String userTablePasswordCol = null; 52 private String userTableUsernameCol = null; 53 private String algorithm = null; 54 55 private List securityAlgorithms = Jlists.getSecurityAlgorithms(); 56 57 59 70 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 71 ActionErrors oErrors = new ActionErrors(); 72 73 if ((getName() == null) || (getName().length() == 0)) { 74 oErrors.add("name" 75 , new ActionMessage("error.security.factory.datasource.realm.name.required")); 76 } 77 if ((dsName == null) || (dsName.length() == 0)) { 78 oErrors.add("dsName" 79 , new ActionMessage("error.security.factory.datasource.realm.dsName.required")); 80 } 81 if ((roleTable == null) || (roleTable.length() == 0)) { 82 oErrors.add("roleTable" 83 , new ActionMessage("error.security.factory.datasource.realm.roleTable.required")); 84 } 85 if ((roleTableRolenameCol == null) || (roleTableRolenameCol.length() == 0)) { 86 oErrors.add("roleTableRolenameCol" 87 , new ActionMessage("error.security.factory.datasource.realm.roleTableRolenameCol.required")); 88 } 89 if ((roleTableUsernameCol == null) || (roleTableUsernameCol.length() == 0)) { 90 oErrors.add("roleTableUsernameCol" 91 , new ActionMessage("error.security.factory.datasource.realm.roleTableUsernameCol.required")); 92 } 93 if ((userTable == null) || (userTable.length() == 0)) { 94 oErrors.add("userTable" 95 , new ActionMessage("error.security.factory.datasource.realm.userTable.required")); 96 } 97 if ((userTablePasswordCol == null) || (userTablePasswordCol.length() == 0)) { 98 oErrors.add("userTablePasswordCol" 99 , new ActionMessage("error.security.factory.datasource.realm.userTablePasswordCol.required")); 100 } 101 if ((userTableUsernameCol == null) || (userTableUsernameCol.length() == 0)) { 102 oErrors.add("userTableUsernameCol" 103 , new ActionMessage("error.security.factory.datasource.realm.userTableUsernameCol.required")); 104 } 105 106 return oErrors; 107 } 108 109 111 public String getDsName() { 112 return dsName; 113 } 114 115 public void setDsName(String dsName) { 116 this.dsName = dsName; 117 } 118 119 public String getRoleTable() { 120 return roleTable; 121 } 122 123 public void setRoleTable(String roleTable) { 124 this.roleTable = roleTable; 125 } 126 127 public String getRoleTableRolenameCol() { 128 return roleTableRolenameCol; 129 } 130 131 public void setRoleTableRolenameCol(String roleTableRolenameCol) { 132 this.roleTableRolenameCol = roleTableRolenameCol; 133 } 134 135 public String getRoleTableUsernameCol() { 136 return roleTableUsernameCol; 137 } 138 139 public void setRoleTableUsernameCol(String roleTableUsernameCol) { 140 this.roleTableUsernameCol = roleTableUsernameCol; 141 } 142 143 public String getUserTable() { 144 return userTable; 145 } 146 147 public void setUserTable(String userTable) { 148 this.userTable = userTable; 149 } 150 151 public String getUserTablePasswordCol() { 152 return userTablePasswordCol; 153 } 154 155 public void setUserTablePasswordCol(String userTablePasswordCol) { 156 this.userTablePasswordCol = userTablePasswordCol; 157 } 158 159 public String getUserTableUsernameCol() { 160 return userTableUsernameCol; 161 } 162 163 public void setUserTableUsernameCol(String userTableUsernameCol) { 164 this.userTableUsernameCol = userTableUsernameCol; 165 } 166 167 public String getAlgorithm() { 168 return algorithm; 169 } 170 171 public void setAlgorithm(String algorithm) { 172 this.algorithm = algorithm; 173 } 174 175 public List getSecurityAlgorithms() { 176 return securityAlgorithms; 177 } 178 179 } | Popular Tags |