Class AbstractMessage
java.lang.Object
org.red5.compatibility.flex.messaging.messages.AbstractMessage
- All Implemented Interfaces:
Serializable
,Message
- Direct Known Subclasses:
AsyncMessage
,RPCMessage
Base class for all Flex compatibility messages.
- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
(package private) static org.slf4j.Logger
protected byte[]
private static final long
long
long
Fields inherited from interface org.red5.compatibility.flex.messaging.messages.Message
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addParameters
(StringBuilder result) Add message properties to string.getBody()
Returns the body of the message.Returns the client id indicating the client that sent the message.Returns the destination that the message targets.Returns a header value corresponding to the passed header name.Returns the headers for the message.Returns the unique message id.long
Returns the timestamp for the message.long
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
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
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.toString()
Return string representation of the message.void
writeExternal
(IDataOutput output)
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
timestamp
public long timestamp -
headers
-
body
-
messageId
-
messageIdBytes
protected byte[] messageIdBytes -
timeToLive
public long timeToLive -
clientId
-
clientIdBytes
protected byte[] clientIdBytes -
destination
-
log
static org.slf4j.Logger log
-
-
Constructor Details
-
AbstractMessage
public AbstractMessage()Initialize default message fields.
-
-
Method Details
-
addParameters
Add message properties to string.- Parameters:
result
-StringBuilder
to add properties to
-
getBody
Description copied from interface:Message
Returns the body of the message. -
getClientId
Description copied from interface:Message
Returns the client id indicating the client that sent the message.- Specified by:
getClientId
in interfaceMessage
- Returns:
- client id
-
getDestination
Description copied from interface:Message
Returns the destination that the message targets.- Specified by:
getDestination
in interfaceMessage
- Returns:
- destination
-
getHeader
Description copied from interface:Message
Returns a header value corresponding to the passed header name. -
getHeaders
Description copied from interface:Message
Returns the headers for the message.- Specified by:
getHeaders
in interfaceMessage
- Returns:
- headers
-
getMessageId
Description copied from interface:Message
Returns the unique message id.- Specified by:
getMessageId
in interfaceMessage
- Returns:
- message id
-
getTimestamp
public long getTimestamp()Description copied from interface:Message
Returns the timestamp for the message.- Specified by:
getTimestamp
in interfaceMessage
- Returns:
- timestamp
-
getTimeToLive
public long getTimeToLive()Description copied from interface:Message
Returns the time to live for the message.- Specified by:
getTimeToLive
in interfaceMessage
- Returns:
- time to live
-
headerExists
Description copied from interface:Message
Tests whether a header with the passed name exists.- Specified by:
headerExists
in interfaceMessage
- Parameters:
name
- header name- Returns:
- true if header exists, false otherwise
-
setBody
Description copied from interface:Message
Sets the body of the message. -
setClientId
Description copied from interface:Message
Sets the client id indicating the client that sent the message.- Specified by:
setClientId
in interfaceMessage
- Parameters:
value
- client id
-
setDestination
Description copied from interface:Message
Sets the destination that the message targets.- Specified by:
setDestination
in interfaceMessage
- Parameters:
value
- destination
-
setHeader
Description copied from interface:Message
Sets a header on the message. -
setHeaders
Description copied from interface:Message
Sets the headers for the message.- Specified by:
setHeaders
in interfaceMessage
- Parameters:
value
- header values
-
setMessageId
Description copied from interface:Message
Sets the unique message id.- Specified by:
setMessageId
in interfaceMessage
- Parameters:
value
- message id
-
setTimestamp
public void setTimestamp(long value) Description copied from interface:Message
Sets the timestamp for the message.- Specified by:
setTimestamp
in interfaceMessage
- Parameters:
value
- timestamp
-
setTimeToLive
public void setTimeToLive(long value) Description copied from interface:Message
Sets the time to live for the message.- Specified by:
setTimeToLive
in interfaceMessage
- Parameters:
value
- ttl
-
toString
Return string representation of the message. -
readFlags
-
readExternal
-
writeExternal
-