001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.messaging.web;
018:
019: import java.sql.Timestamp;
020: import java.util.ArrayList;
021: import java.util.Collection;
022: import java.util.List;
023:
024: import org.apache.commons.beanutils.ConvertUtils;
025: import org.apache.struts.action.ActionForm;
026:
027: import edu.iu.uis.eden.messaging.PersistedMessage;
028: import edu.iu.uis.eden.util.CodeTranslator;
029: import edu.iu.uis.eden.util.converters.KEWSqlTimestampConverter;
030:
031: /**
032: * Struts ActionForm for the {@link MessageQueueAction}.
033: *
034: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
035: */
036: public class MessageQueueForm extends ActionForm {
037:
038: private static final long serialVersionUID = -247925603792980036L;
039: public static final int DEFAULT_MAX_ROWS = 1000;
040: public static final int DEFAULT_PAGE_SIZE = 100;
041:
042: private int maxRows;
043: private int pageSize;
044: private Long messageId;
045: private String methodToCall = "";
046: private Collection<PersistedMessage> messageQueueRows;
047: private String showEdit;
048: private String command;
049: private PersistedMessage messageQueueFromDatabase;
050: private PersistedMessage messageQueueFromForm;
051: private String newQueueDate;
052: private String existingQueueDate;
053: private String ipAddress;
054:
055: // filter stuff
056: private String routeQueueIdFilter;
057: private String serviceNameFilter;
058: private String messageEntityFilter;
059: private String queueStatusFilter;
060: private String ipNumberFilter;
061: private String value1Filter;
062: private String value2Filter;
063: private String filterApplied;
064:
065: private Integer maxMessageFetcherMessages = 50;
066:
067: private String myIpAddress;
068: private String myMessageEntity;
069: private String messagePersistence;
070: private String messageDelivery;
071: private String messageOff;
072: private List<ValueLabelPair> ipAddresses = new ArrayList<ValueLabelPair>();
073:
074: static {
075: ConvertUtils.register(new KEWSqlTimestampConverter(),
076: Timestamp.class);
077: }
078:
079: public MessageQueueForm() {
080: messageQueueFromForm = new PersistedMessage();
081: maxRows = DEFAULT_MAX_ROWS;
082: pageSize = DEFAULT_PAGE_SIZE;
083: }
084:
085: public String getRouteQueueStatusLabel(String statusCode) {
086: return CodeTranslator.getRouteQueueStatusLabel(statusCode);
087: }
088:
089: public String getMethodToCall() {
090: return methodToCall;
091: }
092:
093: public void setMethodToCall(String methodToCall) {
094: this .methodToCall = methodToCall;
095: }
096:
097: public Long getMessageId() {
098: return messageId;
099: }
100:
101: public void setMessageId(Long routeQueueId) {
102: this .messageId = routeQueueId;
103: }
104:
105: public Collection<PersistedMessage> getMessageQueueRows() {
106: return messageQueueRows;
107: }
108:
109: public void setMessageQueueRows(
110: Collection<PersistedMessage> routeQueueRows) {
111: this .messageQueueRows = routeQueueRows;
112: }
113:
114: public int getMessageQueueRowsSize() {
115: if (messageQueueRows == null) {
116: return 0;
117: }
118: return messageQueueRows.size();
119: }
120:
121: public String getCommand() {
122: return command;
123: }
124:
125: public void setCommand(String command) {
126: this .command = command;
127: }
128:
129: public PersistedMessage getMessageQueueFromDatabase() {
130: return messageQueueFromDatabase;
131: }
132:
133: public void setMessageQueueFromDatabase(
134: PersistedMessage existingRouteQueue) {
135: this .messageQueueFromDatabase = existingRouteQueue;
136: }
137:
138: public PersistedMessage getMessageQueueFromForm() {
139: return messageQueueFromForm;
140: }
141:
142: public void setMessageQueueFromForm(PersistedMessage routeQueue) {
143: this .messageQueueFromForm = routeQueue;
144: }
145:
146: public String getShowEdit() {
147: return showEdit;
148: }
149:
150: public void setShowEdit(String showEdit) {
151: this .showEdit = showEdit;
152: }
153:
154: public String getExistingQueueDate() {
155: return existingQueueDate;
156: }
157:
158: public void setExistingQueueDate(String existingQueueDate) {
159: this .existingQueueDate = existingQueueDate;
160: }
161:
162: public String getNewQueueDate() {
163: return newQueueDate;
164: }
165:
166: public void setNewQueueDate(String newQueueDate) {
167: this .newQueueDate = newQueueDate;
168: }
169:
170: public int getMaxRows() {
171: return maxRows;
172: }
173:
174: public void setMaxRows(int maxRows) {
175: this .maxRows = maxRows;
176: }
177:
178: public int getPageSize() {
179: return this .pageSize;
180: }
181:
182: public void setPageSize(int pageSize) {
183: this .pageSize = pageSize;
184: }
185:
186: /**
187: * @return the ipNumberFilter
188: */
189: public String getIpNumberFilter() {
190: return ipNumberFilter;
191: }
192:
193: /**
194: * @param ipNumberFilter the ipNumberFilter to set
195: */
196: public void setIpNumberFilter(String ipNumberFilter) {
197: this .ipNumberFilter = ipNumberFilter;
198: }
199:
200: /**
201: * @return the messageEntityFilter
202: */
203: public String getMessageEntityFilter() {
204: return messageEntityFilter;
205: }
206:
207: /**
208: * @param messageEntityFilter the messageEntityFilter to set
209: */
210: public void setMessageEntityFilter(String messageEntityFilter) {
211: this .messageEntityFilter = messageEntityFilter;
212: }
213:
214: /**
215: * @return the queueStatusFilter
216: */
217: public String getQueueStatusFilter() {
218: return queueStatusFilter;
219: }
220:
221: /**
222: * @param queueStatusFilter the queueStatusFilter to set
223: */
224: public void setQueueStatusFilter(String queueStatusFilter) {
225: this .queueStatusFilter = queueStatusFilter;
226: }
227:
228: /**
229: * @return the serviceNameFilter
230: */
231: public String getServiceNameFilter() {
232: return serviceNameFilter;
233: }
234:
235: /**
236: * @param serviceNameFilter the serviceNameFilter to set
237: */
238: public void setServiceNameFilter(String serviceNameFilter) {
239: this .serviceNameFilter = serviceNameFilter;
240: }
241:
242: /**
243: * @return the filterApplied
244: */
245: public String getFilterApplied() {
246: return filterApplied;
247: }
248:
249: /**
250: * @param filterApplied the filterApplied to set
251: */
252: public void setFilterApplied(String filterApplied) {
253: this .filterApplied = filterApplied;
254: }
255:
256: public String getRouteQueueIdFilter() {
257: return this .routeQueueIdFilter;
258: }
259:
260: public void setRouteQueueIdFilter(String messageIdFilter) {
261: this .routeQueueIdFilter = messageIdFilter;
262: }
263:
264: public String getValue1Filter() {
265: return this .value1Filter;
266: }
267:
268: public void setValue1Filter(String value1Filter) {
269: this .value1Filter = value1Filter;
270: }
271:
272: public String getValue2Filter() {
273: return this .value2Filter;
274: }
275:
276: public void setValue2Filter(String value2Filter) {
277: this .value2Filter = value2Filter;
278: }
279:
280: public List<ValueLabelPair> getIpAddresses() {
281: return this .ipAddresses;
282: }
283:
284: public void setIpAddresses(List<ValueLabelPair> ipAddresses) {
285: this .ipAddresses = ipAddresses;
286: }
287:
288: public String getIpAddress() {
289: return this .ipAddress;
290: }
291:
292: public void setIpAddress(String ipAddress) {
293: this .ipAddress = ipAddress;
294: }
295:
296: public Integer getMaxMessageFetcherMessages() {
297: return this .maxMessageFetcherMessages;
298: }
299:
300: public void setMaxMessageFetcherMessages(
301: Integer maxMessageFetcherMessages) {
302: this .maxMessageFetcherMessages = maxMessageFetcherMessages;
303: }
304:
305: public String getMyIpAddress() {
306: return this .myIpAddress;
307: }
308:
309: public void setMyIpAddress(String myIpAddress) {
310: this .myIpAddress = myIpAddress;
311: }
312:
313: public String getMyMessageEntity() {
314: return this .myMessageEntity;
315: }
316:
317: public void setMyMessageEntity(String myMessageEntity) {
318: this .myMessageEntity = myMessageEntity;
319: }
320:
321: public String getMessageDelivery() {
322: return this .messageDelivery;
323: }
324:
325: public void setMessageDelivery(String messageDelivery) {
326: this .messageDelivery = messageDelivery;
327: }
328:
329: public String getMessageOff() {
330: return this .messageOff;
331: }
332:
333: public void setMessageOff(String messageOff) {
334: this .messageOff = messageOff;
335: }
336:
337: public String getMessagePersistence() {
338: return this .messagePersistence;
339: }
340:
341: public void setMessagePersistence(String messagePersistence) {
342: this.messagePersistence = messagePersistence;
343: }
344:
345: }
|