Public Types | ||||
typedef std::map< std::string, org::xmlBlaster::util::qos::ClientProperty > | ClientPropertyMap | |||
Public Member Functions | ||||
QosData (org::xmlBlaster::util::Global &global, std::string &serialData="") | ||||
Constructs the specialized quality of service object for a publish() or update() call. | ||||
QosData (QosData &data) | ||||
QosData & | operator= (QosData &data) | |||
virtual | ~QosData () | |||
void | setState (std::string &state) | |||
| ||||
std::string | getState () | |||
Access state of message on update(). | ||||
void | setStateInfo (std::string &stateInfo) | |||
| ||||
std::string | getStateInfo () | |||
Access state of message on update(). | ||||
bool | isOk () | |||
True if the message is OK on update(). | ||||
bool | isErased () | |||
True if the message was erased by timer or by a client invoking erase(). | ||||
bool | isTimeout () | |||
True if a timeout on this message occurred. | ||||
bool | isForwardError () | |||
True on cluster forward problems. | ||||
void | addRouteInfo (org::xmlBlaster::util::cluster::RouteInfo &routeInfo) | |||
Adds a new route hop to the QoS of this message. | ||||
int | count (org::xmlBlaster::util::cluster::NodeId &nodeId) | |||
Check if the message has already been at the given node (circulating message). | ||||
bool | dirtyRead (org::xmlBlaster::util::cluster::NodeId nodeId) | |||
Check if the message has already been at the given node (circulating message). | ||||
void | setRcvTimestamp (Timestamp rcvTimestamp) | |||
The approximate receive timestamp (UTC time), when message arrived in requestBroker.publish() method. | ||||
Timestamp | getRcvTimestamp () | |||
The approximate receive timestamp (UTC time), when message arrived in requestBroker.publish() method. | ||||
void | touchRcvTimestamp () | |||
Set timestamp to current time. | ||||
void | addClientProperty (ClientProperty &clientProperty) | |||
Add a client property. | ||||
template<typename T_VALUE> | ||||
void | addClientProperty (std::string &name, T_VALUE &value, std::string &type="", std::string &encoding="", std::string &charset="") | |||
Add a client property key and value. | ||||
template<typename T_VALUE> | ||||
T_VALUE | getClientProperty (std::string &name, T_VALUE &defaultValue) | |||
Access the value for the given name, if not found returns the defaultValue. | ||||
bool | hasClientProperty (std::string &name) | |||
ClientPropertyMap & | getClientProperties () | |||
void | setClientProperties (ClientPropertyMap &cm) | |||
org::xmlBlaster::util::SessionNameRef | getSender () | |||
Access sender unified naming object. | ||||
void | setSender (org::xmlBlaster::util::SessionNameRef sender) | |||
Access sender name. | ||||
virtual std::string | toXml (std::string &extraOffset="") | |||
Dump state of this object into a XML ASCII std::string. | ||||
virtual QosData * | getClone () | |||
Allocate a clone, the derived classes need to implement this method. | ||||
RouteVector | getRouteNodes () | |||
void | clearRoutes () | |||
int | size () | |||
org::xmlBlaster::util::PriorityEnum | getPriority () | |||
Message priority. | ||||
void | setPriority (org::xmlBlaster::util::PriorityEnum priority) | |||
Set message priority value, PriorityEnum.NORM_PRIORITY (5) is default. | ||||
bool | isFromPersistenceStore () | |||
Internal use only, is this message sent from the persistence layer? | ||||
void | setFromPersistenceStore (bool fromPersistenceStore) | |||
Internal use only, set if this message sent from the persistence layer. | ||||
void | setPersistent (bool persistent) | |||
| ||||
bool | isPersistent () | |||
| ||||
Protected Member Functions | ||||
void | copy (QosData &data) | |||
std::string | dumpClientProperties (std::string &extraOffset, bool clearText) | |||
Protected Attributes | ||||
std::string | ME | |||
org::xmlBlaster::util::Global & | global_ | |||
org::xmlBlaster::util::I_Log & | log_ | |||
std::string | serialData_ | |||
std::string | state_ | |||
the state of the message, defaults to "OK" if no state is returned | ||||
std::string | stateInfo_ | |||
Human readable information. | ||||
Timestamp | rcvTimestamp_ | |||
The receive timestamp (UTC time), when message arrived in requestBroker.publish() method. | ||||
bool | rcvTimestampFound_ | |||
org::xmlBlaster::util::PriorityEnum | priority_ | |||
The priority of the message. | ||||
bool | fromPersistenceStore_ | |||
Internal use only, is this message sent from the persistence layer? | ||||
bool | persistent_ | |||
RouteVector | routeNodeList_ | |||
ArrayList containing org::xmlBlaster::util::cluster::RouteInfo objects. | ||||
ClientPropertyMap | clientProperties_ | |||
org::xmlBlaster::util::SessionNameRef | sender_ | |||
the sender (publisher) of this message (unique loginName) |
Definition at line 57 of file QosData.h.
typedef std::map<std::string, org::xmlBlaster::util::qos::ClientProperty> org::xmlBlaster::util::qos::QosData::ClientPropertyMap |
org::xmlBlaster::util::qos::QosData::QosData | ( | org::xmlBlaster::util::Global & | global, | |
std::string & | serialData = "" | |||
) |
Constructs the specialized quality of service object for a publish() or update() call.
The | factory which knows how to serialize and parse me |
Referenced by getClone().
org::xmlBlaster::util::qos::QosData::QosData | ( | QosData & | data | ) |
org::xmlBlaster::util::qos::QosData::~QosData | ( | ) | [virtual] |
Definition at line 111 of file QosData.cpp.
void org::xmlBlaster::util::qos::QosData::copy | ( | QosData & | data | ) | [protected] |
Definition at line 62 of file QosData.cpp.
References clientProperties_, fromPersistenceStore_, getSender(), global_, persistent_, priority_, rcvTimestamp_, rcvTimestampFound_, sender_, serialData_, state_, and stateInfo_.
Referenced by org::xmlBlaster::util::qos::MsgQosData::copy(), operator=(), org::xmlBlaster::util::qos::MsgQosData::operator=(), and QosData().
std::string org::xmlBlaster::util::qos::QosData::dumpClientProperties | ( | std::string & | extraOffset, | |
bool | clearText | |||
) | [protected] |
void org::xmlBlaster::util::qos::QosData::setState | ( | std::string & | state | ) |
state | The state of an update message |
string org::xmlBlaster::util::qos::QosData::getState | ( | ) |
Access state of message on update().
Definition at line 120 of file QosData.cpp.
References state_.
Referenced by org::xmlBlaster::client::qos::PublishQos::getState(), and org::xmlBlaster::client::qos::GetReturnQos::getState().
void org::xmlBlaster::util::qos::QosData::setStateInfo | ( | std::string & | stateInfo | ) |
state | The human readable state text of an update message |
string org::xmlBlaster::util::qos::QosData::getStateInfo | ( | ) |
Access state of message on update().
Definition at line 130 of file QosData.cpp.
References stateInfo_.
Referenced by org::xmlBlaster::client::qos::PublishQos::getStateInfo().
bool org::xmlBlaster::util::qos::QosData::isOk | ( | ) |
True if the message is OK on update().
Definition at line 135 of file QosData.cpp.
References state_, and org::xmlBlaster::util::Constants::STATE_OK.
Referenced by org::xmlBlaster::client::qos::UpdateQos::isOk(), and org::xmlBlaster::client::qos::GetReturnQos::isOk().
bool org::xmlBlaster::util::qos::QosData::isErased | ( | ) |
True if the message was erased by timer or by a client invoking erase().
Definition at line 140 of file QosData.cpp.
References state_, and org::xmlBlaster::util::Constants::STATE_ERASED.
Referenced by org::xmlBlaster::client::qos::UpdateQos::isErased(), and org::xmlBlaster::client::qos::GetReturnQos::isErased().
bool org::xmlBlaster::util::qos::QosData::isTimeout | ( | ) |
True if a timeout on this message occurred.
Timeouts are spanned by the publisher and thrown by xmlBlaster on timeout to indicate for example STALE messages or any other user problem domain specific event.
Definition at line 145 of file QosData.cpp.
References state_, and org::xmlBlaster::util::Constants::STATE_TIMEOUT.
Referenced by org::xmlBlaster::client::qos::UpdateQos::isTimeout(), and org::xmlBlaster::client::qos::GetReturnQos::isTimeout().
bool org::xmlBlaster::util::qos::QosData::isForwardError | ( | ) |
True on cluster forward problems.
Definition at line 150 of file QosData.cpp.
References state_, and org::xmlBlaster::util::Constants::STATE_FORWARD_ERROR.
Referenced by org::xmlBlaster::client::qos::UpdateQos::isForwardError().
void org::xmlBlaster::util::qos::QosData::addRouteInfo | ( | org::xmlBlaster::util::cluster::RouteInfo & | routeInfo | ) |
Adds a new route hop to the QoS of this message.
The added routeInfo is assumed to be one stratum closer to the master So we will rearrange the stratum here. The given stratum in routeInfo is used to recalculate the other nodes as well.
Definition at line 155 of file QosData.cpp.
References org::xmlBlaster::util::cluster::RouteInfo::getStratum(), and routeNodeList_.
int org::xmlBlaster::util::qos::QosData::count | ( | org::xmlBlaster::util::cluster::NodeId & | nodeId | ) |
Check if the message has already been at the given node (circulating message).
Definition at line 170 of file QosData.cpp.
References routeNodeList_.
bool org::xmlBlaster::util::qos::QosData::dirtyRead | ( | org::xmlBlaster::util::cluster::NodeId | nodeId | ) |
Check if the message has already been at the given node (circulating message).
Definition at line 182 of file QosData.cpp.
References routeNodeList_.
void org::xmlBlaster::util::qos::QosData::setRcvTimestamp | ( | Timestamp | rcvTimestamp | ) |
The approximate receive timestamp (UTC time), when message arrived in requestBroker.publish() method.
In milliseconds elapsed since midnight, January 1, 1970 UTC
Definition at line 192 of file QosData.cpp.
References rcvTimestamp_.
Timestamp org::xmlBlaster::util::qos::QosData::getRcvTimestamp | ( | ) |
The approximate receive timestamp (UTC time), when message arrived in requestBroker.publish() method.
In milliseconds elapsed since midnight, January 1, 1970 UTC
Definition at line 197 of file QosData.cpp.
References rcvTimestamp_.
Referenced by org::xmlBlaster::client::qos::GetReturnQos::getRcvTime(), org::xmlBlaster::client::qos::GetReturnQos::getRcvTimestamp(), and org::xmlBlaster::util::qos::MsgQosData::getRemainingLife().
void org::xmlBlaster::util::qos::QosData::touchRcvTimestamp | ( | ) |
Set timestamp to current time.
Reimplemented in org::xmlBlaster::util::qos::MsgQosData.
Definition at line 202 of file QosData.cpp.
References org::xmlBlaster::util::TimestampFactory::getInstance, org::xmlBlaster::util::TimestampFactory::getTimestamp(), and rcvTimestamp_.
void org::xmlBlaster::util::qos::QosData::addClientProperty | ( | ClientProperty & | clientProperty | ) |
Add a client property.
clientProperty |
Definition at line 207 of file QosData.cpp.
References clientProperties_, and org::xmlBlaster::util::qos::ClientProperty::getName().
Referenced by org::xmlBlaster::test::TestClientProperty::testQosData().
void org::xmlBlaster::util::qos::QosData::addClientProperty | ( | std::string & | name, | |
T_VALUE & | value, | |||
std::string & | type = "" , |
|||
std::string & | encoding = "" , |
|||
std::string & | charset = "" | |||
) |
Add a client property key and value.
If you use other character sets than US-ASCII you should set the type to Constants::TYPE_BLOB (which will force a Base64 encoding).
name | The key name in US-ASCII encoding | |
value | "vector<unsigned char>" and "unsigned char *" is treated as a blob | |
type | Optionally you can force another type than "String", for example Constants::TYPE_DOUBLE if the pointer contains such a number as a string representation. | |
encoding | How the data is transferred, org::xmlBlaster::util::Constants::ENCODING_BASE64 or "" |
Definition at line 320 of file QosData.h.
References clientProperties_.
T_VALUE org::xmlBlaster::util::qos::QosData::getClientProperty | ( | std::string & | name, | |
T_VALUE & | defaultValue | |||
) |
Access the value for the given name, if not found returns the defaultValue.
Definition at line 329 of file QosData.h.
References clientProperties_.
Referenced by org::xmlBlaster::test::TestClientProperty::testQosData().
bool org::xmlBlaster::util::qos::QosData::hasClientProperty | ( | std::string & | name | ) |
QosData::ClientPropertyMap & org::xmlBlaster::util::qos::QosData::getClientProperties | ( | ) |
Definition at line 217 of file QosData.cpp.
References clientProperties_.
Referenced by org::xmlBlaster::client::qos::PublishQos::getClientProperties(), org::xmlBlaster::client::qos::GetReturnQos::getClientProperties(), and org::xmlBlaster::test::TestClientProperty::testQosData().
void org::xmlBlaster::util::qos::QosData::setClientProperties | ( | ClientPropertyMap & | cm | ) |
SessionNameRef org::xmlBlaster::util::qos::QosData::getSender | ( | ) |
Access sender unified naming object.
Definition at line 297 of file QosData.cpp.
References sender_.
Referenced by copy(), org::xmlBlaster::client::qos::PublishQos::getSender(), and org::xmlBlaster::client::qos::GetReturnQos::getSender().
void org::xmlBlaster::util::qos::QosData::setSender | ( | org::xmlBlaster::util::SessionNameRef | sender | ) |
Access sender name.
loginName | of sender |
Definition at line 302 of file QosData.cpp.
References sender_.
Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::publish(), and org::xmlBlaster::util::queue::MsgQueueEntry::setSender().
std::string org::xmlBlaster::util::qos::QosData::toXml | ( | std::string & | extraOffset = "" |
) | [virtual] |
Dump state of this object into a XML ASCII std::string.
Needs to be implemented by derived classes.
extraOffset | indenting of tags for nice output |
Reimplemented in org::xmlBlaster::util::qos::MsgQosData, and org::xmlBlaster::util::qos::QueryQosData.
Definition at line 324 of file QosData.cpp.
Referenced by org::xmlBlaster::client::protocol::corba::CorbaConnection::copyToCorba(), org::xmlBlaster::util::queue::MsgQueueEntry::getEmbeddedObject(), org::xmlBlaster::client::protocol::socket::SocketDriver::publish(), and size().
QosData * org::xmlBlaster::util::qos::QosData::getClone | ( | ) | [virtual] |
Allocate a clone, the derived classes need to implement this method.
Reimplemented in org::xmlBlaster::util::qos::MsgQosData, and org::xmlBlaster::util::qos::QueryQosData.
Definition at line 319 of file QosData.cpp.
References QosData().
RouteVector org::xmlBlaster::util::qos::QosData::getRouteNodes | ( | ) |
Definition at line 227 of file QosData.cpp.
References routeNodeList_.
Referenced by org::xmlBlaster::client::qos::GetReturnQos::getRouteNodes().
void org::xmlBlaster::util::qos::QosData::clearRoutes | ( | ) |
int org::xmlBlaster::util::qos::QosData::size | ( | ) |
PriorityEnum org::xmlBlaster::util::qos::QosData::getPriority | ( | ) |
Message priority.
Definition at line 247 of file QosData.cpp.
References priority_.
Referenced by org::xmlBlaster::client::qos::PublishQos::getPriority(), org::xmlBlaster::client::qos::GetReturnQos::getPriority(), org::xmlBlaster::util::queue::PublishQueueEntry::PublishQueueEntry(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queuePublish(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queueSubscribe(), and org::xmlBlaster::test::TestQueue::testWithOnePublishEntry().
void org::xmlBlaster::util::qos::QosData::setPriority | ( | org::xmlBlaster::util::PriorityEnum | priority | ) |
Set message priority value, PriorityEnum.NORM_PRIORITY (5) is default.
org::xmlBlaster::util::PriorityEnum.MIN_PRIORITY (0) is slowest whereas org::xmlBlaster::util::PriorityEnum.MAX_PRIORITY (9) is highest priority.
Definition at line 258 of file QosData.cpp.
References priority_.
Referenced by org::xmlBlaster::client::qos::PublishQos::setPriority().
bool org::xmlBlaster::util::qos::QosData::isFromPersistenceStore | ( | ) |
Internal use only, is this message sent from the persistence layer?
Definition at line 267 of file QosData.cpp.
References fromPersistenceStore_.
void org::xmlBlaster::util::qos::QosData::setFromPersistenceStore | ( | bool | fromPersistenceStore | ) |
Internal use only, set if this message sent from the persistence layer.
true/false |
Definition at line 276 of file QosData.cpp.
References fromPersistenceStore_.
void org::xmlBlaster::util::qos::QosData::setPersistent | ( | bool | persistent | ) |
persistent | mark a message as persistent |
Definition at line 284 of file QosData.cpp.
References persistent_.
Referenced by org::xmlBlaster::client::qos::SubscribeQos::setPersistent(), and org::xmlBlaster::client::qos::PublishQos::setPersistent().
bool org::xmlBlaster::util::qos::QosData::isPersistent | ( | ) |
Definition at line 292 of file QosData.cpp.
References persistent_.
Referenced by org::xmlBlaster::client::qos::GetReturnQos::isPersistent().
std::string org::xmlBlaster::util::qos::QosData::ME [protected] |
Definition at line 64 of file QosData.h.
Referenced by org::xmlBlaster::util::qos::QueryQosData::QueryQosData().
Definition at line 65 of file QosData.h.
Referenced by copy(), org::xmlBlaster::util::qos::MsgQosData::getTopicProperty(), and org::xmlBlaster::util::qos::MsgQosData::setReadonly().
std::string org::xmlBlaster::util::qos::QosData::serialData_ [protected] |
std::string org::xmlBlaster::util::qos::QosData::state_ [protected] |
the state of the message, defaults to "OK" if no state is returned
Definition at line 70 of file QosData.h.
Referenced by copy(), getState(), isErased(), isForwardError(), isOk(), and isTimeout().
std::string org::xmlBlaster::util::qos::QosData::stateInfo_ [protected] |
Human readable information.
Definition at line 72 of file QosData.h.
Referenced by copy(), and getStateInfo().
The receive timestamp (UTC time), when message arrived in requestBroker.publish() method.
In nanoseconds elapsed since midnight, January 1, 1970 UTC
Definition at line 79 of file QosData.h.
Referenced by copy(), getRcvTimestamp(), setRcvTimestamp(), and touchRcvTimestamp().
bool org::xmlBlaster::util::qos::QosData::rcvTimestampFound_ [protected] |
The priority of the message.
Definition at line 83 of file QosData.h.
Referenced by copy(), getPriority(), and setPriority().
bool org::xmlBlaster::util::qos::QosData::fromPersistenceStore_ [protected] |
Internal use only, is this message sent from the persistence layer?
Definition at line 86 of file QosData.h.
Referenced by copy(), isFromPersistenceStore(), and setFromPersistenceStore().
bool org::xmlBlaster::util::qos::QosData::persistent_ [protected] |
ArrayList containing org::xmlBlaster::util::cluster::RouteInfo objects.
Definition at line 93 of file QosData.h.
Referenced by addRouteInfo(), clearRoutes(), count(), dirtyRead(), and getRouteNodes().
Definition at line 98 of file QosData.h.
Referenced by addClientProperty(), copy(), getClientProperties(), getClientProperty(), and setClientProperties().
org::xmlBlaster::util::SessionNameRef org::xmlBlaster::util::qos::QosData::sender_ [mutable, protected] |
the sender (publisher) of this message (unique loginName)
Definition at line 101 of file QosData.h.
Referenced by copy(), getSender(), and setSender().