activemq-cpp-3.6.0
cms::MapMessage Class Reference

A MapMessage object is used to send a set of name-value pairs. More...

#include <src/main/cms/MapMessage.h>

Inheritance diagram for cms::MapMessage:

Public Member Functions

virtual ~MapMessage ()
virtual bool isEmpty () const =0
 Returns true if there are no values stored in the MapMessage body.
virtual std::vector< std::string > getMapNames () const =0
 Returns an Enumeration of all the names in the MapMessage object.
virtual bool itemExists (const std::string &name) const =0
 Indicates whether an item exists in this MapMessage object.
virtual ValueType getValueType (const std::string &key) const =0
 Returns the value type for the given key mapping.
virtual bool getBoolean (const std::string &name) const =0
 Returns the Boolean value of the Specified name.
virtual void setBoolean (const std::string &name, bool value)=0
 Sets a boolean value with the specified name into the Map.
virtual unsigned char getByte (const std::string &name) const =0
 Returns the Byte value of the Specified name.
virtual void setByte (const std::string &name, unsigned char value)=0
 Sets a Byte value with the specified name into the Map.
virtual std::vector< unsigned
char > 
getBytes (const std::string &name) const =0
 Returns the Bytes value of the Specified name.
virtual void setBytes (const std::string &name, const std::vector< unsigned char > &value)=0
 Sets a Bytes value with the specified name into the Map.
virtual char getChar (const std::string &name) const =0
 Returns the Char value of the Specified name.
virtual void setChar (const std::string &name, char value)=0
 Sets a Char value with the specified name into the Map.
virtual double getDouble (const std::string &name) const =0
 Returns the Double value of the Specified name.
virtual void setDouble (const std::string &name, double value)=0
 Sets a Double value with the specified name into the Map.
virtual float getFloat (const std::string &name) const =0
 Returns the Float value of the Specified name.
virtual void setFloat (const std::string &name, float value)=0
 Sets a Float value with the specified name into the Map.
virtual int getInt (const std::string &name) const =0
 Returns the Int value of the Specified name.
virtual void setInt (const std::string &name, int value)=0
 Sets a Int value with the specified name into the Map.
virtual long long getLong (const std::string &name) const =0
 Returns the Long value of the Specified name.
virtual void setLong (const std::string &name, long long value)=0
 Sets a Long value with the specified name into the Map.
virtual short getShort (const std::string &name) const =0
 Returns the Short value of the Specified name.
virtual void setShort (const std::string &name, short value)=0
 Sets a Short value with the specified name into the Map.
virtual std::string getString (const std::string &name) const =0
 Returns the String value of the Specified name.
virtual void setString (const std::string &name, const std::string &value)=0
 Sets a String value with the specified name into the Map.
- Public Member Functions inherited from cms::Message
virtual ~Message ()
virtual Messageclone () const =0
 Clone this message exactly, returns a new instance that the caller is required to delete.
virtual void acknowledge () const =0
 Acknowledges all consumed messages of the session of this consumed message.
virtual void clearBody ()=0
 Clears out the body of the message.
virtual void clearProperties ()=0
 Clears out the message body.
virtual std::vector< std::string > getPropertyNames () const =0
 Retrieves the property names.
virtual bool propertyExists (const std::string &name) const =0
 Indicates whether or not a given property exists.
virtual ValueType getPropertyValueType (const std::string &name) const =0
 Returns the value type for the given property key.
virtual bool getBooleanProperty (const std::string &name) const =0
 Gets a boolean property.
virtual unsigned char getByteProperty (const std::string &name) const =0
 Gets a byte property.
virtual double getDoubleProperty (const std::string &name) const =0
 Gets a double property.
virtual float getFloatProperty (const std::string &name) const =0
 Gets a float property.
virtual int getIntProperty (const std::string &name) const =0
 Gets a int property.
virtual long long getLongProperty (const std::string &name) const =0
 Gets a long property.
virtual short getShortProperty (const std::string &name) const =0
 Gets a short property.
virtual std::string getStringProperty (const std::string &name) const =0
 Gets a string property.
virtual void setBooleanProperty (const std::string &name, bool value)=0
 Sets a boolean property.
virtual void setByteProperty (const std::string &name, unsigned char value)=0
 Sets a byte property.
virtual void setDoubleProperty (const std::string &name, double value)=0
 Sets a double property.
virtual void setFloatProperty (const std::string &name, float value)=0
 Sets a float property.
virtual void setIntProperty (const std::string &name, int value)=0
 Sets a int property.
