flex.messaging.messages
Interface Message

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
flex.messaging.messages.AbstractMessage

public interface Message
extends Serializable, Cloneable

Messages are sent from Endpoints into the MessageBroker, which then sends them to a Service. The MessageBroker also sends Messages to Endpoints, and a Service may ask its Broker to send Messages to Endpoints.


Field Summary
static String DESTINATION_CLIENT_ID_HEADER
          The name for the destination client Id header, used to target a message back to the proper client when multiple clients share a channel.
static String ENDPOINT_HEADER
          The name for the endpoint header.
static String REMOTE_CREDENTIALS_HEADER
          The name for the header where remote credentials will be passed.
 
Method Summary
 Object clone()
          Returns a clone of the message.
 Object getBody()
          Returns the body of the message.
 Object getClientId()
          Returns the client id indicating the client that sent the message.
 String getDestination()
          Returns the destination that the message targets.
 Object getHeader(String name)
          Returns a header value corresponding to the passed header name.
 Map getHeaders()
          Returns the headers for the message.
 String getMessageId()
          Returns the unique message id.
 long getTimestamp()
          Returns the timestamp for the message.
 long getTimeToLive()
          Returns the time to live for the message.
 boolean headerExists(String name)
          Tests whether a header with the passed name exists.
 void setBody(Object value)
          Sets the body of the message.
 void setClientId(Object value)
          Sets the client id indicating the client that sent the message.
 void setDestination(String value)
          Sets the destination that the message targets.
 void setHeader(String name, Object value)
          Sets a header on the message.
 void setHeaders(Map value)
          Sets the headers for the message.
 void setMessageId(String value)
          Sets the unique message id.
 void setTimestamp(long value)
          Sets the timestamp for the message.
 void setTimeToLive(long value)
          Sets the time to live for the message.
 

Field Detail

DESTINATION_CLIENT_ID_HEADER

public static final String DESTINATION_CLIENT_ID_HEADER
The name for the destination client Id header, used to target a message back to the proper client when multiple clients share a channel.

See Also:
Constant Field Values

ENDPOINT_HEADER

public static final String ENDPOINT_HEADER
The name for the endpoint header.

See Also:
Constant Field Values

REMOTE_CREDENTIALS_HEADER

public static final String REMOTE_CREDENTIALS_HEADER
The name for the header where remote credentials will be passed.

See Also:
Constant Field Values
Method Detail

getClientId

public Object getClientId()
Returns the client id indicating the client that sent the message.

Returns:
The client id indicating the client that sent the message.

setClientId

public void setClientId(Object value)
Sets the client id indicating the client that sent the message.

Parameters:
value - The client id to set for the message.

getDestination

public String getDestination()
Returns the destination that the message targets.

Returns:
The destination that the message targets.

setDestination

public void setDestination(String value)
Sets the destination that the message targets.

Parameters:
value - The destination that the message targets.

getMessageId

public String getMessageId()
Returns the unique message id.

Returns:
The unique message id.

setMessageId

public void setMessageId(String value)
Sets the unique message id. The id value should be universally unique.

Parameters:
value - The unique message id.

getTimestamp

public long getTimestamp()
Returns the timestamp for the message. Number of milleseconds since the epoch.

Returns:
The timestamp for the message.

setTimestamp

public void setTimestamp(long value)
Sets the timestamp for the message. Number of milliseconds since the epoch.

Parameters:
value - The timestamp for the message.

getTimeToLive

public long getTimeToLive()
Returns the time to live for the message. This is the number of milliseconds beyond the message timestamp that the message is considered valid and deliverable.

Returns:
The time to live for the message.

setTimeToLive

public void setTimeToLive(long value)
Sets the time to live for the message. This is the number of milliseconds beyond the message timestamp that the message will be considered valid and deliverable.

Parameters:
value - The time to live for the message.

getBody

public Object getBody()
Returns the body of the message.

Returns:
The body of the message.

setBody

public void setBody(Object value)
Sets the body of the message.

Parameters:
value - The body of the message.

getHeaders

public Map getHeaders()
Returns the headers for the message.

Returns:
The headers for the message.

setHeaders

public void setHeaders(Map value)
Sets the headers for the message.

Parameters:
value - The headers to set on the message.

getHeader

public Object getHeader(String name)
Returns a header value corresponding to the passed header name. If no header with this name exists, null is returned.

Parameters:
name - The header name to retrieve a value for.
Returns:
The header value.

setHeader

public void setHeader(String name,
                      Object value)
Sets a header on the message.

Parameters:
name - The name of the header to set.
value - The value for the header.

headerExists

public boolean headerExists(String name)
Tests whether a header with the passed name exists.

Parameters:
name - The header to test for existence.
Returns:
true if the headers exists; otherwise false.

clone

public Object clone()
Returns a clone of the message.

Returns:
A clone of the message.


Copyright © 2006 Adobe Systems Inc. All Rights Reserved. (Updated August 2, 2006)