KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > deploy > DeployForm


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: DeployForm.java,v 1.5 2003/09/08 16:11:20 antonma Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.deploy;
27
28 import java.util.ArrayList JavaDoc;
29
30 import javax.servlet.http.HttpServletRequest JavaDoc;
31
32 import org.apache.struts.action.ActionErrors;
33 import org.apache.struts.action.ActionForm;
34 import org.apache.struts.action.ActionMapping;
35
36 /**
37  * @author Michel-Ange ANTON
38  */

39
40 public class DeployForm extends ActionForm {
41
42 // --------------------------------------------------------- Constants
43

44 // --------------------------------------------------------- Properties variables
45

46     private ArrayList JavaDoc listDeployable = new ArrayList JavaDoc();
47     private ArrayList JavaDoc listDeployed = new ArrayList JavaDoc();
48     private ArrayList JavaDoc listDeploy = new ArrayList JavaDoc();
49     private ArrayList JavaDoc listUndeploy = new ArrayList JavaDoc();
50     private String JavaDoc deploy = null;
51     private String JavaDoc undeploy = null;
52     private String JavaDoc[] deploySelected = new String JavaDoc[0];
53     private String JavaDoc[] undeploySelected = new String JavaDoc[0];
54     private ArrayList JavaDoc listAdd = new ArrayList JavaDoc();
55     private ArrayList JavaDoc listRemove = new ArrayList JavaDoc();
56     private boolean confirm = false;
57
58 // --------------------------------------------------------- Public Methods
59

60     /**
61      * Reset all properties to their default values.
62      *
63      * @param mapping The mapping used to select this instance
64      * @param request The servlet request we are processing
65      */

66
67     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
68         deploySelected = new String JavaDoc[0];
69         undeploySelected = new String JavaDoc[0];
70     }
71
72     /**
73      * Validate the properties that have been set from this HTTP request,
74      * and return an <code>ActionErrors</code> object that encapsulates any
75      * validation errors that have been found. If no errors are found, return
76      * <code>null</code> or an <code>ActionErrors</code> object with no
77      * recorded error messages.
78      *
79      * @param mapping The mapping used to select this instance
80      * @param request The servlet request we are processing
81      */

82     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
83         ActionErrors oErrors = new ActionErrors();
84         return oErrors;
85     }
86
87     public String JavaDoc toString() {
88         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
89         sb.append(" listDeployable = ").append(listDeployable).append("\n");
90         sb.append(" listDeployed = ").append(listDeployed).append("\n");
91         sb.append(" listDeploy = ").append(listDeploy).append("\n");
92         sb.append(" listUndeploy = ").append(listUndeploy).append("\n");
93         sb.append(" listAdd = ").append(listAdd).append("\n");
94         sb.append(" listRemove = ").append(listRemove).append("\n");
95         sb.append(" deploySelected = [");
96         for (int i = 0; i < deploySelected.length; i++) {
97             if (i > 0) {
98                 sb.append(", ");
99             }
100             sb.append(deploySelected[i]);
101         }
102         sb.append("]\n");
103         sb.append(" undeploySelected = [");
104         for (int i = 0; i < undeploySelected.length; i++) {
105             if (i > 0) {
106                 sb.append(", ");
107             }
108             sb.append(undeploySelected[i]);
109         }
110         sb.append("]\n");
111
112         sb.append(" deploy = ").append(deploy).append("\n");
113         sb.append(" undeploy = ").append(undeploy).append("\n");
114
115         return sb.toString();
116     }
117
118 // --------------------------------------------------------- Properties Methods
119

120     public ArrayList JavaDoc getListDeployable() {
121         return listDeployable;
122     }
123
124     public void setListDeployable(ArrayList JavaDoc listDeployable) {
125         this.listDeployable = listDeployable;
126     }
127
128     public ArrayList JavaDoc getListDeployed() {
129         return listDeployed;
130     }
131
132     public void setListDeployed(ArrayList JavaDoc listDeployed) {
133         this.listDeployed = listDeployed;
134     }
135
136     public String JavaDoc[] getDeploySelected() {
137         return deploySelected;
138     }
139
140     public void setDeploySelected(String JavaDoc[] deploySelected) {
141         this.deploySelected = deploySelected;
142     }
143
144     public String JavaDoc[] getUndeploySelected() {
145         return undeploySelected;
146     }
147
148     public void setUndeploySelected(String JavaDoc[] undeploySelected) {
149         this.undeploySelected = undeploySelected;
150     }
151
152     public ArrayList JavaDoc getListDeploy() {
153         return listDeploy;
154     }
155
156     public void setListDeploy(ArrayList JavaDoc listDeploy) {
157         this.listDeploy = listDeploy;
158     }
159
160     public ArrayList JavaDoc getListUndeploy() {
161         return listUndeploy;
162     }
163
164     public void setListUndeploy(ArrayList JavaDoc listUndeploy) {
165         this.listUndeploy = listUndeploy;
166     }
167
168     public String JavaDoc getDeploy() {
169         return deploy;
170     }
171
172     public void setDeploy(String JavaDoc deploy) {
173         this.deploy = deploy;
174     }
175
176     public String JavaDoc getUndeploy() {
177         return undeploy;
178     }
179
180     public void setUndeploy(String JavaDoc undeploy) {
181         this.undeploy = undeploy;
182     }
183
184     public ArrayList JavaDoc getListAdd() {
185         return listAdd;
186     }
187
188     public void setListAdd(ArrayList JavaDoc listAdd) {
189         this.listAdd = listAdd;
190     }
191
192     public ArrayList JavaDoc getListRemove() {
193         return listRemove;
194     }
195
196     public void setListRemove(ArrayList JavaDoc listRemove) {
197         this.listRemove = listRemove;
198     }
199
200     public boolean isConfirm() {
201         return confirm;
202     }
203
204     public void setConfirm(boolean confirm) {
205         this.confirm = confirm;
206     }
207
208 }
Popular Tags