virtual void setLongProperty (const std::string &name, long long value)=0
 Sets a long property.
virtual void setShortProperty (const std::string &name, short value)=0
 Sets a short property.
virtual void setStringProperty (const std::string &name, const std::string &value)=0
 Sets a string property.
virtual std::string getCMSCorrelationID () const =0
 Gets the correlation ID for the message.
virtual void setCMSCorrelationID (const std::string &correlationId)=0
 Sets the correlation ID for the message.
virtual int getCMSDeliveryMode () const =0
 Gets the DeliveryMode for this message.
virtual void setCMSDeliveryMode (int mode)=0
 Sets the DeliveryMode for this message.
virtual const DestinationgetCMSDestination () const =0
 Gets the Destination object for this message.
virtual void setCMSDestination (const Destination *destination)=0
 Sets the Destination object for this message.
virtual long long getCMSExpiration () const =0
 Gets the message's expiration value.
virtual void setCMSExpiration (long long expireTime)=0
 Sets the message's expiration value.
virtual std::string getCMSMessageID () const =0
 The CMSMessageID header field contains a value that uniquely identifies each message sent by a provider.
virtual void setCMSMessageID (const std::string &id)=0
 Sets the message ID.
virtual int getCMSPriority () const =0
 Gets the message priority level.
virtual void setCMSPriority (int priority)=0
 Sets the Priority Value for this message.
virtual bool getCMSRedelivered () const =0
 Gets an indication of whether this message is being redelivered.
virtual void setCMSRedelivered (bool redelivered)=0
 Specifies whether this message is being redelivered.
virtual const cms::DestinationgetCMSReplyTo () const =0
 Gets the Destination object to which a reply to this message should be sent.
virtual void setCMSReplyTo (const cms::Destination *destination)=0
 Sets the Destination object to which a reply to this message should be sent.
virtual long long getCMSTimestamp () const =0
 Gets the message timestamp.
virtual void setCMSTimestamp (long long timeStamp)=0
 Sets the message timestamp.
virtual std::string getCMSType () const =0
 Gets the message type identifier supplied by the client when the message was sent.
virtual void setCMSType (const std::string &type)=0
 Sets the message type.

Additional Inherited Members

- Public Types inherited from cms::Message
enum  ValueType {
  NULL_TYPE = 0, BOOLEAN_TYPE = 1, BYTE_TYPE = 2, CHAR_TYPE = 3,
  SHORT_TYPE = 4, INTEGER_TYPE = 5, LONG_TYPE = 6, DOUBLE_TYPE = 7,
  FLOAT_TYPE = 8, STRING_TYPE = 9, BYTE_ARRAY_TYPE = 10, UNKNOWN_TYPE = 11
}
 Defines the Type Identifiers used to identify the type contained within a specific Message property or MapMessage keyed value. More...
- Static Public Attributes inherited from cms::Message
static const int DEFAULT_DELIVERY_MODE
 The Default delivery mode for Message Producers is PERSISTENT.
static const int DEFAULT_MSG_PRIORITY
 The Default priority assigned to a Message is 4.
static const long long DEFAULT_TIME_TO_LIVE
 The Default Time to Live for a Message Producer is unlimited, the message will never expire.

Detailed Description

A MapMessage object is used to send a set of name-value pairs.

The names are String objects, and the values are primitive data types in the Java programming language. The names must have a value that is not null, and not an empty string. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined. MapMessage inherits from the Message interface and adds a message body that contains a Map.

When a client receives a MapMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. To place the MapMessage back into a state where it can be read from and written to, call the clearBody method.

MapMessage objects support the following conversion table. The marked cases must be supported. The unmarked cases must throw a CMSException. The String-to-primitive conversions may throw a MessageFormatException if the primitive's valueOf() method does not accept it as a valid String representation of the primitive.

A value written as the row type can be read as the column type.

 |        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
 |boolean |    X                                            X
 |byte    |          X     X         X   X                  X
 |short   |                X         X   X                  X
 |char    |                     X                           X
 |int     |                          X   X                  X
 |long    |                              X                  X
 |float   |                                    X     X      X
 |double  |                                          X      X
 |String  |    X     X     X         X   X     X     X      X
 |byte[]  |                                                        X
 |----------------------------------------------------------------------
Since
1.0

Constructor & Destructor Documentation

virtual cms::MapMessage::~MapMessage ( )
virtual

Member Function Documentation

virtual bool cms::MapMessage::getBoolean ( const std::string &  name) const
pure virtual

