org::xmlBlaster::client::qos::PublishQos Class Reference

Collaboration diagram for org::xmlBlaster::client::qos::PublishQos:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PublishQos (org::xmlBlaster::util::Global &global)
 Default constructor for transient messages.
 PublishQos (org::xmlBlaster::util::Global &global, org::xmlBlaster::util::Destination &destination)
 Default constructor for transient PtP messages.
 PublishQos (org::xmlBlaster::util::Global &global, bool persistent)
 
Parameters:
persistent true = store the message persistently

org::xmlBlaster::util::qos::MsgQosDatagetData ()
 Returns the immutable internal data holder.
org::xmlBlaster::util::PriorityEnum getPriority ()
 Message priority.
void setPriority (org::xmlBlaster::util::PriorityEnum priority)
 Set message priority value, PriorityEnum::NORM_PRIORITY (5) is default.
void setForceUpdate (bool force)
 Send message to subscriber even if the content is the same as the previous?
Default is that xmlBlaster does send messages to subscribed clients, even the content didn't change.
void setForceDestroy (bool forceDestroy)
 Control message life cycle on message expiry.
void setSubscribable (bool isSubcribeable)
 As a default setting you can subscribe on all messages (PtP or PubSub).
void setReadonly (bool readonly)
 Mark a message to be readonly.
void setVolatile (bool volatileFlag)
 Mark a message to be volatile or not.
bool isVolatile ()
 
See also:
isVolatile()

void setPersistent (bool persistent)
 Mark a message to be persistent.
void setLifeTime (long lifeTime)
 The message expires after given milliseconds (message is erased).
void addDestination (org::xmlBlaster::util::Destination &destination)
 Add a destination where to send the message.
org::xmlBlaster::util::SessionNameRef getSender ()
 Access sender name.
void setState (std::string &state)
 
Parameters:
state The state to return to the server.

std::string getState ()
void setStateInfo (std::string &stateInfo)
 
Parameters:
stateInfo The state info attribute to return to the server.

std::string getStateInfo ()
void setTopicProperty (org::xmlBlaster::util::qos::TopicProperty &topicProperty)
 Administer/configure the message topic.
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.
void setClientProperties (org::xmlBlaster::util::qos::QosData::ClientPropertyMap &cm)
 Set all clientProperties at once, overwrites all existing.
org::xmlBlaster::util::qos::QosData::ClientPropertyMapgetClientProperties ()
 Get a map containing all send client properties.
std::string toString ()
 Converts the data into a valid XML ASCII string.
std::string toXml ()
 Converts the data into a valid XML ASCII string.

Detailed Description

Definition at line 53 of file PublishQos.h.


Constructor & Destructor Documentation

org::xmlBlaster::client::qos::PublishQos::PublishQos ( org::xmlBlaster::util::Global global  ) 

Default constructor for transient messages.

Definition at line 16 of file PublishQos.cpp.

org::xmlBlaster::client::qos::PublishQos::PublishQos ( org::xmlBlaster::util::Global global,
org::xmlBlaster::util::Destination destination 
)

Default constructor for transient PtP messages.

To make the message persistent, use the setPersistent(true) method

Parameters:
destination The object containing the destination address.
To add more destinations, us the addDestination() method.

Definition at line 23 of file PublishQos.cpp.

References addDestination().

org::xmlBlaster::client::qos::PublishQos::PublishQos ( org::xmlBlaster::util::Global global,
bool  persistent 
)

Parameters:
persistent true = store the message persistently

Definition at line 29 of file PublishQos.cpp.

References setPersistent().


Member Function Documentation

MsgQosData & org::xmlBlaster::client::qos::PublishQos::getData (  ) 

Returns the immutable internal data holder.

Definition at line 35 of file PublishQos.cpp.

PriorityEnum org::xmlBlaster::client::qos::PublishQos::getPriority (  ) 

Message priority.

Returns:
priority 0 (=Lowest) - 9 (=Highest)

Definition at line 40 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::getPriority().

void org::xmlBlaster::client::qos::PublishQos::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.

See also:
The engine.qos.publish.priority requirement

Definition at line 51 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::setPriority().

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::setForceUpdate ( bool  force  ) 

Send message to subscriber even if the content is the same as the previous?
Default is that xmlBlaster does send messages to subscribed clients, even the content didn't change.

See also:
The engine.qos.publish.forceUpdate requirement

Definition at line 61 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setForceUpdate().

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::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 71 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setForceDestroy().

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::setSubscribable ( bool  isSubcribeable  ) 

As a default setting you can subscribe on all messages (PtP or PubSub).

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 76 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setSubscribable().

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::setReadonly ( bool  readonly  ) 

Mark a message to be readonly.


Only the first publish() will be accepted, followers are denied.

Definition at line 86 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setReadonly().

void org::xmlBlaster::client::qos::PublishQos::setVolatile ( bool  volatileFlag  ) 

Mark a message to be volatile or not.


