org::xmlBlaster::util::queue::MsgQueueEntry Class Reference

Inheritance diagram for org::xmlBlaster::util::queue::MsgQueueEntry:

Inheritance graph
[legend]
Collaboration diagram for org::xmlBlaster::util::queue::MsgQueueEntry:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MsgQueueEntry (org::xmlBlaster::util::Global &global, org::xmlBlaster::util::MessageUnit &msgUnit, std::string &embeddedType, int priority, bool persistent, org::xmlBlaster::util::Timestamp uniqueId=TimestampFactory::getInstance().getTimestamp())
 Constructor suited for operations like publishes.
 MsgQueueEntry (org::xmlBlaster::util::Global &global, org::xmlBlaster::util::qos::ConnectQosRef &connectQos, std::string &embeddedType, int priority, bool persistent, org::xmlBlaster::util::Timestamp uniqueId=TimestampFactory::getInstance().getTimestamp())
 Constructor suited for operations like connect.
 MsgQueueEntry (org::xmlBlaster::util::Global &global, org::xmlBlaster::util::key::QueryKeyData &queryKeyData, org::xmlBlaster::util::qos::QueryQosData &queryQosData, std::string &embeddedType, int priority, bool persistent, org::xmlBlaster::util::Timestamp uniqueId=TimestampFactory::getInstance().getTimestamp())
 Constructor suited for operations like subscribe and unSubscribe.
virtual ~MsgQueueEntry ()
org::xmlBlaster::util::GlobalgetGlobal ()
void copy (MsgQueueEntry &entry)
 MsgQueueEntry (MsgQueueEntry &entry)
 copy constructor
MsgQueueEntryoperator= (MsgQueueEntry &entry)
bool operator== (MsgQueueEntry &entry)
bool operator< (MsgQueueEntry &entry)
 returns true if the current object is lower than the entry passed as an argument.
virtual MsgQueueEntrygetClone ()=0
 Create a new entry of myself.
int getPriority ()
 Allows to query the priority of this entry.
bool isPersistent ()
 Returns true if the entry is persistent (persistent), false otherwise.
void setSender (org::xmlBlaster::util::SessionNameRef sender)
 Set the sender name into the QoS.
org::xmlBlaster::util::Timestamp getUniqueId ()
 This is the second order criteria in the queue.
virtual void * getEmbeddedObject ()
 The serialized data with MSG_RAW (identical to the SOCKET protocol serialization).
virtual std::string getEmbeddedType ()
 gets the embeddedType of the object embedded in this entry.
virtual bool isConnect ()
virtual bool isPublish ()
virtual bool isSubscribe ()
virtual bool isUnSubscribe ()
virtual bool isErase ()
std::string getLogId ()
 Return a human readable identifier for logging output.
virtual size_t getSizeInBytes ()
 returns the size in bytes of this entry.
org::xmlBlaster::util::MessageUnitgetMsgUnit ()
 Access the MessageUnit in case it is a Publish.
virtual MsgQueueEntrysend (org::xmlBlaster::util::dispatch::I_ConnectionsHandler &)
virtual std::string toXml (std::string &indent="")

Protected Attributes

std::string ME
org::xmlBlaster::util::Globalglobal_
org::xmlBlaster::util::I_Loglog_
int priority_
bool persistent_
org::xmlBlaster::util::Timestamp uniqueId_
std::string embeddedType_
std::string logId_
org::xmlBlaster::util::MessageUnitmsgUnit_
org::xmlBlaster::util::qos::ConnectQosRef connectQos_
org::xmlBlaster::util::qos::ConnectReturnQosRef connectReturnQos_
 Specific return value for connect().
org::xmlBlaster::client::qos::PublishReturnQospublishReturnQos_
 Specific return value for publish().
org::xmlBlaster::util::qos::StatusQosDatastatusQosData_
 Return status for subscribe() etc.
BlobHolder blobHolder_
 Holds the serialized information which is returned by getEmbeddedObject(), encoded according to embeddedType.

Detailed Description

Definition at line 50 of file MsgQueueEntry.h.


Constructor & Destructor Documentation

org::xmlBlaster::util::queue::MsgQueueEntry::MsgQueueEntry ( org::xmlBlaster::util::Global global,
org::xmlBlaster::util::MessageUnit msgUnit,
std::string &  embeddedType,
int  priority,
bool  persistent,
org::xmlBlaster::util::Timestamp  uniqueId = TimestampFactory::getInstance().getTimestamp() 
)

Constructor suited for operations like publishes.

Parameters:
msgUnit We take a clone of it
embeddedType Describes the type of serialization of the embedded object to be able to restore it later, something like "MSG_RAW|publish"

org::xmlBlaster::util::queue::MsgQueueEntry::MsgQueueEntry ( org::xmlBlaster::util::Global global,
org::xmlBlaster::util::qos::ConnectQosRef connectQos,
std::string &  embeddedType,
int  priority,
bool  persistent,
org::xmlBlaster::util::Timestamp  uniqueId = TimestampFactory::getInstance().getTimestamp() 
)

Constructor suited for operations like connect.

Parameters:
connectQos We take a clone of it

org::xmlBlaster::util::queue::MsgQueueEntry::MsgQueueEntry ( org::xmlBlaster::util::Global global,
org::xmlBlaster::util::key::QueryKeyData queryKeyData,
org::xmlBlaster::util::qos::QueryQosData queryQosData,
std::string &  embeddedType,
int  priority,
bool  persistent,
org::xmlBlaster::util::Timestamp  uniqueId = TimestampFactory::getInstance().getTimestamp() 
)

Constructor suited for operations like subscribe and unSubscribe.

Parameters:
queryKeyData We take a clone of it
queryQosData We take a clone of it

org::xmlBlaster::util::queue::MsgQueueEntry::~MsgQueueEntry (  )  [virtual]

Definition at line 121 of file MsgQueueEntry.cpp.

References blobHolder_, org::xmlBlaster::util::queue::BlobHolder::data, org::xmlBlaster::util::queue::BlobHolder::dataLen, msgUnit_, publishReturnQos_, and statusQosData_.

org::xmlBlaster::util::queue::MsgQueueEntry::MsgQueueEntry ( MsgQueueEntry entry  ) 

copy constructor

Definition at line 134 of file MsgQueueEntry.cpp.

References blobHolder_, copy(), msgUnit_, publishReturnQos_, and statusQosData_.


Member Function Documentation

org::xmlBlaster::util::Global& org::xmlBlaster::util::queue::MsgQueueEntry::getGlobal (  ) 

Definition at line 127 of file MsgQueueEntry.h.

void org::xmlBlaster::util::queue::MsgQueueEntry::copy ( MsgQueueEntry entry  ) 

Definition at line 87 of file MsgQueueEntry.cpp.

References connectQos_, connectReturnQos_, embeddedType_, logId_, msgUnit_, persistent_, priority_, publishReturnQos_, statusQosData_, and uniqueId_.

Referenced by MsgQueueEntry(), and operator=().

MsgQueueEntry & org::xmlBlaster::util::queue::MsgQueueEntry::operator= ( MsgQueueEntry entry  ) 

Definition at line 147 of file MsgQueueEntry.cpp.

References blobHolder_, copy(), and org::xmlBlaster::util::ReferenceCounterBase::operator=().

bool org::xmlBlaster::util::queue::MsgQueueEntry::operator== ( MsgQueueEntry entry  ) 

Definition at line 138 of file MsgQueueEntry.h.

References priority_, and uniqueId_.

bool org::xmlBlaster::util::queue::MsgQueueEntry::operator< ( MsgQueueEntry entry  ) 

returns true if the current object is lower than the entry passed as an argument.

Definition at line 148 of file MsgQueueEntry.h.

References priority_, and uniqueId_.

virtual MsgQueueEntry* org::xmlBlaster::util::queue::MsgQueueEntry::getClone (  )  [pure virtual]

Create a new entry of myself.

Returns:
The cloned entry, is is allocated with new and it is your responsibility to delete it

Implemented in org::xmlBlaster::util::queue::ConnectQueueEntry, org::xmlBlaster::util::queue::EraseQueueEntry, org::xmlBlaster::util::queue::PublishQueueEntry, org::xmlBlaster::util::queue::SubscribeQueueEntry, and org::xmlBlaster::util::queue::UnSubscribeQueueEntry.

Referenced by org::xmlBlaster::util::queue::RamQueuePlugin::put().

int org::xmlBlaster::util::queue::MsgQueueEntry::getPriority (  ) 

Allows to query the priority of this entry.

This is the highest order precedence in the sorted queue

Returns:
The priority

Definition at line 161 of file MsgQueueEntry.cpp.

References priority_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().

int org::xmlBlaster::util::queue::MsgQueueEntry::isPersistent (  ) 

Returns true if the entry is persistent (persistent), false otherwise.

Definition at line 166 of file MsgQueueEntry.cpp.

References persistent_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put(), and org::xmlBlaster::util::queue::CacheQueuePlugin::put().

void org::xmlBlaster::util::queue::MsgQueueEntry::setSender ( org::xmlBlaster::util::SessionNameRef  sender  ) 

Set the sender name into the QoS.

Definition at line 171 of file MsgQueueEntry.cpp.

References org::xmlBlaster::util::MessageUnit::getQos(), msgUnit_, and org::xmlBlaster::util::qos::QosData::setSender().

Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked().

Timestamp org::xmlBlaster::util::queue::MsgQueueEntry::getUniqueId (  ) 

This is the second order criteria in the queue.

Returns:
The unique Id of this entry.

Definition at line 180 of file MsgQueueEntry.cpp.

References uniqueId_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().

void * org::xmlBlaster::util::queue::MsgQueueEntry::getEmbeddedObject (  )  [virtual]

The serialized data with MSG_RAW (identical to the SOCKET protocol serialization).

Returns:
The content of this queue entry (the embedded object). In persistent queues this is the data which is stored as a blob. Returns a BlobHolder instance containing the serialized message (identical serialization as in SOCKET protocol) May return 0.

Reimplemented in org::xmlBlaster::util::queue::ConnectQueueEntry.

Definition at line 215 of file MsgQueueEntry.cpp.

References blobHolder_, org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::queue::BlobHolder::data, org::xmlBlaster::util::queue::BlobHolder::dataLen, org::xmlBlaster::util::I_Log::dump(), embeddedType_, org::xmlBlaster::util::I_Log::error(), org::xmlBlaster::util::MessageUnit::getContent(), org::xmlBlaster::util::MessageUnit::getContentLen(), org::xmlBlaster::util::MessageUnit::getKey(), org::xmlBlaster::util::MessageUnit::getQos(), log_, ME, msgUnit_, org::xmlBlaster::util::qos::QosData::toXml(), org::xmlBlaster::util::key::KeyData::toXml(), and org::xmlBlaster::util::MessageUnit::toXml().

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put().

string org::xmlBlaster::util::queue::MsgQueueEntry::getEmbeddedType (  )  [virtual]

gets the embeddedType of the object embedded in this entry.

Returns:
String in namespace MethodName, the identifier which tells the I_EntryFactory how to deserialize this entry, e.g. "MSG_RAW|publish"

Definition at line 190 of file MsgQueueEntry.cpp.

References embeddedType_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put().

