flex.messaging.messages
Class AbstractMessage

java.lang.Object
  extended by flex.messaging.messages.AbstractMessage
All Implemented Interfaces:
Message, Serializable, Cloneable
Direct Known Subclasses:
AsyncMessage, RPCMessage

public abstract class AbstractMessage
extends Object
implements Message, Cloneable

This is the default implementation of Message, which provides a convenient base for behavior and associations common to all endpoints.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface flex.messaging.messages.Message
DESTINATION_CLIENT_ID_HEADER, ENDPOINT_HEADER, FLEX_CLIENT_ID_HEADER, REMOTE_CREDENTIALS_CHARSET_HEADER, REMOTE_CREDENTIALS_HEADER, SYNC_HEADER
 
Constructor Summary
AbstractMessage()
           
 
Method Summary
 Object clone()
          Returns a clone of the message.
 boolean equals(Object o)
           
 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 headerName)
          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.
 int hashCode()
           
 boolean headerExists(String headerName)
          Tests whether a header with the passed name exists.
 String logCategory()
          Returns a category to use when logging against this message type.
 void setBody(Object body)
          Sets the body of the message.
 void setClientId(Object clientId)
          Sets the client id indicating the client that sent the message.
 void setDestination(String destination)
          Sets the destination that the message targets.
 void setHeader(String headerName, Object value)
          Sets a header on the message.
 void setHeaders(Map newHeaders)
          Sets the headers for the message.
 void setMessageId(String messageId)
          Sets the unique message id.
 void setTimestamp(long timestamp)
          Sets the timestamp for the message.
 void setTimeToLive(long timeToLive)
          Sets the time to live for the message.
 String toString()
           
 String toString(int indent)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMessage

public AbstractMessage()
Method Detail

getClientId

public Object getClientId()
Description copied from interface: Message
Returns the client id indicating the client that sent the message.

Specified by:
getClientId in interface Message
Returns:
The client id indicating the client that sent the message.

setClientId

public void setClientId(Object clientId)
Description copied from interface: Message
Sets the client id indicating the client that sent the message.

Specified by:
setClientId in interface Message
Parameters:
clientId - The client id to set for the message.

getMessageId

public String getMessageId()
Description copied from interface: Message
Returns the unique message id.

Specified by:
getMessageId in interface Message
Returns:
The unique message id.

setMessageId

public void setMessageId(String messageId)
Description copied from interface: Message
Sets the unique message id. The id value should be universally unique.

Specified by:
setMessageId in interface Message
Parameters:
messageId - The unique message id.

getTimestamp

public long getTimestamp()
Description copied from interface: Message
Returns the timestamp for the message. Number of milleseconds since the epoch.

Specified by:
getTimestamp in interface Message
Returns:
The timestamp for the message.

setTimestamp

public void setTimestamp(long timestamp)
Description copied from interface: Message
Sets the timestamp for the message. Number of milliseconds since the epoch.

Specified by:
setTimestamp in interface Message
Parameters:
timestamp - The timestamp for the message.

getTimeToLive

public long getTimeToLive()
Description copied from interface: Message
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.

Specified by:
getTimeToLive in interface Message
Returns:
The time to live for the message.

setTimeToLive

public void setTimeToLive(long timeToLive)
Description copied from interface: Message
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.

Specified by:
setTimeToLive in interface Message
Parameters:
timeToLive - The time to live for the message.

getBody

public Object getBody()
Description copied from interface: Message
Returns the body of the message.

Specified by:
getBody in interface Message
Returns:
The body of the message.

setBody

public void setBody(Object body)
Description copied from interface: Message
Sets the body of the message.

Specified by:
setBody in interface Message
Parameters:
body - The body of the message.

getDestination

public String getDestination()
Description copied from interface: Message
Returns the destination that the message targets.

Specified by:
getDestination in interface Message
Returns:
The destination that the message targets.

setDestination

public void setDestination(String destination)
Description copied from interface: Message
Sets the destination that the message targets.

Specified by:
setDestination in interface Message
Parameters:
destination - The destination that the message targets.

getHeaders

public Map getHeaders()
Description copied from interface: Message
Returns the headers for the message.

Specified by:
getHeaders in interface Message
Returns:
The headers for the message.

setHeaders

public void setHeaders(Map newHeaders)
Description copied from interface: Message
Sets the headers for the message.

Specified by:
setHeaders in interface Message
Parameters:
newHeaders - The headers to set on the message.

getHeader

public Object getHeader(String headerName)
Description copied from interface: Message
Returns a header value corresponding to the passed header name. If no header with this name exists, null is returned.

Specified by:
getHeader in interface Message
Parameters:
headerName - The header name to retrieve a value for.
Returns:
The header value.

setHeader

public void setHeader(String headerName,
                      Object value)
Description copied from interface: Message
Sets a header on the message.

Specified by:
setHeader in interface Message
Parameters:
headerName - The name of the header to set.
value - The value for the header.

headerExists

public boolean headerExists(String headerName)
Description copied from interface: Message
Tests whether a header with the passed name exists.

Specified by:
headerExists in interface Message
Parameters:
headerName - The header to test for existence.
Returns:
true if the headers exists; otherwise false.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(int indent)

clone

public Object clone()
Description copied from interface: Message
Returns a clone of the message.

Specified by:
clone in interface Message
Overrides:
clone in class Object
Returns:
A clone of the message.

logCategory

public String logCategory()
Returns a category to use when logging against this message type.



Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/messages/AbstractMessage.html