KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > joramplatform > JoramPlatformForm


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 package org.objectweb.jonas.webapp.jonasadmin.joramplatform;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25
26 import org.apache.struts.action.ActionErrors;
27 import org.apache.struts.action.ActionForm;
28 import org.apache.struts.action.ActionMapping;
29
30 /**
31  * Form bean for the Joram platform form page.
32  * @author Frederic MAISTRE
33  * @author Adriana Danes
34  */

35
36 public final class JoramPlatformForm extends ActionForm {
37
38 // ------------------------------------------------------------- Properties Variables
39

40     /**
41      * local server's id
42      * */

43     private String JavaDoc localServer = null;
44     /**
45      * remote servers ids
46      */

47     private String JavaDoc[] remoteServers = null;
48     /**
49      * True if a Joram adapter RAR is loaded on the current server
50      */

51     private boolean adapterLoaded = false;
52     /**
53      * a3servers.xml content
54      */

55     private String JavaDoc configuration = null;
56
57     private int localPort;
58
59     private String JavaDoc localHost = null;
60
61     private int defaultThreshold;
62
63     private String JavaDoc defaultDMQ = null;
64
65     // The properties below are provided only if the Joram resource adapter is
66
// deployed on the current server
67
/**
68      * RA version (Joram version also)
69      */

70     private String JavaDoc version = null;
71     /**
72      * Duration in seconds during which connecting is attempted (connecting
73      * might take time if the server is temporarily not reachable); the 0 value
74      * is set for connecting only once and aborting if connecting failed.
75      */

76     private String JavaDoc connectingTimerTxt = null;
77     /**
78      * Duration in seconds during which a JMS transacted (non XA) session might
79      * be pending; above that duration the session is rolled back and closed;
80      * the 0 value means "no timer".
81      */

82     private String JavaDoc txPendingTimerTxt = null;
83     /**
84      * Period in milliseconds between two ping requests sent by the client
85      * connection to the server; if the server does not receive any ping
86      * request during more than 2 * cnxPendingTimer, the connection is
87      * considered as dead and processed as required.
88      */

89     private String JavaDoc cnxPendingTimerTxt = null;
90
91     /**
92      * True: when deploying, the adapter starts a collocated JORAM server.
93      * False: when deploying, the adapter connects to a remote JORAM server.
94      */

95     private boolean collocatedServer;
96     // Following properties usefull when starting a collocated server
97
/**
98      * Directory where the a3servers.xml and joram-admin.cfg files are locate
99      */

100     private String JavaDoc configDir = null;
101     /**
102      * Name of the file describing the administration tasks to perform
103      * (by default joram-admin.cfg)
104      */

105     private String JavaDoc adminFile = null;
106     /**
107      * Persistence mode of the collocated JORAM server
108      */

109     private boolean persistentServer;
110     /**
111      * Identifier of the JORAM server to start
112      */

113     private String JavaDoc serverIdTxt = null;
114     /**
115      * Name of the JORAM server to start
116      */

117     private String JavaDoc serverName = null;
118     // The following properties usefull when manageing a remote server
119
/**
120      * Name of the host where the JORAM server runs
121      */

122     private String JavaDoc hostName = null;
123     /**
124      * Port the JORAM server is listening on
125      */

126     private String JavaDoc serverPortTxt = null;
127
128     private long timeOutToAbortRequest;
129 // ------------------------------------------------------------- Public Methods
130

131     /**
132      * Reset all properties to their default values.
133      *
134      * @param mapping The mapping used to select this instance
135      * @param request The servlet request we are processing
136      */

137     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
138         version = null;
139         localServer = null;
140         remoteServers = null;
141         adapterLoaded = false;
142         configuration = null;
143     }
144
145     /**
146      * Validate the properties that have been set from this HTTP request,
147      * and return an <code>ActionErrors</code> object that encapsulates any
148      * validation errors that have been found. If no errors are found, return
149      * <code>null</code> or an <code>ActionErrors</code> object with no
150      * recorded error messages.
151      *
152      * @param mapping The mapping used to select this instance
153      * @param request The servlet request we are processing
154      */

