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 java.util.ArrayList;
023: import java.util.List;
024:
025: import javax.management.ObjectName;
026: import javax.servlet.http.HttpServletRequest;
027:
028: import org.apache.struts.action.ActionErrors;
029: import org.apache.struts.action.ActionForm;
030: import org.apache.struts.action.ActionMapping;
031:
032: /**
033: * Form bean for the Joram queue and topic pages
034: * @author Adriana Danes
035: */
036:
037: public class DestinationForm extends ActionForm {
038:
039: // ------------------------------------------------------------- Properties Variables
040: private String action = "edit";
041: /**
042: * admin name (alse jndi name)
043: */
044: private String name = null;
045: /**
046: * associated agent id
047: */
048: private String id = null;
049: /**
050: * name of the EJBs using this destination
051: */
052: private ArrayList listUsedByEjb = new ArrayList();
053: /**
054: * DeadMQueue
055: */
056: private String dmq = null;
057: /**
058: * freelyReadable
059: */
060: private boolean freelyReadable;
061: /**
062: * freelyWriteable
063: */
064: private boolean freelyWriteable;
065: /**
066: * list if readers
067: */
068: //private String readerList = null;
069: private ArrayList readerList = null;
070: /**
071: * list of writers
072: */
073: //private String writerList = null;
074: private ArrayList writerList = null;
075: /**
076: * destination type: queue or topic
077: */
078: private String type = null;
079: /**
080: * creation date
081: */
082: private String creationDate = null;
083: /**
084: * joram client 'queue' type MBean ObjectName
085: */
086: private ObjectName oName = null;
087: /**
088: * Represent boolean (true, false) values for freelyReadable/freelyWriteable
089: */
090: private List booleanVals = null;
091:
092: // ------------------------------------------------------------- Properties Methods
093: public String getAction() {
094: return action;
095: }
096:
097: public void setAction(String action) {
098: this .action = action;
099: }
100:
101: /**
102: * @return Returns the listUsedByEjb.
103: */
104: public ArrayList getListUsedByEjb() {
105: return listUsedByEjb;
106: }
107:
108: /**
109: * @param listUsedByEjb The listUsedByEjb to set.
110: */
111: public void setListUsedByEjb(ArrayList listUsedByEjb) {
112: this .listUsedByEjb = listUsedByEjb;
113: }
114:
115: public String getName() {
116: return name;
117: }
118:
119: public void setName(String name) {
120: this .name = name;
121: }
122:
123: public String getId() {
124: return id;
125: }
126:
127: public void setId(String id) {
128: this .id = id;
129: }
130:
131: /**
132: * @return Returns the dmq.
133: */
134: public String getDmq() {
135: return dmq;
136: }
137:
138: /**
139: * @param dmq The dmq to set.
140: */
141: public void setDmq(String dmq) {
142: this .dmq = dmq;
143: }
144:
145: /**
146: * @return Returns the freelyReadable.
147: */
148: public boolean getFreelyReadable() {
149: return freelyReadable;
150: }
151:
152: /**
153: * @param freelyReadable The freelyReadable to set.
154: */
155: public void setFreelyReadable(boolean freelyReadable) {
156: this .freelyReadable = freelyReadable;
157: }
158:
159: /**
160: * @return Returns the freelyWriteable.
161: */
162: public boolean getFreelyWriteable() {
163: return freelyWriteable;
164: }
165:
166: /**
167: * @param freelyWriteable The freelyWriteable to set.
168: */
169: public void setFreelyWriteable(boolean freelyWriteable) {
170: this .freelyWriteable = freelyWriteable;
171: }
172:
173: /* *//**
174: * @return Returns the readerList.
175: */
176: /*
177: public String getReaderList() {
178: return readerList;
179: }
180: *//**
181: * @param readerList The readerList to set.
182: */
183: /*
184: public void setReaderList(String readerList) {
185: this.readerList = readerList;
186: }
187: *//**
188: * @return Returns the writerList.
189: */
190: /*
191: public String getWriterList() {
192: return writerList;
193: }
194: *//**
195: * @param writerList The writerList to set.
196: */
197: /*
198: public void setWriterList(String writerList) {
199: this.writerList = writerList;
200: }*/
201: /**
202: * @return Returns the type.
203: */
204: public String getType() {
205: return type;
206: }
207:
208: /**
209: * @param type The type to set.
210: */
211: public void setType(String type) {
212: this .type = type;
213: }
214:
215: /**
216: * @return Returns the creationDate.
217: */
218: public String getCreationDate() {
219: return creationDate;
220: }
221:
222: /**
223: * @param creationDate The creationDate to set.
224: */
225: public void setCreationDate(String creationDate) {
226: this .creationDate = creationDate;
227: }
228:
229: // ------------------------------------------------------------- Public Methods
230:
231: /**
232: * Reset all properties to their default values.
233: *
234: * @param mapping The mapping used to select this instance
235: * @param request The servlet request we are processing
236: */
237: public void reset(ActionMapping mapping, HttpServletRequest request) {
238: name = null;
239: id = null;
240: listUsedByEjb = new ArrayList();
241: dmq = null;
242: freelyReadable = true;
243: freelyWriteable = true;
244: readerList = null;
245: writerList = null;
246: type = null;
247: }
248:
249: /**
250: * Validate the properties that have been set from this HTTP request,
251: * and return an <code>ActionErrors</code> object that encapsulates any
252: * validation errors that have been found. If no errors are found, return
253: * <code>null</code> or an <code>ActionErrors</code> object with no
254: * recorded error messages.
255: *
256: * @param mapping The mapping used to select this instance
257: * @param request The servlet request we are processing
258: */
259: public ActionErrors validate(ActionMapping mapping,
260: HttpServletRequest request) {
261: return new ActionErrors();
262: }
263:
264: /**
265: * @return Returns the oName.
266: */
267: public ObjectName getOName() {
268: return oName;
269: }
270:
271: /**
272: * @param name The oName to set.
273: */
274: public void setOName(ObjectName name) {
275: oName = name;
276: }
277:
278: /**
279: * @return Returns the booleanVals.
280: */
281: public List getBooleanVals() {
282: return booleanVals;
283: }
284:
285: /**
286: * @param booleanVals The booleanVals to set.
287: */
288: public void setBooleanVals(List booleanVals) {
289: this .booleanVals = booleanVals;
290: }
291:
292: /**
293: * @return Returns the readerList.
294: */
295: public ArrayList getReaderList() {
296: return readerList;
297: }
298:
299: /**
300: * @param readerList The readerList to set.
301: */
302: public void setReaderList(ArrayList readerList) {
303: this .readerList = readerList;
304: }
305:
306: /**
307: * @return Returns the writerList.
308: */
309: public ArrayList getWriterList() {
310: return writerList;
311: }
312:
313: /**
314: * @param writerList The writerList to set.
315: */
316: public void setWriterList(ArrayList writerList) {
317: this.writerList = writerList;
318: }
319: }
|