org::xmlBlaster::util::qos::MsgQosData Class Reference

Inheritance diagram for org::xmlBlaster::util::qos::MsgQosData:

Inheritance graph
[legend]
Collaboration diagram for org::xmlBlaster::util::qos::MsgQosData:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MsgQosData (org::xmlBlaster::util::Global &global, std::string &serialData="")
 Constructs the specialized quality of service object for a publish() or update() call.
 MsgQosData (MsgQosData &data)
MsgQosDataoperator= (MsgQosData &data)
virtual ~MsgQosData ()
void setSubscribable (bool isSubcribeable)
 
Parameters:
isSubscribable if false PtP messages are invisible for subscriptions

bool isSubscribable ()
 Test if Publish/Subscribe style is used for PtP messages.
bool isPtp ()
 Test if Point to Point addressing style is used.
void setVolatile (bool volatileFlag)
 
Parameters:
volatile true/false

bool isVolatile ()
 
Returns:
true/false

bool isVolatileDefault ()
 
Returns:
true If the default is the current setting.

void setSubscriptionId (std::string &subscriptionId)
 If Pub/Sub style update: contains the subscribe ID which caused this update.
std::string getSubscriptionId ()
 If Pub/Sub style update: contains the subscribe ID which caused this update.
void setForceUpdate (bool forceUpdate)
 Send message to subscriber even if the content is the same as the previous.
bool isForceUpdate ()
 
Returns:
true/false

void setReadonly (bool readonly)
 
Returns:
readonly Once published the message can't be changed.

bool isReadonly ()
 
Returns:
true/false

void setRedeliver (int redeliver)
 Set > 0 if the message probably is redelivered (number of retries).
void incrRedeliver ()
 Increment the redeliver counter.
int getRedeliver ()
 Returns > 0 if the message probably is redelivered.
void setQueueSize (long queueSize)
 
Parameters:
queueSize The number of queued messages

long getQueueSize ()
 
Returns:
The number of queued messages

void setQueueIndex (long queueIndex)
 
Parameters:
queueIndex The index of the message in the queue

long getQueueIndex ()
 
Returns:
The index of the message in the queue

long getLifeTime ()
 The life time of the message or -1L if forever.
void setLifeTime (long lifeTime)
 The life time of the message or -1L if forever.
long getRemainingLife ()
 
Returns:
Milliseconds until message expiration (from now) or -1L if forever if 0L the message is expired

long getRemainingLifeStatic ()
 This is the value delivered in the QoS (as it was calculated by the server on sending) and is NOT dynamically recalculated.
void setRemainingLifeStatic (long remainingLifeStatic)
bool isExpired ()
 Calculates if we are expired.
long getMaxLifeTime ()
 The server default for max.
std::string getXmlRcvTimestamp ()
 Tagged form of message receive, e.g.
void touchRcvTimestamp ()
 Set timestamp to current time.
std::vector< DestinationgetDestinations ()
 Get all the destinations of this message.
void addDestination (Destination &destination)
 Add a destination.
virtual std::string toXml (bool clearText, std::string &extraOffset="")
 Dump state of this object into a XML ASCII std::string.
virtual std::string toXml (std::string &extraOffset="")
 Dump state of this object into a XML ASCII std::string.
virtual MsgQosDatagetClone ()
 Allocate a clone, the derived classes need to implement this method.
void setTopicProperty (org::xmlBlaster::util::qos::TopicProperty &prop)
org::xmlBlaster::util::qos::TopicProperty getTopicProperty ()
bool hasTopicProperty ()
void setForceDestroy (bool forceDestroy)
 Control message life cycle on message expiry.
bool isForceDestroy ()

Protected Member Functions

void copy (MsgQosData &data)

Protected Attributes

std::vector< DestinationdestinationList_
 ArrayList for loginQoS, holding all destination addresses (Destination objects).
bool receiveTimestampHumanReadable_

Detailed Description

Definition at line 47 of file MsgQosData.h.


Constructor & Destructor Documentation

org::xmlBlaster::util::qos::MsgQosData::MsgQosData ( org::xmlBlaster::util::Global global,
std::string &  serialData = "" 
)

Constructs the specialized quality of service object for a publish() or update() call.

Parameters:
The factory which knows how to serialize and parse me

Referenced by getClone().

org::xmlBlaster::util::qos::MsgQosData::MsgQosData ( MsgQosData data  ) 

