001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.mq.server;
023:
024: import javax.jms.Destination;
025: import javax.jms.JMSException;
026: import javax.jms.Queue;
027: import javax.jms.TemporaryQueue;
028: import javax.jms.TemporaryTopic;
029: import javax.jms.Topic;
030:
031: import org.jboss.mq.AcknowledgementRequest;
032: import org.jboss.mq.ConnectionToken;
033: import org.jboss.mq.DurableSubscriptionID;
034: import org.jboss.mq.SpyDestination;
035: import org.jboss.mq.SpyMessage;
036: import org.jboss.mq.SpyTopic;
037: import org.jboss.mq.Subscription;
038: import org.jboss.mq.TransactionRequest;
039:
040: /**
041: * Interceptor interface for clients IL accessing the JMSServer.
042: *
043: * Using an iterface for this layer makes it possible to put in logic
044: * without having to modify the server objet. And also makes this
045: * pluggable.
046: *
047: *
048: * @author <a href="mailto:pra@tim.se">Peter Antman</a>
049: * @version $Revision: 57198 $
050: */
051:
052: public interface JMSServerInterceptor {
053:
054: /**
055: * Set next Interceptor in chain to be called. Is mot often the real JMSServer
056: */
057: public void setNext(JMSServerInterceptor server);
058:
059: /**
060: * Get next invoker in chain to be called. Is mot often the real JMSServer
061: */
062: public JMSServerInterceptor getNext();
063:
064: /**
065: * Get the thread group of the server.
066: */
067: public ThreadGroup getThreadGroup();
068:
069: /**
070: * Gets a clientID from server.
071: *
072: * @return The ID value
073: * @exception JMSException Description of Exception
074: */
075: public String getID() throws JMSException;
076:
077: /**
078: * Get a temporary topic.
079: *
080: * @param dc Description of Parameter
081: * @return The TemporaryTopic value
082: * @exception JMSException Description of Exception
083: */
084: public TemporaryTopic getTemporaryTopic(ConnectionToken dc)
085: throws JMSException;
086:
087: /**
088: * Get a temporary queue
089: *
090: * @param dc Description of Parameter
091: * @return The TemporaryQueue value
092: * @exception JMSException Description of Exception
093: */
094: public TemporaryQueue getTemporaryQueue(ConnectionToken dc)
095: throws JMSException;
096:
097: /**
098: * Close connection.
099: *
100: * @param dc Description of Parameter
101: * @exception JMSException Description of Exception
102: */
103: public void connectionClosing(ConnectionToken dc)
104: throws JMSException;
105:
106: /**
107: * Check id, must not be taken.
108: *
109: * @param ID Description of Parameter
110: * @exception JMSException Description of Exception
111: */
112: public void checkID(String ID) throws JMSException;
113:
114: /**
115: * Add the message to the destination.
116: *
117: * @param dc The feature to be added to the Message attribute
118: * @param message The feature to be added to the Message attribute
119: * @exception JMSException Description of Exception
120: */
121: public void addMessage(ConnectionToken dc, SpyMessage message)
122: throws JMSException;
123:
124: /**
125: * Create a queue.
126: *
127: * The destination name must be the name of an already existing
128: * destination. This method should only be used to skip looking
129: * up a destination through JNDI, not to actually create a new destination.
130: *
131: * @param dc Description of Parameter
132: * @param dest Description of Parameter
133: * @return Description of the Returned Value
134: * @exception JMSException Description of Exception
135: */
136: public Queue createQueue(ConnectionToken dc, String dest)
137: throws JMSException;
138:
139: /**
140: * Create a topic.
141: *
142: * The destination name must be the name of an already existing
143: * destination. This method should only be used to skip looking
144: * up a destination through JNDI, not to actually create a new destination.
145: *
146: * @param dc Description of Parameter
147: * @param dest Description of Parameter
148: * @return Description of the Returned Value
149: * @exception JMSException Description of Exception
150: */
151: public Topic createTopic(ConnectionToken dc, String dest)
152: throws JMSException;
153:
154: /**
155: * #Description of the Method
156: *
157: * @param dc Description of Parameter
158: * @param dest Description of Parameter
159: * @exception JMSException Description of Exception
160: */
161: public void deleteTemporaryDestination(ConnectionToken dc,
162: SpyDestination dest) throws JMSException;
163:
164: /**
165: * #Description of the Method
166: *
167: * @param dc Description of Parameter
168: * @param t Description of Parameter
169: * @exception JMSException Description of Exception
170: */
171: public void transact(ConnectionToken dc, TransactionRequest t)
172: throws JMSException;
173:
174: /**
175: * #Description of the Method
176: *
177: * @param dc Description of Parameter
178: * @param item Description of Parameter
179: * @exception JMSException Description of Exception
180: */
181: public void acknowledge(ConnectionToken dc,
182: AcknowledgementRequest item) throws JMSException;
183:
184: /**
185: * #Description of the Method
186: *
187: * @param dc Description of Parameter
188: * @param dest Description of Parameter
189: * @param selector Description of Parameter
190: * @return Description of the Returned Value
191: * @exception JMSException Description of Exception
192: */
193: public SpyMessage[] browse(ConnectionToken dc, Destination dest,
194: String selector) throws JMSException;
195:
196: /**
197: * #Description of the Method
198: *
199: * @param dc Description of Parameter
200: * @param subscriberId Description of Parameter
201: * @param wait Description of Parameter
202: * @return Description of the Returned Value
203: * @exception JMSException Description of Exception
204: */
205: public SpyMessage receive(ConnectionToken dc, int subscriberId,
206: long wait) throws JMSException;
207:
208: /**
209: * Sets the Enabled attribute of the ServerIL object
210: *
211: * @param dc The new Enabled value
212: * @param enabled The new Enabled value
213: * @exception JMSException Description of Exception
214: */
215: public void setEnabled(ConnectionToken dc, boolean enabled)
216: throws JMSException;
217:
218: /**
219: * Close the server side message consumer. Client is no longer
220: * available to receive messages.
221: *
222: * @param dc Description of Parameter
223: * @param subscriptionId Description of Parameter
224: * @exception JMSException Description of Exception
225: */
226: public void unsubscribe(ConnectionToken dc, int subscriptionId)
227: throws JMSException;
228:
229: /**
230: * Unsubscribe from the durable subscription.
231: *
232: * @param id Description of Parameter
233: * @exception JMSException Description of Exception
234: */
235: public void destroySubscription(ConnectionToken dc,
236: DurableSubscriptionID id) throws JMSException;
237:
238: /**
239: * Check user for autentication.
240: *
241: * @param userName Description of Parameter
242: * @param password Description of Parameter
243: * @return a preconfigured clientId.
244: * @exception JMSException if user was not allowed to login
245: */
246: public String checkUser(String userName, String password)
247: throws JMSException;
248:
249: /**
250: * Check user for autentication.
251: *
252: * @param userName Description of Parameter
253: * @param password Description of Parameter
254: * @return a sessionId.
255: * @exception JMSException if user was not allowed to login
256: */
257: public String authenticate(String userName, String password)
258: throws JMSException;
259:
260: /**
261: * @param dc org.jboss.mq.ConnectionToken
262: * @param s org.jboss.mq.Subscription
263: * @exception JMSException The exception description.
264: */
265: void subscribe(org.jboss.mq.ConnectionToken dc,
266: org.jboss.mq.Subscription s) throws JMSException;
267:
268: /**
269: * Ping the server.
270: *
271: * @param dc Description of Parameter
272: * @param clientTime Description of Parameter
273: * @exception JMSException Description of Exception
274: */
275: public void ping(ConnectionToken dc, long clientTime)
276: throws JMSException;
277:
278: /**
279: * Get the topic the durable subscription is on.
280: * Primary for internal use in the server, and not for the IL's.
281: */
282: public SpyTopic getDurableTopic(DurableSubscriptionID sub)
283: throws JMSException;
284:
285: /**
286: * Get the subscription that match the id.
287: *
288: * @exception JMSException if it can not find the subscription.
289: */
290: public Subscription getSubscription(ConnectionToken dc,
291: int subscriberId) throws JMSException;
292: }
|