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) | ||||
| ||||
org::xmlBlaster::util::qos::MsgQosData & | getData () | |||
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 () | |||
| ||||
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) | |||
| ||||
std::string | getState () | |||
void | setStateInfo (std::string &stateInfo) | |||
| ||||
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::ClientPropertyMap & | getClientProperties () | |||
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. |
Definition at line 53 of file PublishQos.h.
org::xmlBlaster::client::qos::PublishQos::PublishQos | ( | org::xmlBlaster::util::Global & | global | ) |
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
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 | |||
) |
persistent | true = store the message persistently |
Definition at line 29 of file PublishQos.cpp.
References setPersistent().
MsgQosData & org::xmlBlaster::client::qos::PublishQos::getData | ( | ) |
PriorityEnum org::xmlBlaster::client::qos::PublishQos::getPriority | ( | ) |
Message priority.
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.
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.
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.
forceDestroy | true Force message destroy on message expire false On message expiry messages which are already in callback queues are delivered. |
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).
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 | ( | ) |
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.
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.
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.
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 | ) |
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 | ) |
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().
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");
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. |
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.
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.
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.
Definition at line 217 of file PublishQos.cpp.
References org::xmlBlaster::util::qos::MsgQosData::toXml().
Referenced by PublishDemo::publish(), and toString().