KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jcorporate > expresso > core > misc > EventQueueEntry


1 /* ====================================================================
2  * The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
3  *
4  * Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * 3. The end-user documentation included with the redistribution,
19  * if any, must include the following acknowledgment:
20  * "This product includes software developed by Jcorporate Ltd.
21  * (http://www.jcorporate.com/)."
22  * Alternately, this acknowledgment may appear in the software itself,
23  * if and wherever such third-party acknowledgments normally appear.
24  *
25  * 4. "Jcorporate" and product names such as "Expresso" must
26  * not be used to endorse or promote products derived from this
27  * software without prior written permission. For written permission,
28  * please contact info@jcorporate.com.
29  *
30  * 5. Products derived from this software may not be called "Expresso",
31  * or other Jcorporate product names; nor may "Expresso" or other
32  * Jcorporate product names appear in their name, without prior
33  * written permission of Jcorporate Ltd.
34  *
35  * 6. No product derived from this software may compete in the same
36  * market space, i.e. framework, without prior written permission
37  * of Jcorporate Ltd. For written permission, please contact
38  * partners@jcorporate.com.
39  *
40  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43  * DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
44  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
46  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51  * SUCH DAMAGE.
52  * ====================================================================
53  *
54  * This software consists of voluntary contributions made by many
55  * individuals on behalf of the Jcorporate Ltd. Contributions back
56  * to the project(s) are encouraged when you make modifications.
57  * Please send them to support@jcorporate.com. For more information
58  * on Jcorporate Ltd. and its products, please see
59  * <http://www.jcorporate.com/>.
60  *
61  * Portions of this software are based upon other open source
62  * products and are subject to their respective licenses.
63  */

64
65 /**
66  * EventQueueEntry.java
67  *
68  * Copyright 2000, 2001 Jcorporate Ltd.
69  */

70 package com.jcorporate.expresso.core.misc;
71
72
73 /**
74  * Event queue entry class represents a unit of work for the event
75  * handler thread.
76  * <p/>
77  * <p>NB: Please prefer the JavaBean accessor and mutator methods
78  * instead using of the data members directly. The implementation is
79  * subject to change.</p>
80  *
81  * @author Michael Nash
82  * @see EventHandler
83  */

84 public class EventQueueEntry {
85
86     /**
87      * Is this entry a "notice" or an "event" entry?
88      */

89     public boolean isNotice = false;
90
91     /**
92      * dbName to use for locating the user to notify
93      */

94     public String JavaDoc dataContext = "";
95
96     /**
97      * Subject is only used for notice entries
98      */

99     public String JavaDoc subject;
100
101     /**
102      * Event is only used for Event entries
103      */

104     public String JavaDoc theEvent;
105
106     /**
107      * Event text body message used for sending electronic mail
108      */

109     public String JavaDoc theMessage;
110
111     /**
112      * Success status of the event
113      */

114     public boolean success;
115
116     /**
117      * User id to send notice to - only for notices again
118      */

119     public int uid;
120
121     /**
122      * The array collection of virtual byte array data source (attachments)
123      */

124     public ByteArrayDataSource attachments[] = null;
125
126     /**
127      * A class that represents a queue entry for the Event handler thread
128      *
129      * @param newEvent the event name
130      * @param newMessage the message
131      * @param newSuccess the success flag
132      */

133     public EventQueueEntry(String JavaDoc newEvent, String JavaDoc newMessage, boolean newSuccess) {
134         this.theEvent = newEvent;
135         this.theMessage = newMessage;
136         this.success = newSuccess;
137         this.isNotice = false;
138     } /* EventQueueEntry(String, String, boolean) */
139
140     // *START* Accessor Mutator Helper Peter Pilgrim Wed Feb 11 03:18:15 GMT 2004
141

142     /**
143      * Gets the Notice
144      *
145      * @return boolean the current value for Notice
146      * @see #setNotice(boolean)
147      */

148     public boolean isNotice() {
149         return isNotice;
150     }
151
152     /**
153      * Sets the Notice
154      *
155      * @param notice the new value for Notice
156      * @see #isNotice()
157      */

158     public void setNotice(boolean notice) {
159         this.isNotice = notice;
160     }
161
162     /**
163      * Gets the DataContext
164      *
165      * @return String the current value for DataContext
166      * @see #setDataContext(String)
167      */

168     public String JavaDoc getDataContext() {
169         return dataContext;
170     }
171
172     /**
173      * Sets the DataContext
174      *
175      * @param dataContext the new value for DataContext
176      * @see #getDataContext()
177      */

178     public void setDataContext(String JavaDoc dataContext) {
179         this.dataContext = dataContext;
180     }
181
182     /**
183      * Gets the Subject
184      *
185      * @return String the current value for Subject
186      * @see #setSubject(String)
187      */

188     public String JavaDoc getSubject() {
189         return subject;
190     }
191
192     /**
193      * Sets the Subject
194      *
195      * @param subject the new value for Subject
196      * @see #getSubject()
197      */

198     public void setSubject(String JavaDoc subject) {
199         this.subject = subject;
200     }
201
202
203     /**
204      * Gets the TheEvent
205      *
206      * @return String the current value for TheEvent
207      * @see #setTheEvent(String)
208      */

209     public String JavaDoc getTheEvent() {
210         return theEvent;
211     }
212
213     /**
214      * Sets the TheEvent
215      *
216      * @param theEvent the new value for TheEvent
217      * @see #getTheEvent()
218      */

219     public void setTheEvent(String JavaDoc theEvent) {
220         this.theEvent = theEvent;
221     }
222
223     /**
224      * Gets the TheMessage
225      *
226      * @return String the current value for TheMessage
227      * @see #setTheMessage(String)
228      */

229     public String JavaDoc getTheMessage() {
230         return theMessage;
231     }
232
233     /**
234      * Sets the TheMessage
235      *
236      * @param theMessage the new value for TheMessage
237      * @see #getTheMessage()
238      */

239     public void setTheMessage(String JavaDoc theMessage) {
240         this.theMessage = theMessage;
241     }
242
243     /**
244      * Gets the Success
245      *
246      * @return boolean the current value for Success
247      * @see #setSuccess(boolean)
248      */

249     public boolean isSuccess() {
250         return success;
251     }
252
253     /**
254      * Sets the Success
255      *
256      * @param success the new value for Success
257      * @see #isSuccess()
258      */

259     public void setSuccess(boolean success) {
260         this.success = success;
261     }
262
263     /**
264      * Gets the Uid
265      *
266      * @return int the current value for Uid
267      * @see #setUid(int)
268      */

269     public int getUid() {
270         return uid;
271     }
272
273     /**
274      * Sets the Uid
275      *
276      * @param uid the new value for Uid
277      * @see #getUid()
278      */

279     public void setUid(int uid) {
280         this.uid = uid;
281     }
282
283     /**
284      * Gets the Attachments
285      *
286      * @return ByteArrayDataSource[] the current value for Attachments
287      * @see #setAttachments(ByteArrayDataSource[])
288      */

289     public ByteArrayDataSource[] getAttachments() {
290         return attachments;
291     }
292
293     /**
294      * Sets the Attachments
295      *
296      * @param attachments the new value for Attachments
297      * @see #getAttachments()
298      */

299     public void setAttachments(ByteArrayDataSource[] attachments) {
300         this.attachments = attachments;
301     }
302
303 } /* EventQueueEntry */
304
Popular Tags