1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.db; 27 28 import java.util.ArrayList ; 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.ActionForm; 35 import org.apache.struts.action.ActionMapping; 36 import org.objectweb.jonas.webapp.jonasadmin.Jlists; 37 38 41 public class DatasourceForm extends ActionForm { 42 43 45 47 private String action = null; 48 private String className = null; 49 private String datasourceDescription = null; 50 private String datasourceFactory = null; 51 private String datasourceName = null; 52 private String dsName = null; 53 private String jdbcTestStatement = null; 54 private String password = null; 55 private String url = null; 56 private String userName = null; 57 private String datasourceMapper = null; 58 private java.util.List checkingLevels = Jlists.getJdbcConnectionCheckingLevels(); 59 private String currentOpened = null; 60 private String currentBusy = null; 61 private String busyMaxRecent = null; 62 private String busyMinRecent = null; 63 private String currentInTx = null; 64 private String openedCount = null; 65 private String connectionFailures = null; 66 private String connectionLeaks = null; 67 private String currentWaiters = null; 68 private String waitersHigh = null; 69 private String waitersHighRecent = null; 70 private String waiterCount = null; 71 private String waitingTime = null; 72 private String waitingHigh = null; 73 private String waitingHighRecent = null; 74 private String servedOpen = null; 75 private String rejectedOpen = null; 76 private String rejectedFull = null; 77 private String rejectedTimeout = null; 78 private String rejectedOther = null; 79 private String jdbcConnCheckLevel = null; 80 private String jdbcConnMaxAge = null; 81 private String jdbcMaxOpenTime = null; 82 private String jdbcMaxConnPool = null; 83 private String jdbcMinConnPool = null; 84 private String jdbcMaxWaitTime = null; 85 private String jdbcMaxWaiters = null; 86 private String jdbcSamplingPeriod = null; 87 88 private ArrayList listUsedByEjb = new ArrayList (); 89 90 92 98 99 public void reset(ActionMapping mapping, HttpServletRequest request) { 100 action = "apply"; 101 } 102 103 114 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 115 ActionErrors oErrors = new ActionErrors(); 116 117 validateInteger(oErrors, jdbcConnMaxAge, "jdbcConnMaxAge" 118 , "error.database.datasource.jdbcConnMaxAge.numberformat"); 119 validateInteger(oErrors, jdbcMaxOpenTime, "jdbcMaxOpenTime" 120 , "error.database.datasource.jdbcMaxOpenTime.numberformat"); 121 validateInteger(oErrors, jdbcMaxConnPool, "jdbcMaxConnPool" 122 , "error.database.datasource.jdbcMaxConnPool.numberformat"); 123 validateInteger(oErrors, jdbcMinConnPool, "jdbcMinConnPool" 124 , "error.database.datasource.jdbcMinConnPool.numberformat"); 125 validateInteger(oErrors, jdbcMaxWaitTime, "jdbcMaxWaitTime" 126 , "error.database.datasource.jdbcMaxWaitTime.numberformat"); 127 validateInteger(oErrors, jdbcMaxWaiters, "jdbcMaxWaiters" 128 , "error.database.datasource.jdbcMaxWaiters.numberformat"); 129 validateInteger(oErrors, jdbcSamplingPeriod, "jdbcSamplingPeriod" 130 , "error.database.datasource.jdbcSamplingPeriod.numberformat"); 131 132 return oErrors; 133 } 134 135 protected void validateInteger(ActionErrors p_Errors, String p_Value, String p_Tag 136 , String p_ResError) { 137 try { 138 Integer.parseInt(p_Value); 139 } catch (NumberFormatException e) { 140 p_Errors.add(p_Tag, new ActionMessage(p_ResError)); 141 } 142 } 143 144 146 public String getClassName() { 147 return className; 148 } 149 150 public void setClassName(String className) { 151 this.className = className; 152 } 153 154 public String getCurrentOpened() { 155 return currentOpened; 156 } 157 158 public void setCurrentOpened(String s) { 159 currentOpened = s; 160 } 161 162 public String getCurrentBusy() { 163 return currentBusy; 164 } 165 166 public void setCurrentBusy(String s) { 167 currentBusy = s; 168 } 169 170 public String getCurrentInTx() { 171 return currentInTx; 172 } 173 174 public void setCurrentInTx(String s) { 175 currentInTx = s; 176 } 177 178 public String getOpenedCount() { 179 return openedCount; 180 } 181 182 public void setOpenedCount(String s) { 183 openedCount = s; 184 } 185 186 public String getConnectionFailures() { 187 return connectionFailures; 188 } 189 190 public void setConnectionFailures(String s) { 191 connectionFailures = s; 192 } 193 194 public String getConnectionLeaks() { 195 return connectionLeaks; 196 } 197 198 public void setConnectionLeaks(String s) { 199 connectionLeaks = s; 200 } 201 202 public String getCurrentWaiters() { 203 return currentWaiters; 204 } 205 206 public void setCurrentWaiters(String s) { 207 currentWaiters = s; 208 } 209 210 public String getWaitersHigh() { 211 return waitersHigh; 212 } 213 214 public void setWaitersHigh(String s) { 215 waitersHigh = s; 216 } 217 218 public String getWaitersHighRecent() { 219 return waitersHighRecent; 220 } 221 222 public void setWaitersHighRecent(String s) { 223 waitersHighRecent = s; 224 } 225 226 public String getBusyMaxRecent() { 227 return busyMaxRecent; 228 } 229 230 public void setBusyMaxRecent(String s) { 231 busyMaxRecent = s; 232 } 233 234 public String getBusyMinRecent() { 235 return busyMinRecent; 236 } 237 238 public void setBusyMinRecent(String s) { 239 busyMinRecent = s; 240 } 241 242 public String getWaiterCount() { 243 return waiterCount; 244 } 245 246 public void setWaiterCount(String s) { 247 waiterCount = s; 248 } 249 250 public String getWaitingTime() { 251 return waitingTime; 252 } 253 254 public void setWaitingTime(String s) { 255 waitingTime = s; 256 } 257 258 public String getWaitingHigh() { 259 return waitingHigh; 260 } 261 262 public void setWaitingHigh(String s) { 263 waitingHigh = s; 264 } 265 266 public String getWaitingHighRecent() { 267 return waitingHighRecent; 268 } 269 270 public void setWaitingHighRecent(String s) { 271 waitingHighRecent = s; 272 } 273 274 public String getServedOpen() { 275 return servedOpen; 276 } 277 278 public void setServedOpen(String s) { 279 servedOpen = s; 280 } 281 282 public String getRejectedOpen() { 283 return rejectedOpen; 284 } 285 286 public void setRejectedOpen(String s) { 287 rejectedOpen = s; 288 } 289 290 public String getRejectedFull() { 291 return rejectedFull; 292 } 293 294 public void setRejectedFull(String s) { 295 rejectedFull = s; 296 } 297 298 public String getRejectedTimeout() { 299 return rejectedTimeout; 300 } 301 302 public void setRejectedTimeout(String s) { 303 rejectedTimeout = s; 304 } 305 306 public String getRejectedOther() { 307 return rejectedOther; 308 } 309 310 public void setRejectedOther(String s) { 311 rejectedOther = s; 312 } 313 314 public String getDatasourceDescription() { 315 return datasourceDescription; 316 } 317 318 public void setDatasourceDescription(String datasourceDescription) { 319 this.datasourceDescription = datasourceDescription; 320 } 321 322 public String getDatasourceName() { 323 return datasourceName; 324 } 325 326 public void setDatasourceName(String datasourceName) { 327 this.datasourceName = datasourceName; 328 } 329 330 public String getDatasourceMapper() { 331 return datasourceMapper; 332 } 333 334 public void setDatasourceMapper(String datasourceMapper) { 335 this.datasourceMapper = datasourceMapper; 336 } 337 338 public String getDsName() { 339 return dsName; 340 } 341 342 public void setDsName(String dsName) { 343 this.dsName = dsName; 344 } 345 346 public String getJdbcConnCheckLevel() { 347 return jdbcConnCheckLevel; 348 } 349 350 public void setJdbcConnCheckLevel(String jdbcConnCheckLevel) { 351 this.jdbcConnCheckLevel = jdbcConnCheckLevel; 352 } 353 354 public String getJdbcConnMaxAge() { 355 return jdbcConnMaxAge; 356 } 357 358 public void setJdbcConnMaxAge(String s) { 359 jdbcConnMaxAge = s; 360 } 361 362 public String getJdbcMaxOpenTime() { 363 return jdbcMaxOpenTime; 364 } 365 366 public void setJdbcMaxOpenTime(String s) { 367 jdbcMaxOpenTime = s; 368 } 369 370 public String getJdbcMaxConnPool() { 371 return jdbcMaxConnPool; 372 } 373 374 public void setJdbcMaxConnPool(String jdbcMaxConnPool) { 375 this.jdbcMaxConnPool = jdbcMaxConnPool; 376 } 377 378 public String getJdbcMinConnPool() { 379 return jdbcMinConnPool; 380 } 381 382 public void setJdbcMinConnPool(String jdbcMinConnPool) { 383 this.jdbcMinConnPool = jdbcMinConnPool; 384 } 385 386 public String getJdbcMaxWaitTime() { 387 return jdbcMaxWaitTime; 388 } 389 390 public void setJdbcMaxWaitTime(String jdbcMaxWaitTime) { 391 this.jdbcMaxWaitTime = jdbcMaxWaitTime; 392 } 393 394 public String getJdbcMaxWaiters() { 395 return jdbcMaxWaiters; 396 } 397 398 public void setJdbcMaxWaiters(String s) { 399 this.jdbcMaxWaiters = s; 400 } 401 402 public String getJdbcSamplingPeriod() { 403 return jdbcSamplingPeriod; 404 } 405 406 public void setJdbcSamplingPeriod(String s) { 407 this.jdbcSamplingPeriod = s; 408 } 409 410 public String getJdbcTestStatement() { 411 return jdbcTestStatement; 412 } 413 414 public void setJdbcTestStatement(String jdbcTestStatement) { 415 this.jdbcTestStatement = jdbcTestStatement; 416 } 417 418 public String getPassword() { 419 return password; 420 } 421 422 public void setPassword(String password) { 423 this.password = password; 424 } 425 426 public String getUrl() { 427 return url; 428 } 429 430 public void setUrl(String url) { 431 this.url = url; 432 } 433 434 public String getUserName() { 435 return userName; 436 } 437 438 public void setUserName(String userName) { 439 this.userName = userName; 440 } 441 442 public String getAction() { 443 return action; 444 } 445 446 public void setAction(String action) { 447 this.action = action; 448 } 449 450 public java.util.List getCheckingLevels() { 451 return checkingLevels; 452 } 453 454 public ArrayList getListUsedByEjb() { 455 return listUsedByEjb; 456 } 457 458 public void setListUsedByEjb(ArrayList listUsedByEjb) { 459 this.listUsedByEjb = listUsedByEjb; 460 } 461 462 } 463 | Popular Tags |