Definition at line 95 of file MsgQosData.cpp.

References copy().

org::xmlBlaster::util::qos::MsgQosData::~MsgQosData (  )  [virtual]

Definition at line 111 of file MsgQosData.cpp.


Member Function Documentation

void org::xmlBlaster::util::qos::MsgQosData::copy ( MsgQosData data  )  [protected]

Definition at line 62 of file MsgQosData.cpp.

References org::xmlBlaster::util::qos::QosData::copy(), forceDestroy_, forceUpdate_, isExpired_, lifeTime_, maxLifeTime_, queueIndex_, queueSize_, receiveTimestampHumanReadable_, redeliver_, remainingLifeStatic_, subscribable_, subscriptionId_, and topicProperty_.

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

MsgQosData & org::xmlBlaster::util::qos::MsgQosData::operator= ( MsgQosData data  ) 

Definition at line 102 of file MsgQosData.cpp.

References copy(), org::xmlBlaster::util::qos::QosData::copy(), and destinationList_.

void org::xmlBlaster::util::qos::MsgQosData::setSubscribable ( bool  isSubcribeable  ) 

Parameters:
isSubscribable if false PtP messages are invisible for subscriptions

Parameters:
isSubscribable true if Publish/Subscribe style is used
false Only possible for PtP messages to keep PtP secret (you can't subscribe them)

Definition at line 119 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::PublishQos::setSubscribable().

bool org::xmlBlaster::util::qos::MsgQosData::isSubscribable (  ) 

Test if Publish/Subscribe style is used for PtP messages.

Returns:
false if PtP message is invisible for subscribes

Definition at line 124 of file MsgQosData.cpp.

References org::xmlBlaster::util::Prop< T >::getValue().

Referenced by org::xmlBlaster::client::qos::UpdateQos::isSubscribable().

bool org::xmlBlaster::util::qos::MsgQosData::isPtp (  ) 

Test if Point to Point addressing style is used.

Returns:
true if addressing of the destination is used false No destinations given

Definition at line 129 of file MsgQosData.cpp.

References destinationList_.

Referenced by org::xmlBlaster::client::qos::UpdateQos::isPtp().

void org::xmlBlaster::util::qos::MsgQosData::setVolatile ( bool  volatileFlag  ) 

Parameters:
volatile true/false

Definition at line 151 of file MsgQosData.cpp.

References setForceDestroy(), setLifeTime(), and setRemainingLifeStatic().

Referenced by org::xmlBlaster::client::qos::PublishQos::setVolatile().

bool org::xmlBlaster::util::qos::MsgQosData::isVolatile (  ) 

Returns:
true/false

Definition at line 163 of file MsgQosData.cpp.

References getLifeTime(), and isForceDestroy().

Referenced by org::xmlBlaster::client::qos::PublishQos::isVolatile(), and org::xmlBlaster::client::qos::GetReturnQos::isVolatile().

bool org::xmlBlaster::util::qos::MsgQosData::isVolatileDefault (  ) 

Returns:
true If the default is the current setting.

void org::xmlBlaster::util::qos::MsgQosData::setSubscriptionId ( std::string &  subscriptionId  ) 

If Pub/Sub style update: contains the subscribe ID which caused this update.

Parameters:
subscriptionId null if PtP message

string org::xmlBlaster::util::qos::MsgQosData::getSubscriptionId (  ) 

If Pub/Sub style update: contains the subscribe ID which caused this update.

Returns:
subscribeId or null if PtP message

Definition at line 181 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::UpdateQos::getSubscriptionId().

void org::xmlBlaster::util::qos::MsgQosData::setForceUpdate ( bool  forceUpdate  ) 

Send message to subscriber even if the content is the same as the previous.

Parameters:
forceUpdate 

Definition at line 190 of file MsgQosData.cpp.

References org::xmlBlaster::util::CREATED_BY_SETTER, and org::xmlBlaster::util::Prop< T >::setValue().

Referenced by org::xmlBlaster::client::qos::PublishQos::setForceUpdate().

bool org::xmlBlaster::util::qos::MsgQosData::isForceUpdate (  ) 

Returns:
true/false

Definition at line 198 of file MsgQosData.cpp.

References org::xmlBlaster::util::Prop< T >::getValue().

void org::xmlBlaster::util::qos::MsgQosData::setReadonly ( bool  readonly  ) 

Returns:
readonly Once published the message can't be changed.

Definition at line 135 of file MsgQosData.cpp.

References org::xmlBlaster::util::qos::QosData::global_, and org::xmlBlaster::util::qos::TopicProperty::setReadonly().

Referenced by org::xmlBlaster::client::qos::PublishQos::setReadonly().

bool org::xmlBlaster::util::qos::MsgQosData::isReadonly (  ) 

Returns:
true/false

Definition at line 142 of file MsgQosData.cpp.

References org::xmlBlaster::util::qos::TopicProperty::isReadonly().

Referenced by org::xmlBlaster::client::qos::GetReturnQos::isReadonly().

void org::xmlBlaster::util::qos::MsgQosData::setRedeliver ( int  redeliver  ) 

Set > 0 if the message probably is redelivered (number of retries).

Parameters:
redeliver if == 0 The message is guaranteed to be delivered only once.

Definition at line 207 of file MsgQosData.cpp.

void org::xmlBlaster::util::qos::MsgQosData::incrRedeliver (  ) 

Increment the redeliver counter.

Definition at line 215 of file MsgQosData.cpp.

int org::xmlBlaster::util::qos::MsgQosData::getRedeliver (  ) 

Returns > 0 if the message probably is redelivered.

Returns:
== 0 The message is guaranteed to be delivered only once.

Definition at line 224 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::UpdateQos::getRedeliver().

void org::xmlBlaster::util::qos::MsgQosData::setQueueSize ( long  queueSize  ) 

Parameters:
queueSize The number of queued messages

Definition at line 232 of file MsgQosData.cpp.

long org::xmlBlaster::util::qos::MsgQosData::getQueueSize (  ) 

Returns:
The number of queued messages

Definition at line 240 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::UpdateQos::getQueueSize().

void org::xmlBlaster::util::qos::MsgQosData::setQueueIndex ( long  queueIndex  ) 

Parameters:
queueIndex The index of the message in the queue

Definition at line 248 of file MsgQosData.cpp.

long org::xmlBlaster::util::qos::MsgQosData::getQueueIndex (  ) 

Returns:
The index of the message in the queue

Definition at line 256 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::UpdateQos::getQueueIndex().

long org::xmlBlaster::util::qos::MsgQosData::getLifeTime (  ) 

The life time of the message or -1L if forever.

Definition at line 264 of file MsgQosData.cpp.

Referenced by getRemainingLife(), and isVolatile().

void org::xmlBlaster::util::qos::MsgQosData::setLifeTime ( long  lifeTime  ) 

The life time of the message or -1L if forever.

Definition at line 272 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::PublishQos::setLifeTime(), and setVolatile().

long org::xmlBlaster::util::qos::MsgQosData::getRemainingLife (  ) 

Returns:
Milliseconds until message expiration (from now) or -1L if forever if 0L the message is expired

Definition at line 281 of file MsgQosData.cpp.

References org::xmlBlaster::util::TimestampFactory::getInstance, getLifeTime(), org::xmlBlaster::util::qos::QosData::getRcvTimestamp(), and org::xmlBlaster::util::TimestampFactory::getTimestamp().

Referenced by isExpired().

long org::xmlBlaster::util::qos::MsgQosData::getRemainingLifeStatic (  ) 

This is the value delivered in the QoS (as it was calculated by the server on sending) and is NOT dynamically recalculated.

So trust this value only if your client clock is out of date (or not trusted) and if you know the message sending latency is not too big.

Returns:
Milliseconds until message expiration (from now) or -1L if forever if 0L the message is expired

Definition at line 300 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::GetReturnQos::getRemainingLifeStatic().

void org::xmlBlaster::util::qos::MsgQosData::setRemainingLifeStatic ( long  remainingLifeStatic  ) 

Definition at line 305 of file MsgQosData.cpp.

Referenced by setVolatile().

bool org::xmlBlaster::util::qos::MsgQosData::isExpired (  ) 

Calculates if we are expired.

Definition at line 313 of file MsgQosData.cpp.

References getRemainingLife().

long org::xmlBlaster::util::qos::MsgQosData::getMaxLifeTime (  ) 

The server default for max.

span of life, adjustable with property "message.maxLifeTime"

Returns:
max span of life for a message

Definition at line 330 of file MsgQosData.cpp.

std::string org::xmlBlaster::util::qos::MsgQosData::getXmlRcvTimestamp (  ) 

Tagged form of message receive, e.g.

:
<rcvTimestamp nanos='1007764305862000004'/>

See also:
org.xmlBlaster.util.Timestamp

void org::xmlBlaster::util::qos::MsgQosData::touchRcvTimestamp (  ) 

Set timestamp to current time.

Reimplemented from org::xmlBlaster::util::qos::QosData.

vector< Destination > org::xmlBlaster::util::qos::MsgQosData::getDestinations (  ) 

Get all the destinations of this message.

This should only be used with PTP style messaging
Check if (isPtp()) ... before calling this method

Returns:
a valid ArrayList containing 0 - n std::strings with destination names (loginName of clients)
null if Publish/Subscribe style is used

Definition at line 343 of file MsgQosData.cpp.

References destinationList_.

void org::xmlBlaster::util::qos::MsgQosData::addDestination ( Destination destination  ) 

Add a destination.

The destination is copied into a list - your instance can be savly disappear

Definition at line 351 of file MsgQosData.cpp.

References destinationList_.

Referenced by org::xmlBlaster::client::qos::PublishQos::addDestination().

virtual std::string org::xmlBlaster::util::qos::MsgQosData::toXml ( bool  clearText,
std::string &  extraOffset = "" 
) [virtual]

Dump state of this object into a XML ASCII std::string.


Parameters:
clearText Dump base64 clientProperties encoded as plain text
extraOffset indenting of tags for nice output
Returns:
internal state of the message QoS as a XML ASCII std::string

Referenced by org::xmlBlaster::client::qos::PublishQos::toXml().

virtual std::string org::xmlBlaster::util::qos::MsgQosData::toXml ( std::string &  extraOffset = ""  )  [virtual]

Dump state of this object into a XML ASCII std::string.


Needs to be implemented by derived classes.

Parameters:
extraOffset indenting of tags for nice output
Returns:
internal state of the message QoS as a XML ASCII std::string

Reimplemented from org::xmlBlaster::util::qos::QosData.

MsgQosData * org::xmlBlaster::util::qos::MsgQosData::getClone (  )  [virtual]

Allocate a clone, the derived classes need to implement this method.

Returns:
The caller needs to free it with 'delete'.

Reimplemented from org::xmlBlaster::util::qos::QosData.

Definition at line 440 of file MsgQosData.cpp.

References MsgQosData().

void org::xmlBlaster::util::qos::MsgQosData::setTopicProperty ( org::xmlBlaster::util::qos::TopicProperty prop  ) 

Definition at line 445 of file MsgQosData.cpp.

Referenced by org::xmlBlaster::client::qos::PublishQos::setTopicProperty().

TopicProperty org::xmlBlaster::util::qos::MsgQosData::getTopicProperty (  ) 

Definition at line 454 of file MsgQosData.cpp.

References org::xmlBlaster::util::qos::QosData::global_.

bool org::xmlBlaster::util::qos::MsgQosData::hasTopicProperty (  ) 

Definition at line 461 of file MsgQosData.cpp.

void org::xmlBlaster::util::qos::MsgQosData::setForceDestroy ( bool  forceDestroy  ) 

Control message life cycle on message expiry.

Parameters:
forceDestroy true Force message destroy on message expire
false On message expiry messages which are already in callback queues are delivered.
See also:
The engine.qos.publish.isVolatile requirement

Definition at line 472 of file MsgQosData.cpp.

References org::xmlBlaster::util::CREATED_BY_SETTER, and org::xmlBlaster::util::Prop< T >::setValue().

Referenced by org::xmlBlaster::client::qos::PublishQos::setForceDestroy(), and setVolatile().

bool org::xmlBlaster::util::qos::MsgQosData::isForceDestroy (  ) 

Definition at line 467 of file MsgQosData.cpp.

References org::xmlBlaster::util::Prop< T >::getValue().

Referenced by isVolatile().


Member Data Documentation

std::vector<Destination> org::xmlBlaster::util::qos::MsgQosData::destinationList_ [protected]

ArrayList for loginQoS, holding all destination addresses (Destination objects).

Definition at line 104 of file MsgQosData.h.

Referenced by addDestination(), getDestinations(), isPtp(), and operator=().

bool org::xmlBlaster::util::qos::MsgQosData::receiveTimestampHumanReadable_ [protected]

Definition at line 108 of file MsgQosData.h.

Referenced by copy().


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