KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > il > Invoker


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.mq.il;
23 import javax.jms.Destination JavaDoc;
24 import javax.jms.JMSException JavaDoc;
25 import javax.jms.Queue JavaDoc;
26 import javax.jms.TemporaryQueue JavaDoc;
27 import javax.jms.TemporaryTopic JavaDoc;
28 import javax.jms.Topic JavaDoc;
29
30 import org.jboss.mq.AcknowledgementRequest;
31 import org.jboss.mq.ConnectionToken;
32 import org.jboss.mq.DurableSubscriptionID;
33 import org.jboss.mq.SpyDestination;
34 import org.jboss.mq.SpyMessage;
35 import org.jboss.mq.SpyTopic;
36 import org.jboss.mq.Subscription;
37 import org.jboss.mq.TransactionRequest;
38
39 /**
40  * Defines the methods that can be called by a client on the server.
41  *
42  * @author <a HREF="Cojonudo14@hotmail.com">Hiram Chirino</a>
43  * @author <a HREF="Norbert.Lataille@m4x.org">Norbert Lataille</a>
44  * @author <a HREF="pra@tim.se">Peter Antman</a>
45  * @version $Revision: 45305 $
46  * @created August 16, 2001
47  */

48 public interface Invoker
49 {
50    /**
51     * Get the thread group of the server.
52     */

53    public ThreadGroup JavaDoc getThreadGroup();
54
55    /**
56     * Gets a clientID from server.
57     *
58     * @return The ID value
59     * @exception JMSException Description of Exception
60     */

61    public String JavaDoc getID()
62           throws JMSException JavaDoc;
63
64    /**
65     * Get a temporary topic.
66     *
67     * @param dc Description of Parameter
68     * @return The TemporaryTopic value
69     * @exception JMSException Description of Exception
70     */

71    public TemporaryTopic JavaDoc getTemporaryTopic(ConnectionToken dc)
72           throws JMSException JavaDoc;
73
74    /**
75     * Get a temporary queue
76     *
77     * @param dc Description of Parameter
78     * @return The TemporaryQueue value
79     * @exception JMSException Description of Exception
80     */

81    public TemporaryQueue JavaDoc getTemporaryQueue(ConnectionToken dc)
82           throws JMSException JavaDoc;
83
84    /**
85     * Close connection.
86     *
87     * @param dc Description of Parameter
88     * @exception JMSException Description of Exception
89     */

90    public void connectionClosing(ConnectionToken dc)
91           throws JMSException JavaDoc;
92
93    /**
94     * Check id, must not be taken.
95     *
96     * @param ID Description of Parameter
97     * @exception JMSException Description of Exception
98     */

99    public void checkID(String JavaDoc ID)
100           throws JMSException JavaDoc;
101
102    /**
103     * Add the message to the destination.
104     *
105     * @param dc The feature to be added to the Message attribute
106     * @param message The feature to be added to the Message attribute
107     * @exception JMSException Description of Exception
108     */

109    public void addMessage(ConnectionToken dc, SpyMessage message)
110           throws JMSException JavaDoc;
111
112    /**
113     * Create a queue.
114     *
115     * The destination name must be the name of an already existing
116     * destination. This method should only be used to skip looking
117     * up a destination through JNDI, not to actually create a new destination.
118     *
119     * @param dc Description of Parameter
120     * @param dest Description of Parameter
121     * @return Description of the Returned Value
122     * @exception JMSException Description of Exception
123     */

124    public Queue JavaDoc createQueue(ConnectionToken dc, String JavaDoc dest)
125           throws JMSException JavaDoc;
126
127    /**
128     * Create a topic.
129     *
130     * The destination name must be the name of an already existing
131     * destination. This method should only be used to skip looking
132     * up a destination through JNDI, not to actually create a new destination.
133     *
134     * @param dc Description of Parameter
135     * @param dest Description of Parameter
136     * @return Description of the Returned Value
137     * @exception JMSException Description of Exception
138     */

139    public Topic JavaDoc createTopic(ConnectionToken dc, String JavaDoc dest)
140           throws JMSException JavaDoc;
141
142    /**
143     * #Description of the Method
144     *
145     * @param dc Description of Parameter
146     * @param dest Description of Parameter
147     * @exception JMSException Description of Exception
148     */

149    public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest)
150           throws JMSException JavaDoc;
151
152    /**
153     * #Description of the Method
154     *
155     * @param dc Description of Parameter
156     * @param t Description of Parameter
157     * @exception JMSException Description of Exception
158     */

