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: */package org.objectweb.jonas.webapp.jonasadmin.joramplatform;
021:
022: import javax.servlet.http.HttpServletRequest;
023:
024: import org.apache.struts.action.ActionErrors;
025: import org.apache.struts.action.ActionForm;
026: import org.apache.struts.action.ActionMapping;
027:
028: /**
029: * Form bean for the Joram platform form page.
030: * @author Frederic MAISTRE
031: * @author Adriana Danes
032: */
033:
034: public final class JoramPlatformForm extends ActionForm {
035:
036: // ------------------------------------------------------------- Properties Variables
037:
038: /**
039: * local server's id
040: * */
041: private String localServer = null;
042: /**
043: * remote servers ids
044: */
045: private String[] remoteServers = null;
046: /**
047: * True if a Joram adapter RAR is loaded on the current server
048: */
049: private boolean adapterLoaded = false;
050: /**
051: * a3servers.xml content
052: */
053: private String configuration = null;
054:
055: private int localPort;
056:
057: private String localHost = null;
058:
059: private int defaultThreshold;
060:
061: private String defaultDMQ = null;
062:
063: // The properties below are provided only if the Joram resource adapter is
064: // deployed on the current server
065: /**
066: * RA version (Joram version also)
067: */
068: private String version = null;
069: /**
070: * Duration in seconds during which connecting is attempted (connecting
071: * might take time if the server is temporarily not reachable); the 0 value
072: * is set for connecting only once and aborting if connecting failed.
073: */
074: private String connectingTimerTxt = null;
075: /**
076: * Duration in seconds during which a JMS transacted (non XA) session might
077: * be pending; above that duration the session is rolled back and closed;
078: * the 0 value means "no timer".
079: */
080: private String txPendingTimerTxt = null;
081: /**
082: * Period in milliseconds between two ping requests sent by the client
083: * connection to the server; if the server does not receive any ping
084: * request during more than 2 * cnxPendingTimer, the connection is
085: * considered as dead and processed as required.
086: */
087: private String cnxPendingTimerTxt = null;
088:
089: /**
090: * True: when deploying, the adapter starts a collocated JORAM server.
091: * False: when deploying, the adapter connects to a remote JORAM server.
092: */
093: private boolean collocatedServer;
094: // Following properties usefull when starting a collocated server
095: /**
096: * Directory where the a3servers.xml and joramAdmin.xml files are locate
097: */
098: private String configDir = null;
099: /**
100: * Name of the file describing the administration tasks to perform
101: * (by default joramAdmin.xml)
102: */
103: private String adminFile = null;
104: /**
105: * Persistence mode of the collocated JORAM server
106: */
107: private boolean persistentServer;
108: /**
109: * Identifier of the JORAM server to start
110: */
111: private String serverIdTxt = null;
112: /**
113: * Name of the JORAM server to start
114: */
115: private String serverName = null;
116: // The following properties usefull when manageing a remote server
117: /**
118: * Name of the host where the JORAM server runs
119: */
120: private String hostName = null;
121: /**
122: * Port the JORAM server is listening on
123: */
124: private String serverPortTxt = null;
125:
126: private long timeOutToAbortRequest;
127:
128: // ------------------------------------------------------------- Public Methods
129:
130: /**
131: * Reset all properties to their default values.
132: *
133: * @param mapping The mapping used to select this instance
134: * @param request The servlet request we are processing
135: */
136: public void reset(ActionMapping mapping, HttpServletRequest request) {
137: version = null;
138: localServer = null;
139: remoteServers = null;
140: adapterLoaded = false;
141: configuration = null;
142: }
143:
144: /**
145: * Validate the properties that have been set from this HTTP request,
146: * and return an <code>ActionErrors</code> object that encapsulates any
147: * validation errors that have been found. If no errors are found, return
148: * <code>null</code> or an <code>ActionErrors</code> object with no
149: * recorded error messages.
150: *
151: * @param mapping The mapping used to select this instance
152: * @param request The servlet request we are processing
153: */
154: public ActionErrors validate(ActionMapping mapping,
155: HttpServletRequest request) {
156: return new ActionErrors();
157: }
158:
159: /**
160: * @return Returns the localServer.
161: */
162: public String getLocalServer() {
163: return localServer;
164: }
165:
166: /**
167: * @param localServer The localServer to set.
168: */
169: public void setLocalServer(String localServer) {
170: this .localServer = localServer;
171: }
172:
173: /**
174: * @return Returns the remoteServers.
175: */
176: public String[] getRemoteServers() {
177: return remoteServers;
178: }
179:
180: /**
181: * @param remoteServers The remoteServers to set.
182: */
183: public void setRemoteServers(String[] 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 getConfiguration() {
205: return configuration;
206: }
207:
208: /**
209: * @param configuration The configuration to set.
210: */
211: public void setConfiguration(String configuration) {
212: this .configuration = configuration;
213: }
214:
215: /**
216: * @return Returns the version.
217: */
218: public String getVersion() {
219: return version;
220: }
221:
222: /**
223: * @param version The version to set.
224: */
225: public void setVersion(String 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 getConfigDir() {
275: return configDir;
276: }
277:
278: /**
279: * @param configDir The configDir to set.
280: */
281: public void setConfigDir(String configDir) {
282: this .configDir = configDir;
283: }
284:
285: /**
286: * @return Returns the adminFile.
287: */
288: public String getAdminFile() {
289: return adminFile;
290: }
291:
292: /**
293: * @param adminFile The adminFile to set.
294: */
295: public void setAdminFile(String 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 getServerIdTxt() {
317: return serverIdTxt;
318: }
319:
320: /**
321: * @param serverIdTxt The serverIdTxt to set.
322: */
323: public void setServerIdTxt(String serverIdTxt) {
324: this .serverIdTxt = serverIdTxt;
325: }
326:
327: /**
328: * @return Returns the serverName.
329: */
330: public String getServerName() {
331: return serverName;
332: }
333:
334: /**
335: * @param serverName The serverName to set.
336: */
337: public void setServerName(String serverName) {
338: this .serverName = serverName;
339: }
340:
341: /**
342: * @return Returns the hostName.
343: */
344: public String getHostName() {
345: return hostName;
346: }
347:
348: /**
349: * @param hostName The hostName to set.
350: */
351: public void setHostName(String hostName) {
352: this .hostName = hostName;
353: }
354:
355: /**
356: * @return Returns the serverPortTxt.
357: */
358: public String getServerPortTxt() {
359: return serverPortTxt;
360: }
361:
362: /**
363: * @param serverPortTxt The serverPortTxt to set.
364: */
365: public void setServerPortTxt(String serverPortTxt) {
366: this .serverPortTxt = serverPortTxt;
367: }
368:
369: /**
370: * @return Returns the cnxPendingTimerTxt.
371: */
372: public String getCnxPendingTimerTxt() {
373: return cnxPendingTimerTxt;
374: }
375:
376: /**
377: * @param cnxPendingTimerTxt The cnxPendingTimerTxt to set.
378: */
379: public void setCnxPendingTimerTxt(String cnxPendingTimerTxt) {
380: this .cnxPendingTimerTxt = cnxPendingTimerTxt;
381: }
382:
383: /**
384: * @return Returns the connectingTimerTxt.
385: */
386: public String getConnectingTimerTxt() {
387: return connectingTimerTxt;
388: }
389:
390: /**
391: * @param connectingTimerTxt The connectingTimerTxt to set.
392: */
393: public void setConnectingTimerTxt(String connectingTimerTxt) {
394: this .connectingTimerTxt = connectingTimerTxt;
395: }
396:
397: /**
398: * @return Returns the txPendingTimerTxt.
399: */
400: public String getTxPendingTimerTxt() {
401: return txPendingTimerTxt;
402: }
403:
404: /**
405: * @param txPendingTimerTxt The txPendingTimerTxt to set.
406: */
407: public void setTxPendingTimerTxt(String txPendingTimerTxt) {
408: this .txPendingTimerTxt = txPendingTimerTxt;
409: }
410:
411: /**
412: * @return Returns the localHost.
413: */
414: public String getLocalHost() {
415: return localHost;
416: }
417:
418: /**
419: * @param localHost The localHost to set.
420: */
421: public void setLocalHost(String 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 getDefaultDMQ() {
443: return defaultDMQ;
444: }
445:
446: /**
447: * @param defaultDMQ The defaultDMQ to set.
448: */
449: public void setDefaultDMQ(String defaultDMQ) {
450: this.defaultDMQ = defaultDMQ;
451: }
452: }
|