Returns the Boolean value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual unsigned char cms::MapMessage::getByte ( const std::string &  name) const
pure virtual

Returns the Byte value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual std::vector<unsigned char> cms::MapMessage::getBytes ( const std::string &  name) const
pure virtual

Returns the Bytes value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual char cms::MapMessage::getChar ( const std::string &  name) const
pure virtual

Returns the Char value of the Specified name.

Parameters
namename of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual double cms::MapMessage::getDouble ( const std::string &  name) const
pure virtual

Returns the Double value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual float cms::MapMessage::getFloat ( const std::string &  name) const
pure virtual

Returns the Float value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual int cms::MapMessage::getInt ( const std::string &  name) const
pure virtual

Returns the Int value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual long long cms::MapMessage::getLong ( const std::string &  name) const
pure virtual

Returns the Long value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual std::vector<std::string> cms::MapMessage::getMapNames ( ) const
pure virtual

Returns an Enumeration of all the names in the MapMessage object.

Returns
STL Vector of String values, each of which is the name of an item in the MapMessage
Exceptions
CMSException- if the operation fails due to an internal error.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual short cms::MapMessage::getShort ( const std::string &  name) const
pure virtual

Returns the Short value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual std::string cms::MapMessage::getString ( const std::string &  name) const
pure virtual

Returns the String value of the Specified name.

Parameters
nameName of the value to fetch from the map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageFormatException- if this type conversion is invalid.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual ValueType cms::MapMessage::getValueType ( const std::string &  key) const
pure virtual

Returns the value type for the given key mapping.

The CMS provider should translate all internal type identifiers into the CMS Value types returning UNKNOWN_TYPE for any specialized types not directly supported in the CMS API.

Parameters
keyThe string key used to look up the value type mapping.
Returns
The ValueType contained in the given mapping.
Exceptions
CMSExceptionif no mapping exists that matches the requested key.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual bool cms::MapMessage::isEmpty ( ) const
pure virtual

Returns true if there are no values stored in the MapMessage body.

Returns
true if the body of the MapMessage contains no elements.
Exceptions
CMSExceptionif the operation fails due to an internal error.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual bool cms::MapMessage::itemExists ( const std::string &  name) const
pure virtual

Indicates whether an item exists in this MapMessage object.

Parameters
nameString name of the Object in question
Returns
boolean value indicating if the name is in the map
Exceptions
CMSException- if the operation fails due to an internal error.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setBoolean ( const std::string &  name,
bool  value 
)
pure virtual

Sets a boolean value with the specified name into the Map.

Parameters
namethe name of the boolean
valuethe boolean value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWritableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setByte ( const std::string &  name,
unsigned char  value 
)
pure virtual

Sets a Byte value with the specified name into the Map.

Parameters
namethe name of the Byte
valuethe Byte value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setBytes ( const std::string &  name,
const std::vector< unsigned char > &  value 
)
pure virtual

Sets a Bytes value with the specified name into the Map.

Parameters
nameThe name of the Bytes
valueThe Bytes value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setChar ( const std::string &  name,
char  value 
)
pure virtual

Sets a Char value with the specified name into the Map.

Parameters
namethe name of the Char
valuethe Char value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setDouble ( const std::string &  name,
double  value 
)
pure virtual

Sets a Double value with the specified name into the Map.

Parameters
nameThe name of the Double
valueThe Double value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setFloat ( const std::string &  name,
float  value 
)
pure virtual

Sets a Float value with the specified name into the Map.

Parameters
nameThe name of the Float
valueThe Float value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setInt ( const std::string &  name,
int  value 
)
pure virtual

Sets a Int value with the specified name into the Map.

Parameters
nameThe name of the Int
valueThe Int value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setLong ( const std::string &  name,
long long  value 
)
pure virtual

Sets a Long value with the specified name into the Map.

Parameters
nameThe name of the Long
valueThe Long value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setShort ( const std::string &  name,
short  value 
)
pure virtual

Sets a Short value with the specified name into the Map.

Parameters
nameThe name of the Short
valueThe Short value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.

virtual void cms::MapMessage::setString ( const std::string &  name,
const std::string &  value 
)
pure virtual

Sets a String value with the specified name into the Map.

Parameters
nameThe name of the String
valueThe String value to set in the Map
Exceptions
CMSException- if the operation fails due to an internal error.
MessageNotWriteableException- if the Message is in Read-only Mode.

Implemented in activemq::commands::ActiveMQMapMessage.


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