155     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
156         return new ActionErrors();
157     }
158
159     /**
160      * @return Returns the localServer.
161      */

162     public String JavaDoc getLocalServer() {
163         return localServer;
164     }
165
166     /**
167      * @param localServer The localServer to set.
168      */

169     public void setLocalServer(String JavaDoc localServer) {
170         this.localServer = localServer;
171     }
172
173     /**
174      * @return Returns the remoteServers.
175      */

176     public String JavaDoc[] getRemoteServers() {
177         return remoteServers;
178     }
179
180     /**
181      * @param remoteServers The remoteServers to set.
182      */

183     public void setRemoteServers(String JavaDoc[] remoteServers) {
184         this.remoteServers = remoteServers;
185     }
186
187     /**
188      * @return Returns the isAdapterLoaded.
189      */

190     public boolean getAdapterLoaded() {
191         return adapterLoaded;
192     }
193
194     /**
195      * @param isAdapterLoaded The isAdapterLoaded to set.
196      */

197     public void setAdapterLoaded(boolean adapterLoaded) {
198         this.adapterLoaded = adapterLoaded;
199     }
200
201     /**
202      * @return Returns the configuration.
203      */

204     public String JavaDoc getConfiguration() {
205         return configuration;
206     }
207
208     /**
209      * @param configuration The configuration to set.
210      */

211     public void setConfiguration(String JavaDoc configuration) {
212         this.configuration = configuration;
213     }
214
215     /**
216      * @return Returns the version.
217      */

218     public String JavaDoc getVersion() {
219         return version;
220     }
221
222     /**
223      * @param version The version to set.
224      */

225     public void setVersion(String JavaDoc version) {
226         this.version = version;
227     }
228
229     /**
230      * @return Returns the localPort.
231      */

232     public int getLocalPort() {
233         return localPort;
234     }
235
236     /**
237      * @param localPort The localPort to set.
238      */

239     public void setLocalPort(int localPort) {
240         this.localPort = localPort;
241     }
242
243     /**
244      * @return Returns the defaultThreshold.
245      */

246     public int getDefaultThreshold() {
247         return defaultThreshold;
248     }
249
250     /**
251      * @param defaultThreshold The defaultThreshold to set.
252      */

253     public void setDefaultThreshold(int defaultThreshold) {
254         this.defaultThreshold = defaultThreshold;
255     }
256
257     /**
258      * @return Returns the collocatedServer.
259      */

260     public boolean isCollocatedServer() {
261         return collocatedServer;
262     }
263
264     /**
265      * @param collocatedServer The collocatedServer to set.
266      */

267     public void setCollocatedServer(boolean collocatedServer) {
268         this.collocatedServer = collocatedServer;
269     }
270
271     /**
272      * @return Returns the configDir.
273      */

274     public String JavaDoc getConfigDir() {
275         return configDir;
276     }
277
278     /**
279      * @param configDir The configDir to set.
280      */

281     public void setConfigDir(String JavaDoc configDir) {
282         this.configDir = configDir;
283     }
284
285     /**
286      * @return Returns the adminFile.
287      */

288     public String JavaDoc getAdminFile() {
289         return adminFile;
290     }
291
292     /**
293      * @param adminFile The adminFile to set.
294      */

295     public void setAdminFile(String JavaDoc adminFile) {
296         this.adminFile = adminFile;
297     }
298
299     /**
300      * @return Returns the persistentServer.
301      */

302     public boolean isPersistentServer() {
303         return persistentServer;
304     }
305
306     /**
307      * @param persistentServer The persistentServer to set.
308      */

309     public void setPersistentServer(boolean persistentServer) {
310         this.persistentServer = persistentServer;
311     }
312
313     /**
314      * @return Returns the serverIdTxt.
315      */

