|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Message
Contains data sent or received via the Messaging API. In addition to main payload, metadata are provided in the form of headers and other special fields.
For efficiency, Message implementations normally keep a reference to the data they contain instead of a
copy. Once a Message has been submitted to a Destination, it is locked and read-only. Attempts
to modify the contents of the Message result in an exception being thrown.
| Field Summary | ||
|---|---|---|
static int |
PRIORITY_MAX
Maximum priority value for the message queued. |
|
static int |
PRIORITY_MIN
Minimum priority value for the message queued. |
|
| Method Summary | ||
|---|---|---|
void |
cancel()
Tries to cancel the message. |
|
int |
getCorrelatedMessageId()
Returns the message ID. |
|
int |
getMessageId()
Returns the ID of the message |
|
String |
getMessageProperty(String key)
Returns the value of a message property by name. |
|
Object |
getObjectPayload()
Returns an object reference to the body of the message. |
|
int |
getPriority()
Returns the priority value of this message. |
|
String |
getTransportHeader(String key)
Returns the value of the transport header specified. |
|
Headers |
getTransportHeaders()
Returns all transport headers. |
|
String[] |
getTransportHeadersForKey(String key)
Returns the values of transport header specified. |
|
boolean |
isCancellable()
Indicates whether or not this message can be cancelled. |
|
void |
setCancellable(boolean cancellable)
Configures the message so that it can be cancelled. |
|
void |
setMessageProperty(String key,
String value)
Sets a given message property. |
|
void |
setPriority(int priority)
Sets the priority of this message. |
|
void |
setTTL(int ttl)
Sets the Time-to-Live (TTL) for this message. |
|
void |
setTransportHeader(String key,
String value)
Sets a transport header to the value specified. |
|
void |
setTransportHeader(String key,
String[] values)
Sets a transport header to the set of values specified. |
|
void |
setTransportHeaders(Headers headers)
Sets all transport headers. |
|
| Field Detail |
|---|
static final int PRIORITY_MAX
static final int PRIORITY_MIN
| Method Detail |
|---|
int getMessageId()
Object getObjectPayload()
Object representation of this Message.
void setMessageProperty(String key,
String value)
throws MessageModificationException
key - Name of the property.value - Value of the property.
MessageModificationExceptionString getMessageProperty(String key)
key - Name of the property.
void setTransportHeader(String key,
String value)
throws MessageModificationException
key - Name of the transport headervalue - Value of the transport header
MessageModificationException
void setTransportHeader(String key,
String[] values)
throws MessageModificationException
key - Name of the transport header.values - Array of values for the transport header.
MessageModificationExceptionString getTransportHeader(String key)
key - Name of the transport header.
String[] getTransportHeadersForKey(String key)
key - Name of the transport header.
Array of values for the transport header.Headers getTransportHeaders()
Headers object containing all transport headers.
void setTransportHeaders(Headers headers)
throws MessageModificationException
headers - Headers object containing all transport headers.
MessageModificationExceptionvoid cancel()
void setCancellable(boolean cancellable)
throws MessageModificationException
cancellable - The value to use with this message.
MessageModificationExceptionboolean isCancellable()
void setPriority(int priority)
throws MessageModificationException
priority - An integer from PRIORITY_MIN to PRIORITY_MAX where PRIORITY_MIN is
the lowest priority.
MessageModificationExceptionint getPriority()
PRIORITY_MIN to PRIORITY_MAX where PRIORITY_MIN is
the lowest priority.int getCorrelatedMessageId()
void setTTL(int ttl)
throws MessageModificationException
ttl - The Time-to-Live value.
MessageModificationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal