1 /*------------------------------------------------------------------------------
2 Name: ConnectQueueEntry.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 ------------------------------------------------------------------------------*/
6 #ifndef _UTIL_QUEUE_CONNECTQUEUEENRY_H
7 #define _UTIL_QUEUE_CONNECTQUEUEENRY_H
8
9 #include <util/MethodName.h>
10 #include <util/queue/MsgQueueEntry.h>
11
12 /**
13 * Class embedding messages or information to be stored on the client queues
14 * Note that all content is copied when passed to the constructors.
15 * This way this queue entry is the owner of the content (and therefore will
16 * delete it when its destructor is called).
17 *
18 * @author <a href='mailto:laghi@swissinfo.org'>Michele Laghi</a>
19 * @author <a href='mailto:xmlblast@marcelruff.info'>Marcel Ruff</a>
20 */
21 namespace org { namespace xmlBlaster { namespace util { namespace queue {
22
23 class Dll_Export ConnectQueueEntry : public org::xmlBlaster::util::queue::MsgQueueEntry
24 {
25 /**
26 * Holds the serialized information which is returned by getEmbeddedObject(),
27 * encoded according to embeddedType
28 */
29 mutable BlobHolder blobHolder_;
30
31 /**
32 * assignment constructor
33 */
34 ConnectQueueEntry& operator =(const ConnectQueueEntry& entry);
35
36 public:
37
38 /**
39 * Constructor suited for operations like publishes
40 * @param type Only "MSG_RAW|connect" is supported
41 */
42 ConnectQueueEntry(org::xmlBlaster::util::Global& global,
43 const org::xmlBlaster::util::qos::ConnectQosRef& connectQos,
44 int priority=MAX_PRIORITY,
45 org::xmlBlaster::util::Timestamp uniqueId = TimestampFactory::getInstance().getTimestamp());
46
47 /**
48 * copy constructor
49 */
50 ConnectQueueEntry(const ConnectQueueEntry& entry);
51
52 MsgQueueEntry *getClone() const;
53
54 ~ConnectQueueEntry();
55
56 /**
57 * gets the content of this queue entry (the embedded object). In
58 * persistent queues this is the data which is stored as a blob.
59 */
60 const void* getEmbeddedObject() const;
61
62 virtual bool isConnect() const;
63
64 // this should actually be in another interface but since it is an only method we put it here.
65 const org::xmlBlaster::util::queue::MsgQueueEntry& send(org::xmlBlaster::util::dispatch::I_ConnectionsHandler& connectionsHandler) const;
66
67 size_t getSizeInBytes() const;
68
69 /**
70 * @return Can be null ref.isNull()
71 */
72 org::xmlBlaster::util::qos::ConnectQosRef getConnectQos() const;
73
74 /**
75 * @return Can be null ref.isNull()
76 */
77 org::xmlBlaster::util::qos::ConnectReturnQosRef getConnectReturnQos() const;
78
79 std::string toXml(const std::string& indent="") const;
80
81 };
82
83 }}}} // namespace
84
85 #endif
syntax highlighted by Code2HTML, v. 0.9.1