KickJava   Java API By Example, From Geeks To Geeks.

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


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

45 public interface ServerIL
46 {
47
48    /**
49     * #Description of the Method
50     *
51     * @return Description of the Returned Value
52     * @exception Exception Description of Exception
53     */

54    public ServerIL cloneServerIL() throws Exception JavaDoc;
55
56    /**
57     * @param newConnectionToken org.jboss.mq.ConnectionToken
58     * @exception java.lang.Exception The exception description.
59     */

60    void setConnectionToken(org.jboss.mq.ConnectionToken newConnectionToken) throws java.lang.Exception JavaDoc;
61    /**
62     * Get a clientID from the server. It is up to the server side components
63     * to update the ConectionToken if this method returns normaly.
64     *
65     * @return an internally generated clientID.
66     * @exception Exception Description of Exception
67     */

68    public String JavaDoc getID()
69           throws Exception JavaDoc;
70
71    /**
72     * Gets the TemporaryTopic attribute of the ServerIL object
73     *
74     * @param dc Description of Parameter
75     * @return The TemporaryTopic value
76     * @exception Exception Description of Exception
77     */

78    public TemporaryTopic JavaDoc getTemporaryTopic(ConnectionToken dc)
79           throws Exception JavaDoc;
80
81    /**
82     * Gets the TemporaryQueue attribute of the ServerIL object
83     *
84     * @param dc Description of Parameter
85     * @return The TemporaryQueue value
86     * @exception Exception Description of Exception
87     */

88    public TemporaryQueue JavaDoc getTemporaryQueue(ConnectionToken dc)
89           throws Exception JavaDoc;
90
91    /**
92     * The client is closing the connection.
93     *
94     * @param dc Description of Parameter
95     * @exception Exception Description of Exception
96     */

97    public void connectionClosing(ConnectionToken dc)
98           throws Exception JavaDoc;
99
100    /**
101     * Check if clientID is a valid ID.
102     *
103     * This method should be called when the client tries to set its own
104     * clientID. It is up to the server side components
105     * to update the ConectionToken if this method returns normaly.
106     *
107     * @param ID a clientID set by the client.
108     * @exception Exception if the clientID was not vallid.
109     */

110    public void checkID(String JavaDoc ID)
111           throws Exception JavaDoc;
112
113    /**
114     * Adds a message to the destination specifyed in the message.
115     *
116     * @param dc The feature to be added to the Message attribute
117     * @param message The feature to be added to the Message attribute
118     * @exception Exception Description of Exception
119     */

120    public void addMessage(ConnectionToken dc, SpyMessage message)
121           throws Exception JavaDoc;
122
123    /**
124     * #Description of the Method
125     *
126     * @param dc Description of Parameter
127     * @param dest Description of Parameter
128     * @return Description of the Returned Value
129     * @exception Exception Description of Exception
130     */

131    public Queue JavaDoc createQueue(ConnectionToken dc, String JavaDoc dest)
132           throws Exception JavaDoc;
133
134    /**
135     * #Description of the Method
136     *
137     * @param dc Description of Parameter
138     * @param dest Description of Parameter
139     * @return Description of the Returned Value
140     * @exception Exception Description of Exception
141     */

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

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

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

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

184    public SpyMessage[] browse(ConnectionToken dc, Destination JavaDoc dest, String JavaDoc selector)
185           throws Exception JavaDoc;
186
187    /**
188     * Get a message synchronously.
189     *
190     * @param dc Description of Parameter
191     * @param subscriberId Description of Parameter
192     * @param wait Description of Parameter
193     * @return Description of the Returned Value
194     * @exception Exception Description of Exception
195     */

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

206    public void setEnabled(ConnectionToken dc, boolean enabled)
207           throws Exception JavaDoc;
208
209    /**
210     * Remove a consumer. Is NOT the same as the topic session unsubscribe.
211     *
212     * @param dc Description of Parameter
213     * @param subscriptionId Description of Parameter
214     * @exception Exception Description of Exception
215     */

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

225    public void destroySubscription(ConnectionToken dc,DurableSubscriptionID id)
226           throws Exception JavaDoc;
227
228    /**
229     * Get a clientID for a given user/password.
230     *
231     * May also be used for autentication if StateManager is used as
232     * authenticator.
233     *
234     * @param userName a valid user name that the StateManager knows about.
235     * @param password a password
236     * @return a preconfigured clientID or null.
237     * @exception Exception Description of Exception
238     */

239    public String JavaDoc checkUser(String JavaDoc userName, String JavaDoc password)
240           throws Exception JavaDoc;
241
242    /**
243     * Authenticate the user.
244     *
245     * If using a securityManager the user will be autenticated by that.
246     *
247     * @param userName a username.
248     * @param password a password.
249     * @return a sessionid, valid only for the life of this connection.
250     * @exception Exception Description of Exception
251     */

252    public String JavaDoc authenticate(String JavaDoc userName, String JavaDoc password)
253           throws Exception JavaDoc;
254    
255    
256    
257    /**
258     * @param dc org.jboss.mq.ConnectionToken
259     * @param s org.jboss.mq.Subscription
260     * @exception java.lang.Exception The exception description.
261     */

262    void subscribe(org.jboss.mq.ConnectionToken dc, org.jboss.mq.Subscription s)
263           throws java.lang.Exception JavaDoc;
264
265    /**
266     * Ping the server.
267     *
268     * @param dc Description of Parameter
269     * @param clientTime Description of Parameter
270     * @exception Exception Description of Exception
271     */

272    public void ping(ConnectionToken dc, long clientTime)
273           throws Exception JavaDoc;
274
275 }
Popular Tags