159    public void transact(ConnectionToken dc, TransactionRequest t)
160           throws JMSException JavaDoc;
161
162    /**
163     * #Description of the Method
164     *
165     * @param dc Description of Parameter
166     * @param item Description of Parameter
167     * @exception JMSException Description of Exception
168     */

169    public void acknowledge(ConnectionToken dc, AcknowledgementRequest item)
170           throws JMSException JavaDoc;
171
172    /**
173     * #Description of the Method
174     *
175     * @param dc Description of Parameter
176     * @param dest Description of Parameter
177     * @param selector Description of Parameter
178     * @return Description of the Returned Value
179     * @exception JMSException Description of Exception
180     */

181    public SpyMessage[] browse(ConnectionToken dc, Destination JavaDoc dest, String JavaDoc selector)
182           throws JMSException JavaDoc;
183
184    /**
185     * #Description of the Method
186     *
187     * @param dc Description of Parameter
188     * @param subscriberId Description of Parameter
189     * @param wait Description of Parameter
190     * @return Description of the Returned Value
191     * @exception JMSException Description of Exception
192     */

193    public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait)
194           throws JMSException JavaDoc;
195
196    /**
197     * Sets the Enabled attribute of the ServerIL object
198     *
199     * @param dc The new Enabled value
200     * @param enabled The new Enabled value
201     * @exception JMSException Description of Exception
202     */

203    public void setEnabled(ConnectionToken dc, boolean enabled)
204           throws JMSException JavaDoc;
205
206    /**
207     * Close the server side message consumer. Client is no longer
208     * available to receive messages.
209     *
210     * @param dc Description of Parameter
211     * @param subscriptionId Description of Parameter
212     * @exception JMSException Description of Exception
213     */

214    public void unsubscribe(ConnectionToken dc, int subscriptionId)
215           throws JMSException JavaDoc;
216
217    /**
218     * Unsubscribe from the durable subscription.
219     *
220     * @param id Description of Parameter
221     * @exception JMSException Description of Exception
222     */

223    public void destroySubscription(ConnectionToken dc,DurableSubscriptionID id)
224           throws JMSException JavaDoc;
225
226    /**
227     * Check user for autentication.
228     *
229     * @param userName Description of Parameter
230     * @param password Description of Parameter
231     * @return a preconfigured clientId.
232     * @exception JMSException if user was not allowed to login
233     */

234    public String JavaDoc checkUser(String JavaDoc userName, String JavaDoc password)
235           throws JMSException JavaDoc;
236
237    
238    /**
239     * Check user for autentication.
240     *
241     * @param userName Description of Parameter
242     * @param password Description of Parameter
243     * @return a sessionId.
244     * @exception JMSException if user was not allowed to login
245     */

246    public String JavaDoc authenticate(String JavaDoc userName, String JavaDoc password)
247       throws JMSException JavaDoc;
248
249
250    /**
251     * @param dc org.jboss.mq.ConnectionToken
252     * @param s org.jboss.mq.Subscription
253     * @exception JMSException The exception description.
254     */

255    void subscribe(org.jboss.mq.ConnectionToken dc, org.jboss.mq.Subscription s)
256           throws JMSException JavaDoc;
257
258    /**
259     * Ping the server.
260     *
261     * @param dc Description of Parameter
262     * @param clientTime Description of Parameter
263     * @exception JMSException Description of Exception
264     */

265    public void ping(ConnectionToken dc, long clientTime)
266           throws JMSException JavaDoc;
267
268    /**
269     * Get the topic the durable subscription is on.
270     * Primary for internal use in the server, and not for the IL's.
271     */

272    public SpyTopic getDurableTopic(DurableSubscriptionID sub)
273       throws JMSException JavaDoc;
274
275    /**
276     * Get the subscription that match the id.
277     *
278     * @exception JMSException if it can not find the subscription.
279     */

280    public Subscription getSubscription(ConnectionToken dc,int subscriberId) throws JMSException JavaDoc;
281
282 }
283
Popular Tags