001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ResourceAdapterForm.java 8144 2006-03-20 15:03:22Z danesa $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.webapp.jonasadmin.service.resource;
025:
026: import java.util.ArrayList;
027: import java.util.Collections;
028: import java.util.Enumeration;
029: import java.util.Properties;
030:
031: import javax.management.ObjectName;
032: import javax.servlet.http.HttpServletRequest;
033:
034: import org.apache.struts.action.ActionErrors;
035: import org.apache.struts.action.ActionMapping;
036: import org.objectweb.jonas.webapp.jonasadmin.Jlists;
037: import org.objectweb.jonas.webapp.jonasadmin.common.LabelValueByLabelComparator;
038: import org.objectweb.jonas.webapp.jonasadmin.service.ModuleForm;
039: import org.objectweb.jonas.webapp.taglib.LabelValueBean;
040:
041: /**
042: * @author Michel-Ange ANTON
043: * @author Adriana Danes
044: */
045: public class ResourceAdapterForm extends ModuleForm {
046:
047: // --------------------------------------------------------- Properties variables
048:
049: private String action = null;
050: private String name = null;
051: private String jndiName = null;
052: private String path = null;
053: private String file = null;
054: private ArrayList listProperties = new ArrayList();
055: private String specVersion = null;
056: private ArrayList CF = new ArrayList();
057: private ArrayList AS = new ArrayList();
058: private ArrayList AO = new ArrayList();
059:
060: private ObjectName oName = null;
061: private String connectionFactory = null;
062:
063: private String jdbcTestStatement = null;
064: private java.util.List checkingLevels = Jlists
065: .getJdbcConnectionCheckingLevels();
066: private String currentOpened = null;
067: private String currentBusy = null;
068: private String busyMaxRecent = null;
069: private String busyMinRecent = null;
070: private String currentInTx = null;
071: private String openedCount = null;
072: private String connectionFailures = null;
073: private String connectionLeaks = null;
074: private String currentWaiters = null;
075: private String waitersHigh = null;
076: private String waitersHighRecent = null;
077: private String waiterCount = null;
078: private String waitingTime = null;
079: private String waitingHigh = null;
080: private String waitingHighRecent = null;
081: private String servedOpen = null;
082: private String rejectedOpen = null;
083: private String rejectedFull = null;
084: private String rejectedTimeout = null;
085: private String rejectedOther = null;
086: private String jdbcConnCheckLevel = null;
087: private String connMaxAge = null;
088: private String maxOpentime = null;
089: private String maxSize = null;
090: private String minSize = null;
091: private String initSize = null;
092: private String maxWaitTime = null;
093: private String maxWaiters = null;
094: private String samplingPeriod = null;
095: private String pstmtMax = "0";
096:
097: private ArrayList listUsedByEjb = new ArrayList();
098:
099: // Specific for Joram adapter
100: private boolean joramAdapter = false;
101: private String joramServerId = null;
102: private String joramServerName = null;
103:
104: // --------------------------------------------------------- Public Methods
105:
106: public ActionErrors validate(ActionMapping mapping,
107: HttpServletRequest request) {
108: ActionErrors oErrors = new ActionErrors();
109: return oErrors;
110: }
111:
112: // --------------------------------------------------------- Properties Methods
113:
114: public String getAction() {
115: return action;
116: }
117:
118: public void setAction(String action) {
119: this .action = action;
120: }
121:
122: public ArrayList getAO() {
123: return AO;
124: }
125:
126: public void setAO(ArrayList ao) {
127: AO = ao;
128: }
129:
130: public ArrayList getAS() {
131: return AS;
132: }
133:
134: public void setAS(ArrayList as) {
135: AS = as;
136: }
137:
138: public ArrayList getCF() {
139: return CF;
140: }
141:
142: public void setCF(ArrayList cf) {
143: CF = cf;
144: }
145:
146: public String getJndiName() {
147: return jndiName;
148: }
149:
150: public void setJndiName(String name) {
151: this .jndiName = name;
152: }
153:
154: public String getName() {
155: return name;
156: }
157:
158: public void setName(String name) {
159: this .name = name;
160: }
161:
162: public String getPath() {
163: return path;
164: }
165:
166: public void setPath(String path) {
167: this .path = path;
168: }
169:
170: public String getFile() {
171: return file;
172: }
173:
174: public void setFile(String file) {
175: this .file = file;
176: }
177:
178: public ArrayList getListProperties() {
179: return listProperties;
180: }
181:
182: public void setListProperties(Properties properties) {
183: this .listProperties.clear();
184: // Fill list with properties (keys and values)
185: String sKey;
186: Enumeration oEnum = properties.keys();
187: while (oEnum.hasMoreElements()) {
188: sKey = oEnum.nextElement().toString();
189: this .listProperties.add(new LabelValueBean(sKey, properties
190: .getProperty(sKey, "")));
191: }
192: Collections.sort(this .listProperties,
193: new LabelValueByLabelComparator());
194: }
195:
196: public String getSpecVersion() {
197: return specVersion;
198: }
199:
200: public void setSpecVersion(String specVersion) {
201: this .specVersion = specVersion;
202: }
203:
204: public void setOName(ObjectName oName) {
205: this .oName = oName;
206: }
207:
208: public ObjectName getOName() {
209: return oName;
210: }
211:
212: public void setConnectionFactory(String cf) {
213: connectionFactory = cf;
214: }
215:
216: public String getConnectionFactory() {
217: return connectionFactory;
218: }
219:
220: // Statistics
221: public String getCurrentOpened() {
222: return currentOpened;
223: }
224:
225: public void setCurrentOpened(String s) {
226: currentOpened = s;
227: }
228:
229: public String getCurrentBusy() {
230: return currentBusy;
231: }
232:
233: public void setCurrentBusy(String s) {
234: currentBusy = s;
235: }
236:
237: public String getCurrentInTx() {
238: return currentInTx;
239: }
240:
241: public void setCurrentInTx(String s) {
242: currentInTx = s;
243: }
244:
245: public String getOpenedCount() {
246: return openedCount;
247: }
248:
249: public void setOpenedCount(String s) {
250: openedCount = s;
251: }
252:
253: public String getConnectionFailures() {
254: return connectionFailures;
255: }
256:
257: public void setConnectionFailures(String s) {
258: connectionFailures = s;
259: }
260:
261: public String getConnectionLeaks() {
262: return connectionLeaks;
263: }
264:
265: public void setConnectionLeaks(String s) {
266: connectionLeaks = s;
267: }
268:
269: public String getCurrentWaiters() {
270: return currentWaiters;
271: }
272:
273: public void setCurrentWaiters(String s) {
274: currentWaiters = s;
275: }
276:
277: public String getWaitersHigh() {
278: return waitersHigh;
279: }
280:
281: public void setWaitersHigh(String s) {
282: waitersHigh = s;
283: }
284:
285: public String getWaitersHighRecent() {
286: return waitersHighRecent;
287: }
288:
289: public void setWaitersHighRecent(String s) {
290: waitersHighRecent = s;
291: }
292:
293: public String getBusyMaxRecent() {
294: return busyMaxRecent;
295: }
296:
297: public void setBusyMaxRecent(String s) {
298: busyMaxRecent = s;
299: }
300:
301: public String getBusyMinRecent() {
302: return busyMinRecent;
303: }
304:
305: public void setBusyMinRecent(String s) {
306: busyMinRecent = s;
307: }
308:
309: public String getWaiterCount() {
310: return waiterCount;
311: }
312:
313: public void setWaiterCount(String s) {
314: waiterCount = s;
315: }
316:
317: public String getWaitingTime() {
318: return waitingTime;
319: }
320:
321: public void setWaitingTime(String s) {
322: waitingTime = s;
323: }
324:
325: public String getWaitingHigh() {
326: return waitingHigh;
327: }
328:
329: public void setWaitingHigh(String s) {
330: waitingHigh = s;
331: }
332:
333: public String getWaitingHighRecent() {
334: return waitingHighRecent;
335: }
336:
337: public void setWaitingHighRecent(String s) {
338: waitingHighRecent = s;
339: }
340:
341: public String getServedOpen() {
342: return servedOpen;
343: }
344:
345: public void setServedOpen(String s) {
346: servedOpen = s;
347: }
348:
349: public String getRejectedOpen() {
350: return rejectedOpen;
351: }
352:
353: public void setRejectedOpen(String s) {
354: rejectedOpen = s;
355: }
356:
357: public String getRejectedFull() {
358: return rejectedFull;
359: }
360:
361: public void setRejectedFull(String s) {
362: rejectedFull = s;
363: }
364:
365: public String getRejectedTimeout() {
366: return rejectedTimeout;
367: }
368:
369: public void setRejectedTimeout(String s) {
370: rejectedTimeout = s;
371: }
372:
373: public String getRejectedOther() {
374: return rejectedOther;
375: }
376:
377: public void setRejectedOther(String s) {
378: rejectedOther = s;
379: }
380:
381: public String getJdbcConnCheckLevel() {
382: return jdbcConnCheckLevel;
383: }
384:
385: public void setJdbcConnCheckLevel(String jdbcConnCheckLevel) {
386: this .jdbcConnCheckLevel = jdbcConnCheckLevel;
387: }
388:
389: public String getConnMaxAge() {
390: return connMaxAge;
391: }
392:
393: public void setConnMaxAge(String s) {
394: connMaxAge = s;
395: }
396:
397: public String getMaxOpentime() {
398: return maxOpentime;
399: }
400:
401: public void setMaxOpentime(String s) {
402: maxOpentime = s;
403: }
404:
405: public String getMaxSize() {
406: return maxSize;
407: }
408:
409: public void setMaxSize(String maxSize) {
410: this .maxSize = maxSize;
411: }
412:
413: public String getMinSize() {
414: return minSize;
415: }
416:
417: public void setMinSize(String minSize) {
418: this .minSize = minSize;
419: }
420:
421: public String getMaxWaitTime() {
422: return maxWaitTime;
423: }
424:
425: public void setMaxWaitTime(String maxWaitTime) {
426: this .maxWaitTime = maxWaitTime;
427: }
428:
429: public String getMaxWaiters() {
430: return maxWaiters;
431: }
432:
433: public void setMaxWaiters(String s) {
434: this .maxWaiters = s;
435: }
436:
437: public String getSamplingPeriod() {
438: return samplingPeriod;
439: }
440:
441: public void setSamplingPeriod(String s) {
442: this .samplingPeriod = s;
443: }
444:
445: public String getJdbcTestStatement() {
446: return jdbcTestStatement;
447: }
448:
449: public void setJdbcTestStatement(String jdbcTestStatement) {
450: this .jdbcTestStatement = jdbcTestStatement;
451: }
452:
453: public java.util.List getCheckingLevels() {
454: return checkingLevels;
455: }
456:
457: public ArrayList getListUsedByEjb() {
458: return listUsedByEjb;
459: }
460:
461: public void setListUsedByEjb(ArrayList listUsedByEjb) {
462: this .listUsedByEjb = listUsedByEjb;
463: }
464:
465: /**
466: * @return Returns the joramAdapter.
467: */
468: public boolean isJoramAdapter() {
469: return joramAdapter;
470: }
471:
472: /**
473: * @param joramAdapter The joramAdapter to set.
474: */
475: public void setJoramAdapter(boolean joramAdapter) {
476: this .joramAdapter = joramAdapter;
477: }
478:
479: /**
480: * @return Returns the serverId.
481: */
482: public String getJoramServerId() {
483: return joramServerId;
484: }
485:
486: /**
487: * @param serverId The serverId to set.
488: */
489: public void setJoramServerId(String serverId) {
490: this .joramServerId = serverId;
491: }
492:
493: public void reset(ActionMapping mapping, HttpServletRequest request) {
494: }
495:
496: /**
497: * @return Returns the joramServerName.
498: */
499: public String getJoramServerName() {
500: return joramServerName;
501: }
502:
503: /**
504: * @param joramServerName The joramServerName to set.
505: */
506: public void setJoramServerName(String joramServerName) {
507: this .joramServerName = joramServerName;
508: }
509:
510: /**
511: * @return Returns the initSize.
512: */
513: public String getInitSize() {
514: return initSize;
515: }
516:
517: /**
518: * @param initSize The initSize to set.
519: */
520: public void setInitSize(String initSize) {
521: this .initSize = initSize;
522: }
523:
524: /**
525: * @return Returns the pstmtMax.
526: */
527: public String getPstmtMax() {
528: return pstmtMax;
529: }
530:
531: /**
532: * @param pstmtMax The pstmtMax to set.
533: */
534: public void setPstmtMax(String pstmtMax) {
535: this.pstmtMax = pstmtMax;
536: }
537:
538: }
|