int org::xmlBlaster::util::queue::MsgQueueEntry::isConnect (  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::ConnectQueueEntry.

Definition at line 195 of file MsgQueueEntry.cpp.

int org::xmlBlaster::util::queue::MsgQueueEntry::isPublish (  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::PublishQueueEntry.

Definition at line 199 of file MsgQueueEntry.cpp.

Referenced by PublishDemo::postSend().

int org::xmlBlaster::util::queue::MsgQueueEntry::isSubscribe (  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::SubscribeQueueEntry.

Definition at line 203 of file MsgQueueEntry.cpp.

int org::xmlBlaster::util::queue::MsgQueueEntry::isUnSubscribe (  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::UnSubscribeQueueEntry.

Definition at line 207 of file MsgQueueEntry.cpp.

int org::xmlBlaster::util::queue::MsgQueueEntry::isErase (  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::EraseQueueEntry.

Definition at line 211 of file MsgQueueEntry.cpp.

string org::xmlBlaster::util::queue::MsgQueueEntry::getLogId (  ) 

Return a human readable identifier for logging output.

See the derived class for a syntax description.

Definition at line 185 of file MsgQueueEntry.cpp.

References logId_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put().

size_t org::xmlBlaster::util::queue::MsgQueueEntry::getSizeInBytes (  )  [virtual]

returns the size in bytes of this entry.

Reimplemented in org::xmlBlaster::util::queue::ConnectQueueEntry, and org::xmlBlaster::util::queue::PublishQueueEntry.

Definition at line 155 of file MsgQueueEntry.cpp.

References org::xmlBlaster::util::MessageUnit::getSizeInBytes(), and msgUnit_.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put(), and org::xmlBlaster::util::queue::RamQueuePlugin::put().

MessageUnit & org::xmlBlaster::util::queue::MsgQueueEntry::getMsgUnit (  ) 

Access the MessageUnit in case it is a Publish.

Returns:
NULL if not publish

Definition at line 275 of file MsgQueueEntry.cpp.

References msgUnit_.

MsgQueueEntry & org::xmlBlaster::util::queue::MsgQueueEntry::send ( org::xmlBlaster::util::dispatch::I_ConnectionsHandler  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::ConnectQueueEntry, org::xmlBlaster::util::queue::EraseQueueEntry, org::xmlBlaster::util::queue::PublishQueueEntry, org::xmlBlaster::util::queue::SubscribeQueueEntry, and org::xmlBlaster::util::queue::UnSubscribeQueueEntry.

Definition at line 269 of file MsgQueueEntry.cpp.

References org::xmlBlaster::util::I_Log::error(), log_, and ME.

Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueueUnlocked().

virtual std::string org::xmlBlaster::util::queue::MsgQueueEntry::toXml ( std::string &  indent = ""  )  [virtual]

Reimplemented in org::xmlBlaster::util::queue::ConnectQueueEntry, org::xmlBlaster::util::queue::EraseQueueEntry, org::xmlBlaster::util::queue::PublishQueueEntry, org::xmlBlaster::util::queue::SubscribeQueueEntry, and org::xmlBlaster::util::queue::UnSubscribeQueueEntry.

Referenced by org::xmlBlaster::util::queue::SQLiteQueuePlugin::put(), and org::xmlBlaster::util::queue::RamQueuePlugin::put().


Member Data Documentation

std::string org::xmlBlaster::util::queue::MsgQueueEntry::ME [protected]

Definition at line 53 of file MsgQueueEntry.h.

Referenced by org::xmlBlaster::util::queue::ConnectQueueEntry::ConnectQueueEntry(), org::xmlBlaster::util::queue::EraseQueueEntry::EraseQueueEntry(), getEmbeddedObject(), org::xmlBlaster::util::queue::ConnectQueueEntry::getEmbeddedObject(), org::xmlBlaster::util::queue::PublishQueueEntry::PublishQueueEntry(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::send(), org::xmlBlaster::util::queue::SubscribeQueueEntry::send(), org::xmlBlaster::util::queue::PublishQueueEntry::send(), send(), org::xmlBlaster::util::queue::EraseQueueEntry::send(), org::xmlBlaster::util::queue::ConnectQueueEntry::send(), org::xmlBlaster::util::queue::SubscribeQueueEntry::SubscribeQueueEntry(), and org::xmlBlaster::util::queue::UnSubscribeQueueEntry::UnSubscribeQueueEntry().

org::xmlBlaster::util::Global& org::xmlBlaster::util::queue::MsgQueueEntry::global_ [mutable, protected]

Definition at line 54 of file MsgQueueEntry.h.

Referenced by org::xmlBlaster::util::queue::EraseQueueEntry::getEraseKey(), org::xmlBlaster::util::queue::EraseQueueEntry::getEraseQos(), org::xmlBlaster::util::queue::EraseQueueEntry::getEraseReturnQos(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeKey(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeQos(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeReturnQos(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeKey(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeQos(), and org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeReturnQos().

org::xmlBlaster::util::I_Log& org::xmlBlaster::util::queue::MsgQueueEntry::log_ [protected]

Definition at line 55 of file MsgQueueEntry.h.

Referenced by org::xmlBlaster::util::queue::ConnectQueueEntry::ConnectQueueEntry(), getEmbeddedObject(), org::xmlBlaster::util::queue::ConnectQueueEntry::getEmbeddedObject(), org::xmlBlaster::util::queue::PublishQueueEntry::PublishQueueEntry(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::send(), org::xmlBlaster::util::queue::SubscribeQueueEntry::send(), org::xmlBlaster::util::queue::PublishQueueEntry::send(), send(), org::xmlBlaster::util::queue::EraseQueueEntry::send(), and org::xmlBlaster::util::queue::ConnectQueueEntry::send().

int org::xmlBlaster::util::queue::MsgQueueEntry::priority_ [protected]

Definition at line 56 of file MsgQueueEntry.h.

Referenced by copy(), getPriority(), operator<(), operator==(), and org::xmlBlaster::util::queue::PublishQueueEntry::PublishQueueEntry().

bool org::xmlBlaster::util::queue::MsgQueueEntry::persistent_ [protected]

Definition at line 57 of file MsgQueueEntry.h.

Referenced by copy(), and isPersistent().

org::xmlBlaster::util::Timestamp org::xmlBlaster::util::queue::MsgQueueEntry::uniqueId_ [protected]

Definition at line 58 of file MsgQueueEntry.h.

Referenced by copy(), getUniqueId(), operator<(), and operator==().

std::string org::xmlBlaster::util::queue::MsgQueueEntry::embeddedType_ [protected]

Definition at line 59 of file MsgQueueEntry.h.

Referenced by copy(), getEmbeddedObject(), org::xmlBlaster::util::queue::ConnectQueueEntry::getEmbeddedObject(), and getEmbeddedType().

std::string org::xmlBlaster::util::queue::MsgQueueEntry::logId_ [protected]

Definition at line 60 of file MsgQueueEntry.h.

Referenced by copy(), and getLogId().

org::xmlBlaster::util::MessageUnit* org::xmlBlaster::util::queue::MsgQueueEntry::msgUnit_ [protected]

Definition at line 61 of file MsgQueueEntry.h.

Referenced by copy(), getEmbeddedObject(), org::xmlBlaster::util::queue::EraseQueueEntry::getEraseKey(), org::xmlBlaster::util::queue::EraseQueueEntry::getEraseQos(), getMsgUnit(), org::xmlBlaster::util::queue::PublishQueueEntry::getSizeInBytes(), getSizeInBytes(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeKey(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeQos(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeKey(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeQos(), MsgQueueEntry(), org::xmlBlaster::util::queue::PublishQueueEntry::send(), setSender(), and ~MsgQueueEntry().

org::xmlBlaster::util::qos::ConnectQosRef org::xmlBlaster::util::queue::MsgQueueEntry::connectQos_ [protected]

Definition at line 63 of file MsgQueueEntry.h.

Referenced by copy(), org::xmlBlaster::util::queue::ConnectQueueEntry::getConnectQos(), org::xmlBlaster::util::queue::ConnectQueueEntry::getEmbeddedObject(), org::xmlBlaster::util::queue::ConnectQueueEntry::getSizeInBytes(), and org::xmlBlaster::util::queue::ConnectQueueEntry::send().

org::xmlBlaster::util::qos::ConnectReturnQosRef org::xmlBlaster::util::queue::MsgQueueEntry::connectReturnQos_ [mutable, protected]

Specific return value for connect().

Definition at line 68 of file MsgQueueEntry.h.

Referenced by copy(), org::xmlBlaster::util::queue::ConnectQueueEntry::getConnectReturnQos(), and org::xmlBlaster::util::queue::ConnectQueueEntry::send().

org::xmlBlaster::client::qos::PublishReturnQos* org::xmlBlaster::util::queue::MsgQueueEntry::publishReturnQos_ [mutable, protected]

Specific return value for publish().

Definition at line 72 of file MsgQueueEntry.h.

Referenced by copy(), org::xmlBlaster::util::queue::PublishQueueEntry::getPublishReturnQos(), MsgQueueEntry(), org::xmlBlaster::util::queue::PublishQueueEntry::send(), and ~MsgQueueEntry().

org::xmlBlaster::util::qos::StatusQosData* org::xmlBlaster::util::queue::MsgQueueEntry::statusQosData_ [mutable, protected]

Return status for subscribe() etc.

Definition at line 76 of file MsgQueueEntry.h.

Referenced by copy(), org::xmlBlaster::util::queue::EraseQueueEntry::getEraseReturnQos(), org::xmlBlaster::util::queue::SubscribeQueueEntry::getSubscribeReturnQos(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::getUnSubscribeReturnQos(), MsgQueueEntry(), org::xmlBlaster::util::queue::UnSubscribeQueueEntry::send(), org::xmlBlaster::util::queue::SubscribeQueueEntry::send(), org::xmlBlaster::util::queue::EraseQueueEntry::send(), and ~MsgQueueEntry().

BlobHolder org::xmlBlaster::util::queue::MsgQueueEntry::blobHolder_ [mutable, protected]

Holds the serialized information which is returned by getEmbeddedObject(), encoded according to embeddedType.

Definition at line 82 of file MsgQueueEntry.h.

Referenced by org::xmlBlaster::util::queue::EraseQueueEntry::EraseQueueEntry(), getEmbeddedObject(), MsgQueueEntry(), org::xmlBlaster::util::queue::SubscribeQueueEntry::operator=(), operator=(), org::xmlBlaster::util::queue::EraseQueueEntry::operator=(), org::xmlBlaster::util::queue::SubscribeQueueEntry::SubscribeQueueEntry(), and ~MsgQueueEntry().


The documentation for this class was generated from the following files: