org.red5.compatibility.flex.messaging.messages
public class AbstractMessage extends Object implements Message, Serializable
Modifier and Type | Field and Description |
---|---|
Object |
body |
String |
clientId |
protected byte[] |
clientIdBytes |
String |
destination |
Map<String,Object> |
headers |
String |
messageId |
protected byte[] |
messageIdBytes |
long |
timestamp |
long |
timeToLive |
DESTINATION_CLIENT_ID_HEADER, ENDPOINT_HEADER, FLEX_CLIENT_ID_HEADER, MESSAGING_VERSION, NEEDS_CONFIG_HEADER, POLL_WAIT_HEADER, PRESERVE_DURABLE_HEADER, REMOTE_CREDENTIALS_HEADER, REMOVE_SUBSCRIPTIONS, SELECTOR_HEADER, SUBSCRIPTION_INVALIDATED_HEADER, SUBTOPIC_SEPARATOR, SYNC_HEADER
Constructor and Description |
---|
AbstractMessage()
Initialize default message fields.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addParameters(StringBuilder result)
Add message properties to string.
|
Object |
getBody()
Returns the body of the message.
|
String |
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<String,Object> |
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 |
readExternal(IDataInput input) |
protected short[] |
readFlags(IDataInput input) |
void |
setBody(Object value)
Sets the body of the message.
|
void |
setClientId(String 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<String,Object> 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.
|
String |
toString()
Return string representation of the message.
|
void |
writeExternal(IDataOutput output) |
public long timestamp
public Object body
public String messageId
protected byte[] messageIdBytes
public long timeToLive
public String clientId
protected byte[] clientIdBytes
public String destination
protected void addParameters(StringBuilder result)
result
- StringBuilder
to add properties topublic Object getBody()
Message
public String getClientId()
Message
getClientId
in interface Message
public String getDestination()
Message
getDestination
in interface Message
public Object getHeader(String name)
Message
public Map<String,Object> getHeaders()
Message
getHeaders
in interface Message
public String getMessageId()
Message
getMessageId
in interface Message
public long getTimestamp()
Message
getTimestamp
in interface Message
public long getTimeToLive()
Message
getTimeToLive
in interface Message
public boolean headerExists(String name)
Message
headerExists
in interface Message
public void setBody(Object value)
Message
public void setClientId(String value)
Message
setClientId
in interface Message
public void setDestination(String value)
Message
setDestination
in interface Message
public void setHeader(String name, Object value)
Message
public void setHeaders(Map<String,Object> value)
Message
setHeaders
in interface Message
public void setMessageId(String value)
Message
setMessageId
in interface Message
public void setTimestamp(long value)
Message
setTimestamp
in interface Message
public void setTimeToLive(long value)
Message
setTimeToLive
in interface Message
public String toString()
protected short[] readFlags(IDataInput input)
public void readExternal(IDataInput input)
public void writeExternal(IDataOutput output)
Copyright © 2006-2012 The Red5 Project