Packagecom.kaazing.gateway.jms.client
Interfacepublic interface MapMessage extends Message

A MapMessage object is used to send a set of name-value pairs. The names are String objects, and the values are data of following data types - . 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.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to MapMessage.setInt("foo", 6) is equivalent to MapMessage.setObject("foo", new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

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. If clearBody is called, the message can now be both read from and written to.

MapMessage objects support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String-to-primitive conversions may throw a runtime exception 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
  |----------------------------------------------------------------------
  

Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value. Since char does not support a String conversion, attempting to read a null value as a char must throw a NullPointerException.

See also



Public Properties
 PropertyDefined by
 InheritedcorrelationId : String
Gets the correlation ID for the message.
Message
 InheriteddeliveryMode : int
Gets the DeliveryMode value specified for this message.
Message
 Inheriteddestination : Destination
Gets the Destination object for this message.
Message
 Inheritedexpiration : Number
Gets the message's expiration value.
Message
 InheritedmessageId : String
Gets the message ID.
Message
 Inheritedpriority : int
Gets the message priority level.
Message
 Inheritedredelivered : Boolean
Gets an indication of whether this message is being redelivered.
Message
 InheritedreplyTo : Destination
Gets the Destination object to which a reply to this message should be sent.
Message
 Inheritedtimestamp : Number
Gets the message timestamp.
Message
 Inheritedtype : String
Gets the message type identifier supplied by the client when the message was sent.
Message
Public Methods
 MethodDefined by
 Inherited
acknowledge():void
Acknowledges all consumed messages of the session of this consumed message.
Message
 Inherited
clearBody():void
Clears out the message body.
Message
 Inherited
Clears a message's properties.
Message
  
getBoolean(name:String):Boolean
Returns the boolean value with the specified name.
MapMessage
 Inherited
getBooleanProperty(name:String):Boolean
Returns the value of the boolean property with the specified name.
Message
  
getByte(name:String):int
Returns the 8-bit integer value with the specified name.
MapMessage
 Inherited
getByteProperty(name:String):int
Returns the value of the byte property with the specified name.
Message
  
getBytes(name:String):ByteArray
Returns the ByteArray value with the specified name.
MapMessage
  
getChar(name:String):String
Returns the String representing Unicode character value with the specified name.
MapMessage
  
getDouble(name:String):Number
Returns the Number value with the specified name.
MapMessage
 Inherited
getDoubleProperty(name:String):Number
Returns the value of the double property with the specified name.
Message
  
getFloat(name:String):Number
Returns the Number value with the specified name.
MapMessage
 Inherited
getFloatProperty(name:String):Number
Returns the value of the float property with the specified name.
Message
  
getInt(name:String):int
Returns the int value with the specified name.
MapMessage
 Inherited
getIntProperty(name:String):int
Returns the value of the int property with the specified name.
Message
  
getLong(name:String):Number
Returns the Number value with the specified name.
MapMessage
 Inherited
getLongProperty(name:String):Number
Returns the value of the long property with the specified name.
Message
  
getMapNames():Array
Returns an Array of all the names in the MapMessage object.
MapMessage
  
getObject(name:String):Object
Returns the value of the object with the specified name.
MapMessage
 Inherited
getObjectProperty(name:String):Object
Returns the value of the object property with the specified name.
Message
 Inherited
Returns an Enumeration of all the property names.
Message
  
getShort(name:String):int
Returns the 16-bit int value with the specified name.
MapMessage
 Inherited
getShortProperty(name:String):int
Returns the value of the short property with the specified name.
Message
  
getString(name:String):String
Returns the String value with the specified name.
MapMessage
 Inherited
getStringProperty(name:String):String
Returns the value of the String property with the specified name.
Message
  
itemExists(name:String):Boolean
Indicates whether an item exists in this MapMessage object.
MapMessage
 Inherited
propertyExists(name:String):Boolean
Indicates whether a property value exists.
Message
  
setBoolean(name:String, value:Boolean):void
Sets a boolean value with the specified name into the Map.
MapMessage
 Inherited
setBooleanProperty(name:String, value:Boolean):void
Sets a boolean property value with the specified name into the message.
Message
  
setByte(name:String, value:int):void
Sets a 8-bit int value with the specified name into the Map.
MapMessage
 Inherited
setByteProperty(name:String, value:int):void
Sets a byte property value with the specified name into the message.
Message
  
setBytes(name:String, value:ByteArray, offset:int = 0, length:int = 0):void
Sets a portion of the byte array value with the specified name into the Map.
MapMessage
  
setChar(name:String, value:String):void
Sets Unicode character value with the specified name into the Map.
MapMessage
  
setDouble(name:String, value:Number):void
Sets a Number as double value with the specified name into the Map.
MapMessage
 Inherited
setDoubleProperty(name:String, value:Number):void
Sets a double property value with the specified name into the message.
Message
  
setFloat(name:String, value:Number):void
Sets a Number as float value with the specified name into the Map.
MapMessage
 Inherited
setFloatProperty(name:String, value:Number):void
Sets a float property value with the specified name into the message.
Message
  
setInt(name:String, value:int):void
Sets an int value with the specified name into the Map.
MapMessage
 Inherited
setIntProperty(name:String, value:int):void
Sets an int property value with the specified name into the message.
Message
  
setLong(name:String, value:Number):void
Sets a long value with the specified name into the Map.
MapMessage
 Inherited
setLongProperty(name:String, value:Number):void
Sets a long property value with the specified name into the message.
Message
  
setObject(name:String, value:Object):void
Sets an object value with the specified name into the Map.
MapMessage
 Inherited
setObjectProperty(name:String, value:Object):void
Sets a object property value with the specified name into the message.
Message
  
setShort(name:String, value:int):void
Sets a 16-bit int value with the specified name into the Map.
MapMessage
 Inherited
setShortProperty(name:String, value:int):void
Sets a short property value with the specified name into the message.
Message
  
setString(name:String, value:String):void
Sets a String value with the specified name into the Map.
MapMessage
 Inherited
setStringProperty(name:String, value:String):void
Sets a String property value with the specified name into the message.
Message
Method detail
getBoolean()method
public function getBoolean(name:String):Boolean

Returns the boolean value with the specified name.

Parameters
name:String — the name of the boolean

Returns
Boolean — the boolean value with the specified name
getByte()method 
public function getByte(name:String):int

Returns the 8-bit integer value with the specified name.

Parameters
name:String — the name of the value

Returns
int — the 8-bit int value with the specified name
getBytes()method 
public function getBytes(name:String):ByteArray

Returns the ByteArray value with the specified name.

Parameters
name:String — the name of the byte array

Returns
ByteArray — a copy of the byte array value with the specified name; if there is no item by this name, a null value is returned.
getChar()method 
public function getChar(name:String):String

Returns the String representing Unicode character value with the specified name.

Parameters
name:String — the name of the Unicode character

Returns
String — the Unicode character value with the specified name
getDouble()method 
public function getDouble(name:String):Number

Returns the Number value with the specified name.

Parameters
name:String — the name of the double value

Returns
Number — the Number value with the specified name
getFloat()method 
public function getFloat(name:String):Number

Returns the Number value with the specified name.

Parameters
name:String — the name of the float value

Returns
Number — the Number value with the specified name
getInt()method 
public function getInt(name:String):int

Returns the int value with the specified name.

Parameters
name:String — the name of the int

Returns
int — the int value with the specified name
getLong()method 
public function getLong(name:String):Number

Returns the Number value with the specified name.

Parameters
name:String — the name of the long value

Returns
Number — the Number value with the specified name
getMapNames()method 
public function getMapNames():Array

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

Returns
Array — an enumeration of all the names in this MapMessage
getObject()method 
public function getObject(name:String):Object

Returns the value of the object with the specified name.

This method can be used to return, in objectified format, an object in the Action Script language that had been stored in the Map with the equivalent setObject method call, or its equivalent primitive settype method.

Note that bytes are returned as ByteArray

Note that float/double/long value is returned as Number

Note that short/byte value is returned as int

Parameters
name:String — the name of the object

Returns
Object — Object with the specified name.
getShort()method 
public function getShort(name:String):int

Returns the 16-bit int value with the specified name.

Parameters
name:String — the name of the short

Returns
int — the short value with the specified name
getString()method 
public function getString(name:String):String

Returns the String value with the specified name.

Parameters
name:String — the name of the String

Returns
String — the String value with the specified name; if there is no item by this name, a null value is returned
itemExists()method 
public function itemExists(name:String):Boolean

Indicates whether an item exists in this MapMessage object.

Parameters
name:String — the name of the item to test

Returns
Boolean — true if the item exists
setBoolean()method 
public function setBoolean(name:String, value:Boolean):void

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

Parameters
name:String — the name of the boolean
 
value:Boolean — the boolean value to set in the Map
setByte()method 
public function setByte(name:String, value:int):void

Sets a 8-bit int value with the specified name into the Map.

Parameters
name:String — the name of the byte
 
value:int — the 8-bit int value to set in the Map
setBytes()method 
public function setBytes(name:String, value:ByteArray, offset:int = 0, length:int = 0):void

Sets a portion of the byte array value with the specified name into the Map.

Parameters
name:String — the name of the byte array
 
value:ByteArray — the byte array value to set in the Map
 
offset:int (default = 0) — the initial offset within the byte array
 
length:int (default = 0) — the number of bytes to use
setChar()method 
public function setChar(name:String, value:String):void

Sets Unicode character value with the specified name into the Map.

Parameters
name:String — the name of the Unicode character
 
value:String — the Unicode character value to set in the Map
setDouble()method 
public function setDouble(name:String, value:Number):void

Sets a Number as double value with the specified name into the Map.

Parameters
name:String — the name of the double value
 
value:Number — the double value to set in the Map
setFloat()method 
public function setFloat(name:String, value:Number):void

Sets a Number as float value with the specified name into the Map.

Parameters
name:String — the name of the float value
 
value:Number — the float value to set in the Map
setInt()method 
public function setInt(name:String, value:int):void

Sets an int value with the specified name into the Map.

Parameters
name:String — the name of the int
 
value:int — the int value to set in the Map
setLong()method 
public function setLong(name:String, value:Number):void

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

Note that actionscript does not support 64 bit integer. The maximum integer value supported is 53 bits long as a Number

Parameters
name:String — the name of the long value
 
value:Number — the long value value to set in the Map
setObject()method 
public function setObject(name:String, value:Object):void

Sets an object value with the specified name into the Map. (Not supported.)

This method works only for the object types String, Boolean, and Byte Array

Parameters
name:String — the name of the Java object
 
value:Object — the Java object value to set in the Map
setShort()method 
public function setShort(name:String, value:int):void

Sets a 16-bit int value with the specified name into the Map.

Parameters
name:String — the name of the short
 
value:int — the 16-bit int value to set in the Map
setString()method 
public function setString(name:String, value:String):void

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

Parameters
name:String — the name of the String
 
value:String — the String value to set in the Map