001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2005 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 Adapter form page.
030: * @author Adriana Danes
031: */
032:
033: public final class JoramAdapterForm extends ActionForm {
034:
035: // ------------------------------------------------------------- Properties Variables
036: /**
037: * True: when deploying, the adapter starts a collocated JORAM server.
038: * False: when deploying, the adapter connects to a remote JORAM server.
039: */
040: private boolean collocatedServer;
041: // Following properties usefull when starting a collocated server
042: /**
043: * Directory where the a3servers.xml and joramAdmin.xml files are located
044: */
045: private String configDir = null;
046: /**
047: * Name of the file describing the administration tasks to perform
048: * (by default joramAdmin.xml)
049: */
050: private String adminFile = null;
051: /**
052: * Persistence mode of the collocated JORAM server
053: */
054: private boolean persistentServer;
055: /**
056: * Identifier of the JORAM server to start
057: */
058: private String serverIdTxt = null;
059: /**
060: * Name of the JORAM server to start
061: */
062: private String serverName = null;
063: // The following properties usefull when manageing a remote server
064: private String version = null;
065: /**
066: * Name of the host where the JORAM server runs
067: */
068: private String hostName = null;
069: /**
070: * Port the JORAM server is listening on
071: */
072: private String serverPortTxt = null;
073: /**
074: *
075: */
076: private String cnxPendingTimerTxt = null;
077: /**
078: *
079: */
080: private String connectingTimerTxt = null;
081: /**
082: *
083: */
084: private String txPendingTimerTxt = null;
085:
086: // ------------------------------------------------------------- Properties Methods
087:
088: public String getVersion() {
089: return version;
090: }
091:
092: public void setVersion(String version) {
093: this .version = version;
094: }
095:
096: /**
097: * @return Returns the collocatedServer.
098: */
099: public boolean isCollocatedServer() {
100: return collocatedServer;
101: }
102:
103: /**
104: * @param collocatedServer The collocatedServer to set.
105: */
106: public void setCollocatedServer(boolean collocatedServer) {
107: this .collocatedServer = collocatedServer;
108: }
109:
110: /**
111: * @return Returns the configDir.
112: */
113: public String getConfigDir() {
114: return configDir;
115: }
116:
117: /**
118: * @param configDir The configDir to set.
119: */
120: public void setConfigDir(String configDir) {
121: this .configDir = configDir;
122: }
123:
124: /**
125: * @return Returns the adminFile.
126: */
127: public String getAdminFile() {
128: return adminFile;
129: }
130:
131: /**
132: * @param adminFile The adminFile to set.
133: */
134: public void setAdminFile(String adminFile) {
135: this .adminFile = adminFile;
136: }
137:
138: /**
139: * @return Returns the persistentServer.
140: */
141: public boolean isPersistentServer() {
142: return persistentServer;
143: }
144:
145: /**
146: * @param persistentServer The persistentServer to set.
147: */
148: public void setPersistentServer(boolean persistentServer) {
149: this .persistentServer = persistentServer;
150: }
151:
152: /**
153: * @return Returns the serverIdTxt.
154: */
155: public String getServerIdTxt() {
156: return serverIdTxt;
157: }
158:
159: /**
160: * @param serverIdTxt The serverIdTxt to set.
161: */
162: public void setServerIdTxt(String serverIdTxt) {
163: this .serverIdTxt = serverIdTxt;
164: }
165:
166: /**
167: * @return Returns the serverName.
168: */
169: public String getServerName() {
170: return serverName;
171: }
172:
173: /**
174: * @param serverName The serverName to set.
175: */
176: public void setServerName(String serverName) {
177: this .serverName = serverName;
178: }
179:
180: /**
181: * @return Returns the hostName.
182: */
183: public String getHostName() {
184: return hostName;
185: }
186:
187: /**
188: * @param hostName The hostName to set.
189: */
190: public void setHostName(String hostName) {
191: this .hostName = hostName;
192: }
193:
194: /**
195: * @return Returns the serverPortTxt.
196: */
197: public String getServerPortTxt() {
198: return serverPortTxt;
199: }
200:
201: /**
202: * @param serverPortTxt The serverPortTxt to set.
203: */
204: public void setServerPortTxt(String serverPortTxt) {
205: this .serverPortTxt = serverPortTxt;
206: }
207:
208: /**
209: * @return Returns the cnxPendingTimerTxt.
210: */
211: public String getCnxPendingTimerTxt() {
212: return cnxPendingTimerTxt;
213: }
214:
215: /**
216: * @param cnxPendingTimerTxt The cnxPendingTimerTxt to set.
217: */
218: public void setCnxPendingTimerTxt(String cnxPendingTimerTxt) {
219: this .cnxPendingTimerTxt = cnxPendingTimerTxt;
220: }
221:
222: /**
223: * @return Returns the connectingTimerTxt.
224: */
225: public String getConnectingTimerTxt() {
226: return connectingTimerTxt;
227: }
228:
229: /**
230: * @param connectingTimerTxt The connectingTimerTxt to set.
231: */
232: public void setConnectingTimerTxt(String connectingTimerTxt) {
233: this .connectingTimerTxt = connectingTimerTxt;
234: }
235:
236: /**
237: * @return Returns the txPendingTimerTxt.
238: */
239: public String getTxPendingTimerTxt() {
240: return txPendingTimerTxt;
241: }
242:
243: /**
244: * @param txPendingTimerTxt The txPendingTimerTxt to set.
245: */
246: public void setTxPendingTimerTxt(String txPendingTimerTxt) {
247: this .txPendingTimerTxt = txPendingTimerTxt;
248: }
249:
250: // ------------------------------------------------------------- Public Methods
251:
252: /**
253: * Reset all properties to their default values.
254: *
255: * @param mapping The mapping used to select this instance
256: * @param request The servlet request we are processing
257: */
258: public void reset(ActionMapping mapping, HttpServletRequest request) {
259: version = null;
260: }
261:
262: /**
263: * Validate the properties that have been set from this HTTP request,
264: * and return an <code>ActionErrors</code> object that encapsulates any
265: * validation errors that have been found. If no errors are found, return
266: * <code>null</code> or an <code>ActionErrors</code> object with no
267: * recorded error messages.
268: *
269: * @param mapping The mapping used to select this instance
270: * @param request The servlet request we are processing
271: */
272: public ActionErrors validate(ActionMapping mapping,
273: HttpServletRequest request) {
274: return new ActionErrors();
275: }
276:
277: }
|