class safmq::QueueMessage

A class representing a message in a message queue.

Child Classes

A class representing a message in a message queue. This class is used to transport data to and from the message queue server by interacting with a safmq::MessageQueue or safmq::MQConnection.

An example of how to use a queue message:


safmq::MessageQueue	*que = safmq::MQFactory::BuildQueueConnection("safmq://myserver/myqueue","myname","mypassword");
safmq::QueueMessage	msg;

msg.setLabel("My Label");
msg.setBodyType(safmq::BT_TEXT);

std::ostream*	o = msg.getBufferStream();
*o << "Hello World";

que->Enqueue(msg);

delete que;

Friends:
class QStorage
class ServiceThread
class MQConnection
class SystemConnection
class EnqueueCmd
class RetrieveCmd
class RetrieveIDCmd
class PeekIDCmd
class PeekFrontCmd
class PeekCursorCmd
class RetrieveCursorCmd
std::ostream& operator<<(std::ostream& o, const struct ENQUEUE_PARAMS& params)
std::istream& operator>>(std::istream& i, struct ENQUEUE_PARAMS& params)
See Also:
safmq::MessageQueue
safmq::MQConnection

This class has no child classes.

Public Methods

[more] QueueMessage()
Constructs the queue message
[more]size_t getBodySize() const
Provides the size of the message body
[more]BodyTypeEnum getBodyType() const
Provides the body type hint
[more]size_t getBufferSize() const
Provides the nubmer of bytes in the buffer
[more]const bufstream* getBufferStream() const
Provides the message's buffer in constant form
[more]bufstream* getBufferStream()
Provides stream access to the buffer for this message
[more]std::string getLabel() const
Gets the label of the message
[more]MessageClassEnum getMessageClass() const
Provides the message's message class
[more]uuid getMessageID() const
Provides the message's id, set after being enqueued on a message queue server
[more]MessagePriorityEnum getMessagePriority() const
Provies the message's priority
[more]uuid getReciptID() const
Provides the message's recipt id.
[more]void getResponseQueueName(std::string& rq) const
Provides the name of the queue which responses should be sent to
[more]bool getTTLErrorWanted()
Provides the flag indicating a message should be auto responded to incase of a TTL error
[more]time_t getTimeStamp()
Provides the timestamp of the message
[more]SAFMQ_INT32 getTimeToLiveSeconds() const
Provides the time to live for the message once it has been enqueued
[more]void resetReceivedBuffer()
Resets the receive buffer so the message can be re-enqueued
[more]void setBodyType(BodyTypeEnum bt)
Sets a hint twords the type of data in this message's body
[more]void setLabel(const std::string& label)
Sets the label of the message
[more]void setMessagePriority(MessagePriorityEnum priority)
Sets the message's priority
[more]void setReciptID(const uuid& id)
Sets the message's recipt id.
[more]void setResponseQueueName(const std::string& url)
Sets the name of the queue which responses should be sent to
[more]void setTTLErrorWanted(bool ttlwanted)
Flags a message should be auto responded to incase of a TTL error
[more]void setTimeToLiveSeconds(SAFMQ_INT32 sec)
Sets the time to live for the message once it has been enqueued

Member Documentation


QueueMessage ()
Constructs the queue message


uuid getMessageID () const
Provides the message's id, set after being enqueued on a message queue server


MessageClassEnum getMessageClass () const
Provides the message's message class


void setMessagePriority (MessagePriorityEnum priority)
Sets the message's priority
Parameters:
priority - [in] The priority of the message


MessagePriorityEnum getMessagePriority () const
Provies the message's priority
Returns:
The priority of the message


void setLabel (const std::string& label)
Sets the label of the message
Parameters:
label - [in] The new label for the message


std::string getLabel () const
Gets the label of the message
Returns:
s the label of the message


time_t getTimeStamp ()
Provides the timestamp of the message
Returns:
The message's timestamp


void setTimeToLiveSeconds (SAFMQ_INT32 sec)
Sets the time to live for the message once it has been enqueued
Parameters:
sec - [in] The number of seconds the message is to remain in a message queue


SAFMQ_INT32 getTimeToLiveSeconds () const
Provides the time to live for the message once it has been enqueued
Parameters:
The - number of seconds the message is to remain in a message queue


void setTTLErrorWanted (bool ttlwanted)
Flags a message should be auto responded to incase of a TTL error
Parameters:
ttlwanted - [in] Indicates the message should be auto responded to in case of a TTL error


bool getTTLErrorWanted ()
Provides the flag indicating a message should be auto responded to incase of a TTL error
Returns:
the flag indicating a message should be auto responded to incase of a TTL error


void setResponseQueueName (const std::string& url)
Sets the name of the queue which responses should be sent to
Parameters:
url - [in] The URL of the response queue.


void getResponseQueueName (std::string& rq) const
Provides the name of the queue which responses should be sent to
Returns:
The URL of the response queue.


void setReciptID (const uuid& id)
Sets the message's recipt id. Messages may be searched for by their recipt id.
Parameters:
id - [in] The recipt id to be assigned to this message.


uuid getReciptID () const
Provides the message's recipt id. Messages may be searched for by their recipt id.
Returns:
recipt id assigned to this message.


void setBodyType (BodyTypeEnum bt)
Sets a hint twords the type of data in this message's body
Parameters:
bt - [in] A hint at the type of data in this message


BodyTypeEnum getBodyType () const
Provides the body type hint
Returns:
the body type hind


bufstream* getBufferStream ()
Provides stream access to the buffer for this message
Returns:
The message's buffer stream


const bufstream* getBufferStream () const
Provides the message's buffer in constant form
Returns:
A const reference to the buffer.


size_t getBufferSize () const
Provides the nubmer of bytes in the buffer
Returns:
The size of the buffer


size_t getBodySize () const
Provides the size of the message body
Returns:
The nubmer of bytes in the body


void resetReceivedBuffer ()
Resets the receive buffer so the message can be re-enqueued

Table of Contents HTML hierarchy of classes or Java


Safmq Documentation, copyright (c) 2004-2010 Matthew J. Battey, Licensed Under Apache License Ver 2.0
Powered By: Get SAFMQ: Store and Forward Message Queue at SourceForge.net. Fast, secure and Free Open Source software downloads