KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > service > resource > ResourceAdapterForm


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ResourceAdapterForm.java,v 1.1 2005/04/26 16:19:06 ehardesty Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.service.resource;
27
28 import java.net.URL JavaDoc;
29 import java.util.ArrayList JavaDoc;
30 import java.util.Collections JavaDoc;
31 import java.util.Enumeration JavaDoc;
32 import java.util.Properties JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35 import javax.servlet.http.HttpServletRequest JavaDoc;
36
37 import org.apache.struts.action.ActionErrors;
38 import org.apache.struts.action.ActionForm;
39 import org.apache.struts.action.ActionMapping;
40 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
41 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx;
42 import org.objectweb.jonas.webapp.jonasadmin.common.LabelValueByLabelComparator;
43 import org.objectweb.jonas.webapp.taglib.LabelValueBean;
44
45
46 /**
47  * @author Michel-Ange ANTON
48  */

49 public class ResourceAdapterForm extends ActionForm {
50
51 // --------------------------------------------------------- Properties variables
52

53     private String JavaDoc action = null;
54     private String JavaDoc name = null;
55     private String JavaDoc jndiName = null;
56     private String JavaDoc path = null;
57     private String JavaDoc file = null;
58     private boolean inEar = false;
59     private String JavaDoc earFile = null;
60     private String JavaDoc earPath = null;
61     private ArrayList JavaDoc listProperties = new ArrayList JavaDoc();
62     private String JavaDoc specVersion = null;
63     private ArrayList JavaDoc CF = new ArrayList JavaDoc();
64     private ArrayList JavaDoc AS = new ArrayList JavaDoc();
65     private ArrayList JavaDoc AO = new ArrayList JavaDoc();
66     
67     private ObjectName JavaDoc oName = null;
68     private String JavaDoc connectionFactory = null;
69
70     private String JavaDoc jdbcTestStatement = null;
71     private java.util.List JavaDoc checkingLevels = Jlists.getJdbcConnectionCheckingLevels();
72     private String JavaDoc currentOpened = null;
73     private String JavaDoc currentBusy = null;
74     private String JavaDoc busyMaxRecent = null;
75     private String JavaDoc busyMinRecent = null;
76     private String JavaDoc currentInTx = null;
77     private String JavaDoc openedCount = null;
78     private String JavaDoc connectionFailures = null;
79     private String JavaDoc connectionLeaks = null;
80     private String JavaDoc currentWaiters = null;
81     private String JavaDoc waitersHigh = null;
82     private String JavaDoc waitersHighRecent = null;
83     private String JavaDoc waiterCount = null;
84     private String JavaDoc waitingTime = null;
85     private String JavaDoc waitingHigh = null;
86     private String JavaDoc waitingHighRecent = null;
87     private String JavaDoc servedOpen = null;
88     private String JavaDoc rejectedOpen = null;
89     private String JavaDoc rejectedFull = null;
90     private String JavaDoc rejectedTimeout = null;
91     private String JavaDoc rejectedOther = null;
92     private String JavaDoc jdbcConnCheckLevel = null;
93     private String JavaDoc connMaxAge = null;
94     private String JavaDoc maxOpentime = null;
95     private String JavaDoc maxSize = null;
96     private String JavaDoc minSize = null;
97     private String JavaDoc maxWaitTime = null;
98     private String JavaDoc maxWaiters = null;
99     private String JavaDoc samplingPeriod = null;
100
101     private ArrayList JavaDoc listUsedByEjb = new ArrayList JavaDoc();
102     
103 // --------------------------------------------------------- Public Methods
104

105     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
106     }
107
108     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
109         ActionErrors oErrors = new ActionErrors();
110         return oErrors;
111     }
112
113 // --------------------------------------------------------- Properties Methods
114

