KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > oamp > plugin > OAMPMessageEvent


1 /*
2  * OAMPMessageEvent.java
3  *
4  * Created on June 8, 2002, 11:17 AM
5  */

6
7 package com.quikj.application.web.oamp.plugin;
8
9 import com.quikj.server.web.*;
10 import com.quikj.application.web.oamp.messaging.*;
11
12 /**
13  *
14  * @author amit
15  */

16 public class OAMPMessageEvent implements com.quikj.server.framework.AceMessageInterface
17 {
18     private EndPointInterface endpoint;
19     private OAMPClient client;
20     private Object JavaDoc element;
21     private int requestId = -1;
22     private Object JavaDoc userParm;
23     private int status = 0;
24     private String JavaDoc reason = "";
25     private OAMPMessageInterface body;
26     private FeatureHandlerInterface from;
27     private String JavaDoc featureName;
28     
29     /** Creates a new instance of OAMPMessageEvent */
30     
31     // OAMP endpoint to FeatureHandler request
32
public OAMPMessageEvent(EndPointInterface endpoint,
33     OAMPClient client,
34     Object JavaDoc element,
35     int req_id,
36     Object JavaDoc user_parm,
37     String JavaDoc feature_name)
38     {
39         setEndpoint(endpoint);
40         setClient(client);
41         setElement(element);
42         setRequestId(req_id);
43         setUserParm(user_parm);
44         setFeatureName(feature_name);
45     }
46
47     public OAMPMessageEvent(EndPointInterface endpoint,
48     OAMPClient client,
49     Object JavaDoc element,
50     int req_id,
51     Object JavaDoc user_parm)
52     {
53         this (endpoint, client, element, req_id, user_parm,
54         OAMPSystemMessageParser.OAMP_SYSTEM_FEATURE_NAME);
55     }
56     
57     // Feature handler to OAMP endpoint response
58
public OAMPMessageEvent(int status,
59     String JavaDoc reason,
60     OAMPMessageInterface body,
61     int req_id,
62     Object JavaDoc user_parm,
63     String JavaDoc feature_name)
64     {
65         setStatus(status);
66         setReason(reason);
67         setBody(body);
68         setRequestId(req_id);
69         setUserParm(user_parm);
70         setFeatureName(feature_name);
71     }
72     
73     public OAMPMessageEvent(int status,
74     String JavaDoc reason,
75     OAMPMessageInterface body,
76     int req_id,
77     Object JavaDoc user_parm)
78     {
79         this (status, reason, body, req_id, user_parm,
80         OAMPSystemMessageParser.OAMP_SYSTEM_FEATURE_NAME);
81     }
82     
83     
84     // OAMP endpoint to feature handler response
85
public OAMPMessageEvent(int status,
86     String JavaDoc reason,
87     Object JavaDoc element,
88     int req_id,
89     Object JavaDoc user_parm)
90     {
91         setStatus(status);
92         setReason(reason);
93         setElement(element);
94         setRequestId(req_id);
95         setUserParm(user_parm);
96     }
97     
98     
99    // Feature handler to OAMP endpoint request
100
public OAMPMessageEvent(FeatureHandlerInterface from,
101     OAMPMessageInterface body,
102     int req_id,
103     Object JavaDoc user_parm,
104     String JavaDoc feature)
105     {
106         setFrom(from);
107         setBody(body);
108         setRequestId(req_id);
109         setUserParm(user_parm);
110         setFeatureName(feature);
111     }
112     
113     public String JavaDoc messageType()
114     {
115         return "OAMPMessage";
116     }
117     
118     public boolean isRequest()
119     {
120         if (status == 0)
121         {
122             return true;
123         }
124         
125         return false;
126     }
127     
128     /** Getter for property body.
129      * @return Value of property body.
130      */

131     public com.quikj.application.web.oamp.messaging.OAMPMessageInterface getBody()
132     {
133         return body;
134     }
135     
136     /** Setter for property body.
137      * @param body New value of property body.
138      */

139     public void setBody(com.quikj.application.web.oamp.messaging.OAMPMessageInterface body)
140     {
141         this.body = body;
142     }
143     
144     /** Getter for property client.
145      * @return Value of property client.
146      */

147     public com.quikj.application.web.oamp.plugin.OAMPClient getClient()
148     {
149         return client;
150     }
151     
152     /** Setter for property client.
153      * @param client New value of property client.
154      */

155     public void setClient(com.quikj.application.web.oamp.plugin.OAMPClient client)
156     {
157         this.client = client;
158     }
159         
160     /** Getter for property element.
161      * @return Value of property element.
162      */

163     public java.lang.Object JavaDoc getElement()
164     {
165         return element;
166     }
167     
168     /** Setter for property element.
169      * @param element New value of property element.
170      */

171     public void setElement(java.lang.Object JavaDoc element)
172     {
173         this.element = element;
174     }
175     
176     /** Getter for property endpoint.
177      * @return Value of property endpoint.
178      */

179     public com.quikj.server.web.EndPointInterface getEndpoint()
180     {
181         return endpoint;
182     }
183     
184     /** Setter for property endpoint.
185      * @param endpoint New value of property endpoint.
186      */

187     public void setEndpoint(com.quikj.server.web.EndPointInterface endpoint)
188     {
189         this.endpoint = endpoint;
190     }
191     
192     /** Getter for property from.
193      * @return Value of property from.
194      */

195     public com.quikj.application.web.oamp.plugin.FeatureHandlerInterface getFrom()
196     {
197         return from;
198     }
199     
200     /** Setter for property from.
201      * @param from New value of property from.
202      */

203     public void setFrom(com.quikj.application.web.oamp.plugin.FeatureHandlerInterface from)
204     {
205         this.from = from;
206     }
207     
208     /** Getter for property reason.
209      * @return Value of property reason.
210      */

211     public java.lang.String JavaDoc getReason()
212     {
213         return reason;
214     }
215     
216     /** Setter for property reason.
217      * @param reason New value of property reason.
218      */

219     public void setReason(java.lang.String JavaDoc reason)
220     {
221         this.reason = reason;
222     }
223     
224     /** Getter for property requestId.
225      * @return Value of property requestId.
226      */

227     public int getRequestId()
228     {
229         return requestId;
230     }
231     
232     /** Setter for property requestId.
233      * @param requestId New value of property requestId.
234      */

235     public void setRequestId(int requestId)
236     {
237         this.requestId = requestId;
238     }
239     
240     /** Getter for property status.
241      * @return Value of property status.
242      */

243     public int getStatus()
244     {
245         return status;
246     }
247     
248     /** Setter for property status.
249      * @param status New value of property status.
250      */

251     public void setStatus(int status)
252     {
253         this.status = status;
254     }
255     
256     /** Getter for property userParm.
257      * @return Value of property userParm.
258      */

259     public java.lang.Object JavaDoc getUserParm()
260     {
261         return userParm;
262     }
263     
264     /** Setter for property userParm.
265      * @param userParm New value of property userParm.
266      */

267     public void setUserParm(java.lang.Object JavaDoc userParm)
268     {
269         this.userParm = userParm;
270     }
271     
272     /** Getter for property featureName.
273      * @return Value of property featureName.
274      */

275     public java.lang.String JavaDoc getFeatureName()
276     {
277         return featureName;
278     }
279     
280     /** Setter for property featureName.
281      * @param featureName New value of property featureName.
282      */

283     public void setFeatureName(java.lang.String JavaDoc featureName)
284     {
285         this.featureName = featureName;
286     }
287     
288 }
289
Popular Tags