A non-volatile messages stays in memory as long as the server runs
A volatile messages exists only during publish and processing it (doing the updates).
Defaults to false.

Definition at line 98 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setVolatile().

bool org::xmlBlaster::client::qos::PublishQos::isVolatile (  ) 

See also:
isVolatile()

Definition at line 106 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::isVolatile().

void org::xmlBlaster::client::qos::PublishQos::setPersistent ( bool  persistent  ) 

Mark a message to be persistent.

Definition at line 114 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::setPersistent().

Referenced by PublishDemo::publish(), and PublishQos().

void org::xmlBlaster::client::qos::PublishQos::setLifeTime ( long  lifeTime  ) 

The message expires after given milliseconds (message is erased).

Clients will get a notify about expiration.
This value is calculated relative to the rcvTimestamp in the xmlBlaster server.
Passing -1 milliseconds asks the server for unlimited livespan, which the server may or may not grant.

Parameters:
lifeTime in milliseconds

Definition at line 127 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setLifeTime().

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::addDestination ( org::xmlBlaster::util::Destination destination  ) 

Add a destination where to send the message.

Note you can invoke this multiple times to send to multiple destinations.

Parameters:
destination The loginName of a receiver or some destination XPath query

Definition at line 138 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::addDestination().

Referenced by PublishDemo::publish(), and PublishQos().

SessionNameRef org::xmlBlaster::client::qos::PublishQos::getSender (  ) 

Access sender name.

Returns:
loginName of sender or null if not known

Definition at line 147 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::getSender().

void org::xmlBlaster::client::qos::PublishQos::setState ( std::string &  state  ) 

Parameters:
state The state to return to the server.

e.g. Contants.STATE_OK, see Constants::java

string org::xmlBlaster::client::qos::PublishQos::getState (  ) 

Definition at line 168 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::getState().

void org::xmlBlaster::client::qos::PublishQos::setStateInfo ( std::string &  stateInfo  ) 

Parameters:
stateInfo The state info attribute to return to the server.

string org::xmlBlaster::client::qos::PublishQos::getStateInfo (  ) 

Definition at line 181 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::getStateInfo().

void org::xmlBlaster::client::qos::PublishQos::setTopicProperty ( org::xmlBlaster::util::qos::TopicProperty topicProperty  ) 

Administer/configure the message topic.

Definition at line 189 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::setTopicProperty().

Referenced by PublishDemo::publish().

template<typename T_VALUE>
void org::xmlBlaster::client::qos::PublishQos::addClientProperty ( std::string &  name,
T_VALUE &  value,
std::string &  type = "",
std::string &  encoding = "",
std::string &  charset = "" 
)

Add a client property key and value.

A typical example is:

 publishQos.addClientProperty("myKey", "myValue");
 
If you want to send a string in your own locale character set:
 publishQos.addClientProperty("myKey", "myValue", Constants::TYPE_STRING, Constants::ENCODING_BASE64, "windows-1252");
 
Parameters:
name The unique property key in US-ASCII encoding (7-bit), UTF-8 should work as well A duplicate key will overwrite the old setting
value Your data . The type (like "float") is guessed from T_VALUE NOTE: "vector<unsigned char>" "unsigned char*" are treated as BLOBs and will be transferred Base64 encoded.
type The data type of the value, optional, e.g. Constants::TYPE_FLOAT ("float")
encoding How the data is transferred, org::xmlBlaster::util::Constants::ENCODING_BASE64 or ""
charset XmlBlaster expects all XML strings as UTF-8, however you can send your client properties in any other charset but you must then encode it with ENCODING_BASE64 and pass the charset used, for example "windows-1252". Please use the official IANA charset names.
See also:
http://www.iana.org/assignments/charset-reg/

ClientProperty::ClientProperty

Definition at line 222 of file PublishQos.h.

Referenced by PublishDemo::publish().

void org::xmlBlaster::client::qos::PublishQos::setClientProperties ( org::xmlBlaster::util::qos::QosData::ClientPropertyMap cm  ) 

Set all clientProperties at once, overwrites all existing.

Parameters:
cm The new properties

Referenced by PublishDemo::publish().

QosData::ClientPropertyMap & org::xmlBlaster::client::qos::PublishQos::getClientProperties (  ) 

Get a map containing all send client properties.

Definition at line 199 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::QosData::getClientProperties().

string org::xmlBlaster::client::qos::PublishQos::toString (  ) 

Converts the data into a valid XML ASCII string.

Returns:
An XML ASCII std::string

Definition at line 208 of file PublishQos.cpp.

References toXml().

string org::xmlBlaster::client::qos::PublishQos::toXml (  ) 

Converts the data into a valid XML ASCII string.

Returns:
An XML ASCII std::string

Definition at line 217 of file PublishQos.cpp.

References org::xmlBlaster::util::qos::MsgQosData::toXml().

Referenced by PublishDemo::publish(), and toString().


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