115     public String JavaDoc getAction() {
116         return action;
117     }
118
119     public void setAction(String JavaDoc action) {
120         this.action = action;
121     }
122
123     public ArrayList JavaDoc getAO() {
124         return AO;
125     }
126
127     public void setAO(ArrayList JavaDoc ao) {
128         AO = ao;
129     }
130
131     public ArrayList JavaDoc getAS() {
132         return AS;
133     }
134
135     public void setAS(ArrayList JavaDoc as) {
136         AS = as;
137     }
138
139     public ArrayList JavaDoc getCF() {
140         return CF;
141     }
142
143     public void setCF(ArrayList JavaDoc cf) {
144         CF = cf;
145     }
146
147     public String JavaDoc getJndiName() {
148         return jndiName;
149     }
150
151     public void setJndiName(String JavaDoc name) {
152         this.jndiName = name;
153     }
154
155     public String JavaDoc getName() {
156         return name;
157     }
158
159     public void setName(String JavaDoc name) {
160         this.name = name;
161     }
162
163     public String JavaDoc getPath() {
164         return path;
165     }
166
167     public void setPath(String JavaDoc path) {
168         this.path = path;
169     }
170
171     public String JavaDoc getFile() {
172         return file;
173     }
174
175     public void setFile(String JavaDoc file) {
176         this.file = file;
177     }
178
179     public String JavaDoc getEarFile() {
180         return earFile;
181     }
182
183     public String JavaDoc getEarPath() {
184         return earPath;
185     }
186
187     public void setEarPath(URL JavaDoc p_Url) {
188         this.earPath = null;
189         if (p_Url != null) {
190             this.earPath = p_Url.getPath();
191             this.earFile = JonasAdminJmx.extractFilename(this.earPath);
192         }
193     }
194
195     public boolean isInEar() {
196         return inEar;
197     }
198
199     public void setInEar(boolean inEar) {
200         this.inEar = inEar;
201     }
202
203     public ArrayList JavaDoc getListProperties() {
204         return listProperties;
205     }
206
207     public void setListProperties(Properties JavaDoc properties) {
208         this.listProperties.clear();
209         // Fill list with properties (keys and values)
210
String JavaDoc sKey;
211         Enumeration JavaDoc oEnum = properties.keys();
212         while (oEnum.hasMoreElements()) {
213             sKey = oEnum.nextElement().toString();
214             this.listProperties.add(new LabelValueBean(sKey, properties.getProperty(sKey, "")));
215         }
216         Collections.sort(this.listProperties, new LabelValueByLabelComparator());
217     }
218
219     public String JavaDoc getSpecVersion() {
220         return specVersion;
221     }
222
223     public void setSpecVersion(String JavaDoc specVersion) {
224         this.specVersion = specVersion;
225     }
226
227     public void setOName(ObjectName JavaDoc oName) {
228         this.oName = oName;
229     }
230     
231     public ObjectName JavaDoc getOName() {
232         return oName;
233     }
234
235     public void setConnectionFactory(String JavaDoc cf) {
236         connectionFactory = cf;
237     }
238     
239     public String JavaDoc getConnectionFactory() {
240         return connectionFactory;
241     }
242
243     // Statistics
244
public String JavaDoc getCurrentOpened() {
245         return currentOpened;
246     }
247
248     public void setCurrentOpened(String JavaDoc s) {
249         currentOpened = s;
250     }
251
252     public String JavaDoc getCurrentBusy() {
253         return currentBusy;
254     }
255
256     public void setCurrentBusy(String JavaDoc s) {
257         currentBusy = s;
258     }
259
260     public String JavaDoc getCurrentInTx() {
261         return currentInTx;
262     }
263
264     public void setCurrentInTx(String JavaDoc s) {
265         currentInTx = s;
266     }
267
268     public String JavaDoc getOpenedCount() {
269         return openedCount;
270     }
271
272     public void setOpenedCount(String JavaDoc s) {
273         openedCount = s;
274     }
275
276     public String JavaDoc getConnectionFailures() {
277         return connectionFailures;
278     }
279
280     public void setConnectionFailures(String JavaDoc s) {
281         connectionFailures = s;
282     }
283
284     public String JavaDoc getConnectionLeaks() {
285         return connectionLeaks;
286     }
287
288     public void setConnectionLeaks(String JavaDoc s) {
289         connectionLeaks = s;
290     }
291
292     public String JavaDoc getCurrentWaiters() {
293         return currentWaiters;
294     }
295
296     public void setCurrentWaiters(String JavaDoc s) {
297         currentWaiters = s;
298     }
299
300     public String JavaDoc getWaitersHigh() {
301         return waitersHigh;
302     }
303
304     public void setWaitersHigh(String JavaDoc s) {
305         waitersHigh = s;
306     }
307
308     public String JavaDoc getWaitersHighRecent() {
309         return waitersHighRecent;
310     }
311
312     public void setWaitersHighRecent(String JavaDoc s) {
313         waitersHighRecent = s;
314     }
315
316     public String JavaDoc getBusyMaxRecent() {
317         return busyMaxRecent;
318     }
319
320     public void setBusyMaxRecent(String JavaDoc s) {
321         busyMaxRecent = s;
322     }
323
324     public String JavaDoc getBusyMinRecent() {
325         return busyMinRecent;
326     }
327
328     public void setBusyMinRecent(String JavaDoc s) {
329         busyMinRecent = s;
330     }
331
332     public String JavaDoc getWaiterCount() {
333         return waiterCount;
334     }
335
336     public void setWaiterCount(String JavaDoc s) {
337         waiterCount = s;
338     }
339
340     public String JavaDoc getWaitingTime() {
341         return waitingTime;
342     }
343
344     public void setWaitingTime(String JavaDoc s) {
345         waitingTime = s;
346     }
347
348     public String JavaDoc getWaitingHigh() {
349         return waitingHigh;
350     }
351
352     public void setWaitingHigh(String JavaDoc s) {
353         waitingHigh = s;
354     }
355
356     public String JavaDoc getWaitingHighRecent() {
357         return waitingHighRecent;
358     }
359
360     public void setWaitingHighRecent(String JavaDoc s) {
361         waitingHighRecent = s;
362     }
363
364     public String JavaDoc getServedOpen() {
365         return servedOpen;
366     }
367
368     public void setServedOpen(String JavaDoc s) {
369         servedOpen = s;
370     }
371
372     public String JavaDoc getRejectedOpen() {
373         return rejectedOpen;
374     }
375
376     public void setRejectedOpen(String JavaDoc s) {
377         rejectedOpen = s;
378     }
379
380     public String JavaDoc getRejectedFull() {
381         return rejectedFull;
382     }
383
384     public void setRejectedFull(String JavaDoc s) {
385         rejectedFull = s;
386     }
387
388     public String JavaDoc getRejectedTimeout() {
389         return rejectedTimeout;
390     }
391
392     public void setRejectedTimeout(String JavaDoc s) {
393         rejectedTimeout = s;
394     }
395
396     public String JavaDoc getRejectedOther() {
397         return rejectedOther;
398     }
399
400     public void setRejectedOther(String JavaDoc s) {
401         rejectedOther = s;
402     }
403
404     public String JavaDoc getJdbcConnCheckLevel() {
405         return jdbcConnCheckLevel;
406     }
407
408     public void setJdbcConnCheckLevel(String JavaDoc jdbcConnCheckLevel) {
409         this.jdbcConnCheckLevel = jdbcConnCheckLevel;
410     }
411
412     public String JavaDoc getConnMaxAge() {
413         return connMaxAge;
414     }
415
416     public void setConnMaxAge(String JavaDoc s) {
417         connMaxAge = s;
418     }
419
420     public String JavaDoc getMaxOpentime() {
421         return maxOpentime;
422     }
423
424     public void setMaxOpentime(String JavaDoc s) {
425         maxOpentime = s;
426     }
427
428     public String JavaDoc getMaxSize() {
429         return maxSize;
430     }
431
432     public void setMaxSize(String JavaDoc maxSize) {
433         this.maxSize = maxSize;
434     }
435
436     public String JavaDoc getMinSize() {
437         return minSize;
438     }
439
440     public void setMinSize(String JavaDoc minSize) {
441         this.minSize = minSize;
442     }
443
444     public String JavaDoc getMaxWaitTime() {
445         return maxWaitTime;
446     }
447
448     public void setMaxWaitTime(String JavaDoc maxWaitTime) {
449         this.maxWaitTime = maxWaitTime;
450     }
451
452     public String JavaDoc getMaxWaiters() {
453         return maxWaiters;
454     }
455
456     public void setMaxWaiters(String JavaDoc s) {
457         this.maxWaiters = s;
458     }
459
460     public String JavaDoc getSamplingPeriod() {
461         return samplingPeriod;
462     }
463
464     public void setSamplingPeriod(String JavaDoc s) {
465         this.samplingPeriod = s;
466     }
467
468     public String JavaDoc getJdbcTestStatement() {
469         return jdbcTestStatement;
470     }
471
472     public void setJdbcTestStatement(String JavaDoc jdbcTestStatement) {
473         this.jdbcTestStatement = jdbcTestStatement;
474     }
475
476     public java.util.List JavaDoc getCheckingLevels() {
477         return checkingLevels;
478     }
479
480     public ArrayList JavaDoc getListUsedByEjb() {
481         return listUsedByEjb;
482     }
483
484     public void setListUsedByEjb(ArrayList JavaDoc listUsedByEjb) {
485         this.listUsedByEjb = listUsedByEjb;
486     }
487     
488
489 }
Popular Tags