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: DeployForm.java 8101 2006-03-09 15:04:41Z danesa $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.webapp.jonasadmin.deploy;
027:
028: import java.util.ArrayList;
029:
030: import javax.servlet.http.HttpServletRequest;
031:
032: import org.apache.struts.action.ActionErrors;
033: import org.apache.struts.action.ActionForm;
034: import org.apache.struts.action.ActionMapping;
035: import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
036:
037: /**
038: * @author Michel-Ange ANTON
039: * @author Adriana Danes
040: */
041:
042: public class DeployForm extends ActionForm {
043:
044: // --------------------------------------------------------- Constants
045:
046: // --------------------------------------------------------- Properties variables
047:
048: private ArrayList listDeployable = new ArrayList();
049: private ArrayList listDeployed = new ArrayList();
050: private ArrayList listDeploy = new ArrayList();
051: private ArrayList listUndeploy = new ArrayList();
052: private String deploy = null;
053: private String undeploy = null;
054: private String[] deploySelected = new String[0];
055: private String[] undeploySelected = new String[0];
056: private ArrayList listAdd = new ArrayList();
057: private ArrayList listRemove = new ArrayList();
058: private boolean confirm = false;
059: private boolean isConfigurable;
060: /**
061: * True if the deoable/udeployable is a JAR, WAR, RAR or EAR
062: */
063: private boolean isModule;
064:
065: // --------------------------------------------------------- Public Methods
066:
067: /**
068: * Reset all properties to their default values.
069: *
070: * @param mapping The mapping used to select this instance
071: * @param request The servlet request we are processing
072: */
073:
074: public void reset(ActionMapping mapping, HttpServletRequest request) {
075: deploySelected = new String[0];
076: undeploySelected = new String[0];
077: }
078:
079: /**
080: * Validate the properties that have been set from this HTTP request,
081: * and return an <code>ActionErrors</code> object that encapsulates any
082: * validation errors that have been found. If no errors are found, return
083: * <code>null</code> or an <code>ActionErrors</code> object with no
084: * recorded error messages.
085: *
086: * @param mapping The mapping used to select this instance
087: * @param request The servlet request we are processing
088: */
089: public ActionErrors validate(ActionMapping mapping,
090: HttpServletRequest request) {
091: ActionErrors oErrors = new ActionErrors();
092: return oErrors;
093: }
094:
095: public String toString() {
096: StringBuffer sb = new StringBuffer();
097: sb.append(" listDeployable = ").append(listDeployable).append(
098: "\n");
099: sb.append(" listDeployed = ").append(listDeployed).append("\n");
100: sb.append(" listDeploy = ").append(listDeploy).append("\n");
101: sb.append(" listUndeploy = ").append(listUndeploy).append("\n");
102: sb.append(" listAdd = ").append(listAdd).append("\n");
103: sb.append(" listRemove = ").append(listRemove).append("\n");
104: sb.append(" deploySelected = [");
105: for (int i = 0; i < deploySelected.length; i++) {
106: if (i > 0) {
107: sb.append(", ");
108: }
109: sb.append(deploySelected[i]);
110: }
111: sb.append("]\n");
112: sb.append(" undeploySelected = [");
113: for (int i = 0; i < undeploySelected.length; i++) {
114: if (i > 0) {
115: sb.append(", ");
116: }
117: sb.append(undeploySelected[i]);
118: }
119: sb.append("]\n");
120:
121: sb.append(" deploy = ").append(deploy).append("\n");
122: sb.append(" undeploy = ").append(undeploy).append("\n");
123:
124: return sb.toString();
125: }
126:
127: // --------------------------------------------------------- Properties Methods
128:
129: public ArrayList getListDeployable() {
130: return listDeployable;
131: }
132:
133: public void setListDeployable(ArrayList listDeployable) {
134: this .listDeployable = listDeployable;
135: }
136:
137: public ArrayList getListDeployed() {
138: return listDeployed;
139: }
140:
141: public void setListDeployed(ArrayList listDeployed) {
142: this .listDeployed = listDeployed;
143: }
144:
145: public String[] getDeploySelected() {
146: return deploySelected;
147: }
148:
149: public void setDeploySelected(String[] deploySelected) {
150: this .deploySelected = deploySelected;
151: }
152:
153: public String[] getUndeploySelected() {
154: return undeploySelected;
155: }
156:
157: public void setUndeploySelected(String[] undeploySelected) {
158: this .undeploySelected = undeploySelected;
159: }
160:
161: public ArrayList getListDeploy() {
162: return listDeploy;
163: }
164:
165: public void setListDeploy(ArrayList listDeploy) {
166: this .listDeploy = listDeploy;
167: }
168:
169: public ArrayList getListUndeploy() {
170: return listUndeploy;
171: }
172:
173: public void setListUndeploy(ArrayList listUndeploy) {
174: this .listUndeploy = listUndeploy;
175: }
176:
177: public String getDeploy() {
178: return deploy;
179: }
180:
181: public void setDeploy(String deploy) {
182: this .deploy = deploy;
183: }
184:
185: public String getUndeploy() {
186: return undeploy;
187: }
188:
189: public void setUndeploy(String undeploy) {
190: this .undeploy = undeploy;
191: }
192:
193: public ArrayList getListAdd() {
194: return listAdd;
195: }
196:
197: public void setListAdd(ArrayList listAdd) {
198: this .listAdd = listAdd;
199: }
200:
201: public ArrayList getListRemove() {
202: return listRemove;
203: }
204:
205: public void setListRemove(ArrayList listRemove) {
206: this .listRemove = listRemove;
207: }
208:
209: public boolean isConfirm() {
210: return confirm;
211: }
212:
213: public void setConfirm(boolean confirm) {
214: this .confirm = confirm;
215: }
216:
217: /**
218: * Return if the current deployment type is configurable.
219: * @return if the current deployment type is configurable.
220: */
221: public boolean getIsConfigurable() {
222: return this .isConfigurable;
223: }
224:
225: /**
226: * Sets if the current deployment type is configurable.
227: * @param isDomain if current deployment type is configurable.
228: */
229: public void setIsConfigurable(boolean isConfigurable) {
230: this .isConfigurable = isConfigurable;
231: }
232:
233: /**
234: * Return true if the current deployment on a server concerns a JAR, RAR, WAR or EAR
235: * @return true if the current deployment on a server concerns a JAR, RAR, WAR or EAR
236: */
237: public boolean getIsModule() {
238: return isModule;
239: }
240:
241: /**
242: * Set isModule to true if the current deployment on a server concerns a JAR, RAR, WAR or EAR
243: * @param isModule true if the current deployment on a server concerns a JAR, RAR, WAR or EAR
244: */
245: public void setIsModule(boolean isModule) {
246: this.isModule = isModule;
247: }
248:
249: }
|