KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > common > datagram > IControlDatagramFactory


1 package com.ubermq.jms.common.datagram;
2
3
4 /**
5  * This factory interface allows clients to create command datagrams
6  * in a well-formed way. This represents the basic set of commands that
7  * a JMS server should recognize. Clients will send any or all of these commands
8  * to a JMS server at their leisure.
9  * <P>
10  * This factory interface exists so that JMS implementations can use different
11  * wire representations of the different commands available to JMS participants.
12  * This is useful if subscribing, for instance, can be done by interacting
13  * with a database, or some action that does not belong in the JMS server.
14  * <P>
15  * Clients should not assume use of the default factory - they should accept
16  * a pluggable factory and use it wherever possible.
17  */

18 public interface IControlDatagramFactory
19 {
20     /**
21      * Informs the peer that this connection should be considered as a
22      * clustering propagation connection, and any messages emerging from it
23      * should be interpreted as repeated.
24      * @return a control datagram
25      */

26     public IControlDatagram cluster();
27
28     /**
29      * Gives the peer the unique identifier of this clustering connection.
30      * @return a control datagram
31      */

32     public IControlDatagram clusterPeer(String JavaDoc peerId);
33
34     /**
35      * The null operation. This can be used for connection keep alive.
36      * @return a control datagram
37      */

38     public IControlDatagram noop();
39
40     /**
41      * Asks the connection peer to begin sending messages.
42      * @return a control datagram
43      */

44     public IControlDatagram start();
45
46     /**
47      * Asks the connection peer to stop sending messages.
48      * @return a control datagram
49      */

50     public IControlDatagram stop();
51
52     /**
53      * Subscribes to the given topic specification. The topic specification
54      * is not defined here; it is only meaningful to the recipient.
55      * @return a control datagram
56      */

57     public IControlDatagram subscribe(String JavaDoc topic);
58
59     /**
60      * Subscribes to the given topic specification and message selector.
61      * Both are interpreted by the peer.
62      * @return a control datagram
63      *
64      */

65     public IControlDatagram subscribe(String JavaDoc topic, String JavaDoc selector);
66
67     /**
68      * Unsubscribe from the topic specification given. The same specification
69      * should have been given in a prior subscribe() call.
70      * @return a control datagram
71      */

72     public IControlDatagram unsubscribe(String JavaDoc topic);
73
74     /**
75      * Indicates that the durable subscription is switching to disconnected mode.
76      * @return a control datagram
77      */

78     public IControlDatagram durableGoingAway(String JavaDoc durable);
79
80     /**
81      * Recovers a durable subscription, resending all unacknowledged messages.
82      * @return a control datagram
83      */

84     public IControlDatagram durableRecover(String JavaDoc durable);
85
86     /**
87      * Creates or resurrects a durable subscription, with the given name and
88      * topic specification.
89      * @return a control datagram
90      */

91     public IControlDatagram durableSubscribe(String JavaDoc durable, String JavaDoc topic);
92
93     /**
94      * Creates or resurrects a durable subscription, with the given name,
95      * topic specification and selector.
96      * @return a control datagram
97      */

98     public IControlDatagram durableSubscribe(String JavaDoc durable, String JavaDoc topic, String JavaDoc selector);
99
100     /**
101      * Permanently removes the named durable subscription.
102      * @return a control datagram
103      */

104     public IControlDatagram durableUnsubscribe(String JavaDoc durable);
105
106     /**
107      * Starts receiving messages from the named queue, with
108      * the specified message selector (or null for none).
109      * @param queue the name of the queue
110      * @param selector a message selector, or null to allow all messages.
111      * @return a control datagram
112      */

113     public IControlDatagram queueStart(String JavaDoc queue, String JavaDoc selector);
114
115     /**
116      * Stops receiving messages from the named queue.
117      * @param queue the name of the queue
118      * @return a control datagram
119      */

120     public IControlDatagram queueStop(String JavaDoc queue);
121
122     /**
123      * Deletes a queue.
124      * @param queue the name of the queue.
125      */

126     public IControlDatagram queueDelete(String JavaDoc queue);
127 }
128
Popular Tags