|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Message
A Message is a routable instance that has a payload.
The payload (the "body") is opaque to the messaging system.
A Message also has a fixed set of headers (required by the messaging system)
and properties (defined by the users) that can be used by the messaging system
to route the message (e.g. to ensure it matches a queue filter).
| | boolean byte short int long float double String byte[] |---------------------------------------------------------------- |boolean | X X |byte | X X X X X |short | X X 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 |-----------------------------------------------------------------
getFloatProperty
on a property set a boolean
),
a PropertyConversionException will be thrown.
Field Summary | |
---|---|
static byte |
BYTES_TYPE
|
static byte |
DEFAULT_TYPE
|
static org.hornetq.api.core.SimpleString |
HDR_ACTUAL_EXPIRY_TIME
|
static org.hornetq.api.core.SimpleString |
HDR_DUPLICATE_DETECTION_ID
|
static org.hornetq.api.core.SimpleString |
HDR_GROUP_ID
|
static org.hornetq.api.core.SimpleString |
HDR_LARGE_BODY_SIZE
|
static org.hornetq.api.core.SimpleString |
HDR_LARGE_COMPRESSED
|
static org.hornetq.api.core.SimpleString |
HDR_LAST_VALUE_NAME
|
static org.hornetq.api.core.SimpleString |
HDR_ORIG_MESSAGE_ID
|
static org.hornetq.api.core.SimpleString |
HDR_ORIGINAL_ADDRESS
|
static org.hornetq.api.core.SimpleString |
HDR_SCHEDULED_DELIVERY_TIME
|
static byte |
MAP_TYPE
|
static byte |
OBJECT_TYPE
|
static byte |
STREAM_TYPE
|
static byte |
TEXT_TYPE
|
Method Summary | |
---|---|
boolean |
containsProperty(org.hornetq.api.core.SimpleString key)
Returns true if this message contains a property with the given key, false else. |
boolean |
containsProperty(String key)
|
org.hornetq.api.core.SimpleString |
getAddress()
Returns the address this message is sent to. |
org.hornetq.api.core.HornetQBuffer |
getBodyBuffer()
Returns the message body as a HornetQBuffer |
org.hornetq.api.core.HornetQBuffer |
getBodyBufferCopy()
Returns a copy of the message body as a HornetQBuffer. |
Boolean |
getBooleanProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Boolean. |
Boolean |
getBooleanProperty(String key)
|
Byte |
getByteProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Byte. |
Byte |
getByteProperty(String key)
|
byte[] |
getBytesProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a byte[]. |
byte[] |
getBytesProperty(String key)
|
Double |
getDoubleProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Double. |
Double |
getDoubleProperty(String key)
|
int |
getEncodeSize()
Returns the size of the encoded message. |
long |
getExpiration()
Returns the expiration time of this message. |
Float |
getFloatProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Float. |
Float |
getFloatProperty(String key)
|
Integer |
getIntProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as an Integer. |
Integer |
getIntProperty(String key)
|
Long |
getLongProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Long. |
Long |
getLongProperty(String key)
|
long |
getMessageID()
Returns the messageID. |
Object |
getObjectProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key |
Object |
getObjectProperty(String key)
|
byte |
getPriority()
Returns the message priority. |
Set<org.hornetq.api.core.SimpleString> |
getPropertyNames()
Returns all the names of the properties for this message. |
Short |
getShortProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a Short. |
Short |
getShortProperty(String key)
|
org.hornetq.api.core.SimpleString |
getSimpleStringProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a SimpleString. |
org.hornetq.api.core.SimpleString |
getSimpleStringProperty(String key)
|
String |
getStringProperty(org.hornetq.api.core.SimpleString key)
Returns the property corresponding to the specified key as a String. |
String |
getStringProperty(String key)
|
long |
getTimestamp()
Returns the message timestamp. |
byte |
getType()
Returns this message type. |
org.hornetq.utils.UUID |
getUserID()
Returns the userID - this is an optional user specified UUID that can be set to identify the message and will be passed around with the message |
boolean |
isDurable()
Returns whether this message is durable or not. |
boolean |
isExpired()
Returns whether this message is expired or not. |
boolean |
isLargeMessage()
Returns whether this message is a large message or a regular message. |
void |
putBooleanProperty(org.hornetq.api.core.SimpleString key,
boolean value)
Puts a boolean property in this message. |
void |
putBooleanProperty(String key,
boolean value)
|
void |
putByteProperty(org.hornetq.api.core.SimpleString key,
byte value)
Puts a byte property in this message. |
void |
putByteProperty(String key,
byte value)
|
void |
putBytesProperty(org.hornetq.api.core.SimpleString key,
byte[] value)
Puts a byte[] property in this message. |
void |
putBytesProperty(String key,
byte[] value)
|
void |
putDoubleProperty(org.hornetq.api.core.SimpleString key,
double value)
Puts a double property in this message. |
void |
putDoubleProperty(String key,
double value)
|
void |
putFloatProperty(org.hornetq.api.core.SimpleString key,
float value)
Puts a float property in this message. |
void |
putFloatProperty(String key,
float value)
|
void |
putIntProperty(org.hornetq.api.core.SimpleString key,
int value)
Puts a int property in this message. |
void |
putIntProperty(String key,
int value)
|
void |
putLongProperty(org.hornetq.api.core.SimpleString key,
long value)
Puts a long property in this message. |
void |
putLongProperty(String key,
long value)
|
void |
putObjectProperty(org.hornetq.api.core.SimpleString key,
Object value)
Puts an Object property in this message. |
void |
putObjectProperty(String key,
Object value)
|
void |
putShortProperty(org.hornetq.api.core.SimpleString key,
short value)
Puts a short property in this message. |
void |
putShortProperty(String key,
short value)
|
void |
putStringProperty(org.hornetq.api.core.SimpleString key,
org.hornetq.api.core.SimpleString value)
Puts a SimpleString property in this message. |
void |
putStringProperty(String key,
String value)
Puts a String property in this message. |
Object |
removeProperty(org.hornetq.api.core.SimpleString key)
Removes the property corresponding to the specified key. |
Object |
removeProperty(String key)
|
void |
setAddress(org.hornetq.api.core.SimpleString address)
Sets the address to send this message to. |
void |
setDurable(boolean durable)
Sets whether this message is durable or not. |
void |
setExpiration(long expiration)
Sets the expiration of this message. |
void |
setPriority(byte priority)
Sets the message priority. |
void |
setTimestamp(long timestamp)
Sets the message timestamp. |
void |
setUserID(org.hornetq.utils.UUID userID)
Sets the user ID |
Map<String,Object> |
toMap()
|
Field Detail |
---|
static final org.hornetq.api.core.SimpleString HDR_ACTUAL_EXPIRY_TIME
static final org.hornetq.api.core.SimpleString HDR_ORIGINAL_ADDRESS
static final org.hornetq.api.core.SimpleString HDR_ORIG_MESSAGE_ID
static final org.hornetq.api.core.SimpleString HDR_GROUP_ID
static final org.hornetq.api.core.SimpleString HDR_LARGE_COMPRESSED
static final org.hornetq.api.core.SimpleString HDR_LARGE_BODY_SIZE
static final org.hornetq.api.core.SimpleString HDR_SCHEDULED_DELIVERY_TIME
static final org.hornetq.api.core.SimpleString HDR_DUPLICATE_DETECTION_ID
static final org.hornetq.api.core.SimpleString HDR_LAST_VALUE_NAME
static final byte DEFAULT_TYPE
static final byte OBJECT_TYPE
static final byte TEXT_TYPE
static final byte BYTES_TYPE
static final byte MAP_TYPE
static final byte STREAM_TYPE
Method Detail |
---|
long getMessageID()
org.hornetq.utils.UUID getUserID()
void setUserID(org.hornetq.utils.UUID userID)
userID
- org.hornetq.api.core.SimpleString getAddress()
void setAddress(org.hornetq.api.core.SimpleString address)
address
- address to send the message tobyte getType()
See fields *_TYPE for possible values.
boolean isDurable()
void setDurable(boolean durable)
durable
- true
to flag this message as durable, false
elselong getExpiration()
boolean isExpired()
void setExpiration(long expiration)
expiration
- expiration timelong getTimestamp()
void setTimestamp(long timestamp)
timestamp
- timestampbyte getPriority()
void setPriority(byte priority)
priority
- the new message priorityint getEncodeSize()
boolean isLargeMessage()
org.hornetq.api.core.HornetQBuffer getBodyBuffer()
org.hornetq.api.core.HornetQBuffer getBodyBufferCopy()
void putBooleanProperty(org.hornetq.api.core.SimpleString key, boolean value)
key
- property namevalue
- property valuevoid putBooleanProperty(String key, boolean value)
putBooleanProperty(SimpleString, boolean)
void putByteProperty(org.hornetq.api.core.SimpleString key, byte value)
key
- property namevalue
- property valuevoid putByteProperty(String key, byte value)
putByteProperty(SimpleString, byte)
void putBytesProperty(org.hornetq.api.core.SimpleString key, byte[] value)
key
- property namevalue
- property valuevoid putBytesProperty(String key, byte[] value)
putBytesProperty(SimpleString, byte[])
void putShortProperty(org.hornetq.api.core.SimpleString key, short value)
key
- property namevalue
- property valuevoid putShortProperty(String key, short value)
putShortProperty(SimpleString, short)
void putIntProperty(org.hornetq.api.core.SimpleString key, int value)
key
- property namevalue
- property valuevoid putIntProperty(String key, int value)
putIntProperty(SimpleString, int)
void putLongProperty(org.hornetq.api.core.SimpleString key, long value)
key
- property namevalue
- property valuevoid putLongProperty(String key, long value)
putLongProperty(SimpleString, long)
void putFloatProperty(org.hornetq.api.core.SimpleString key, float value)
key
- property namevalue
- property valuevoid putFloatProperty(String key, float value)
putFloatProperty(SimpleString, float)
void putDoubleProperty(org.hornetq.api.core.SimpleString key, double value)
key
- property namevalue
- property valuevoid putDoubleProperty(String key, double value)
putDoubleProperty(SimpleString, double)
void putStringProperty(org.hornetq.api.core.SimpleString key, org.hornetq.api.core.SimpleString value)
key
- property namevalue
- property valuevoid putStringProperty(String key, String value)
key
- property namevalue
- property valuevoid putObjectProperty(org.hornetq.api.core.SimpleString key, Object value) throws org.hornetq.api.core.HornetQPropertyConversionException
key
- property namevalue
- property value
HornetQPropertyConversionException
- if the value is not one of the accepted property types.void putObjectProperty(String key, Object value) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
putObjectProperty(SimpleString, Object)
Object removeProperty(org.hornetq.api.core.SimpleString key)
key
- property name
Object removeProperty(String key)
removeProperty(SimpleString)
boolean containsProperty(org.hornetq.api.core.SimpleString key)
true
if this message contains a property with the given key, false
else.
key
- property nameboolean containsProperty(String key)
containsProperty(SimpleString)
Boolean getBooleanProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a BooleanBoolean getBooleanProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getBooleanProperty(SimpleString)
Byte getByteProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a ByteByte getByteProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getByteProperty(SimpleString)
Double getDoubleProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a DoubleDouble getDoubleProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getDoubleProperty(SimpleString)
Integer getIntProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to an IntegerInteger getIntProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getIntProperty(SimpleString)
Long getLongProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a LongLong getLongProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getLongProperty(SimpleString)
Object getObjectProperty(org.hornetq.api.core.SimpleString key)
Object getObjectProperty(String key)
getBooleanProperty(SimpleString)
Short getShortProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a ShortShort getShortProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getShortProperty(SimpleString)
Float getFloatProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a FloatFloat getFloatProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getFloatProperty(SimpleString)
String getStringProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a StringString getStringProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getStringProperty(SimpleString)
org.hornetq.api.core.SimpleString getSimpleStringProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a SimpleStringorg.hornetq.api.core.SimpleString getSimpleStringProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getSimpleStringProperty(SimpleString)
byte[] getBytesProperty(org.hornetq.api.core.SimpleString key) throws org.hornetq.api.core.HornetQPropertyConversionException
HornetQPropertyConversionException
- if the value can not be converted to a byte[]byte[] getBytesProperty(String key) throws org.hornetq.api.core.HornetQPropertyConversionException
org.hornetq.api.core.HornetQPropertyConversionException
getBytesProperty(SimpleString)
Set<org.hornetq.api.core.SimpleString> getPropertyNames()
Map<String,Object> toMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |