1 /*------------------------------------------------------------------------------
 2 Name:      SubscribeQueueEntry.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 ------------------------------------------------------------------------------*/
 6 
 7 #ifndef _UTIL_QUEUE_SUBSCRIBEQUEUEENRY_H
 8 #define _UTIL_QUEUE_SUBSCRIBEQUEUEENRY_H
 9 
10 #include <util/MethodName.h>
11 #include <util/queue/MsgQueueEntry.h>
12 #include <client/qos/SubscribeQos.h>
13 #include <client/qos/SubscribeReturnQos.h>
14 #include <client/key/SubscribeKey.h>
15 
16 
17 /**
18  * Class embedding messages or information to be stored on the client queues
19  * Note that all content is copied when passed to the constructors.
20  * This way this queue entry is the owner of the content (and therefore will
21  * delete it when its destructor is called).
22  *
23  * @author <a href='mailto:laghi@swissinfo.org'>Michele Laghi</a>
24  */
25 namespace org { namespace xmlBlaster { namespace util { namespace queue {
26 
27 class Dll_Export SubscribeQueueEntry : public org::xmlBlaster::util::queue::MsgQueueEntry
28 {
29 public:
30 
31    /**
32     * Constructor suited for operations like subscribe and unSubscribe
33     */
34    SubscribeQueueEntry(org::xmlBlaster::util::Global& global,
35                        const org::xmlBlaster::client::key::SubscribeKey& subscribeKey,
36                        const org::xmlBlaster::client::qos::SubscribeQos& subscribeQos,
37                        int priority=NORM_PRIORITY,
38                        org::xmlBlaster::util::Timestamp uniqueId = TimestampFactory::getInstance().getTimestamp());
39 
40    ~SubscribeQueueEntry();
41 
42    /**
43     * copy constructor
44     */
45    SubscribeQueueEntry(const SubscribeQueueEntry& entry);
46 
47    /**
48     * assignment constructor
49     */
50    SubscribeQueueEntry& operator =(const SubscribeQueueEntry& entry);
51 
52    MsgQueueEntry *getClone() const;
53 
54    virtual bool isSubscribe() const;
55 
56    // this should actually be in another interface but since it is an only method we put it here.
57    const org::xmlBlaster::util::queue::MsgQueueEntry& send(org::xmlBlaster::util::dispatch::I_ConnectionsHandler& connectionsHandler) const;
58 
59    /**
60     * @return A copy of the subscribe QoS
61     */
62    org::xmlBlaster::client::qos::SubscribeQos getSubscribeQos() const;
63 
64    /**
65     * @return A copy of the subscribe Key
66     */
67    org::xmlBlaster::client::key::SubscribeKey getSubscribeKey() const;
68  
69    org::xmlBlaster::client::qos::SubscribeReturnQos getSubscribeReturnQos() const;
70 
71    std::string toXml(const std::string& indent="") const;
72 
73 };
74 
75 }}}} // namespace
76 
77 #endif


syntax highlighted by Code2HTML, v. 0.9.1