316     public String JavaDoc getServerIdTxt() {
317         return serverIdTxt;
318     }
319
320     /**
321      * @param serverIdTxt The serverIdTxt to set.
322      */

323     public void setServerIdTxt(String JavaDoc serverIdTxt) {
324         this.serverIdTxt = serverIdTxt;
325     }
326
327     /**
328      * @return Returns the serverName.
329      */

330     public String JavaDoc getServerName() {
331         return serverName;
332     }
333
334     /**
335      * @param serverName The serverName to set.
336      */

337     public void setServerName(String JavaDoc serverName) {
338         this.serverName = serverName;
339     }
340
341     /**
342      * @return Returns the hostName.
343      */

344     public String JavaDoc getHostName() {
345         return hostName;
346     }
347
348     /**
349      * @param hostName The hostName to set.
350      */

351     public void setHostName(String JavaDoc hostName) {
352         this.hostName = hostName;
353     }
354
355     /**
356      * @return Returns the serverPortTxt.
357      */

358     public String JavaDoc getServerPortTxt() {
359         return serverPortTxt;
360     }
361
362     /**
363      * @param serverPortTxt The serverPortTxt to set.
364      */

365     public void setServerPortTxt(String JavaDoc serverPortTxt) {
366         this.serverPortTxt = serverPortTxt;
367     }
368
369     /**
370      * @return Returns the cnxPendingTimerTxt.
371      */

372     public String JavaDoc getCnxPendingTimerTxt() {
373         return cnxPendingTimerTxt;
374     }
375
376     /**
377      * @param cnxPendingTimerTxt The cnxPendingTimerTxt to set.
378      */

379     public void setCnxPendingTimerTxt(String JavaDoc cnxPendingTimerTxt) {
380         this.cnxPendingTimerTxt = cnxPendingTimerTxt;
381     }
382
383     /**
384      * @return Returns the connectingTimerTxt.
385      */

386     public String JavaDoc getConnectingTimerTxt() {
387         return connectingTimerTxt;
388     }
389
390     /**
391      * @param connectingTimerTxt The connectingTimerTxt to set.
392      */

393     public void setConnectingTimerTxt(String JavaDoc connectingTimerTxt) {
394         this.connectingTimerTxt = connectingTimerTxt;
395     }
396
397     /**
398      * @return Returns the txPendingTimerTxt.
399      */

400     public String JavaDoc getTxPendingTimerTxt() {
401         return txPendingTimerTxt;
402     }
403
404     /**
405      * @param txPendingTimerTxt The txPendingTimerTxt to set.
406      */

407     public void setTxPendingTimerTxt(String JavaDoc txPendingTimerTxt) {
408         this.txPendingTimerTxt = txPendingTimerTxt;
409     }
410
411     /**
412      * @return Returns the localHost.
413      */

414     public String JavaDoc getLocalHost() {
415         return localHost;
416     }
417
418     /**
419      * @param localHost The localHost to set.
420      */

421     public void setLocalHost(String JavaDoc localHost) {
422         this.localHost = localHost;
423     }
424
425     /**
426      * @return Returns the timeOutToAbortRequest.
427      */

428     public long getTimeOutToAbortRequest() {
429         return timeOutToAbortRequest;
430     }
431
432     /**
433      * @param timeOutToAbortRequest The timeOutToAbortRequest to set.
434      */

435     public void setTimeOutToAbortRequest(long timeOutToAbortRequest) {
436         this.timeOutToAbortRequest = timeOutToAbortRequest;
437     }
438
439     /**
440      * @return Returns the defaultDMQ.
441      */

442     public String JavaDoc getDefaultDMQ() {
443         return defaultDMQ;
444     }
445
446     /**
447      * @param defaultDMQ The defaultDMQ to set.
448      */

449     public void setDefaultDMQ(String JavaDoc defaultDMQ) {
450         this.defaultDMQ = defaultDMQ;
451     }
452 }
453
Popular Tags