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 ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[](package private) static org.slf4j.Loggerprotected byte[]private static final longlonglongFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddParameters(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.longReturns the timestamp for the message.longReturns the time to live for the message.booleanheaderExists(String name) Tests whether a header with the passed name exists.voidreadExternal(IDataInput input) protected short[]readFlags(IDataInput input) voidSets the body of the message.voidsetClientId(String value) Sets the client id indicating the client that sent the message.voidsetDestination(String value) Sets the destination that the message targets.voidSets a header on the message.voidsetHeaders(Map<String, Object> value) Sets the headers for the message.voidsetMessageId(String value) Sets the unique message id.voidsetTimestamp(long value) Sets the timestamp for the message.voidsetTimeToLive(long value) Sets the time to live for the message.toString()Return string representation of the message.voidwriteExternal(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-StringBuilderto add properties to
-
getBody
Description copied from interface:MessageReturns the body of the message. -
getClientId
Description copied from interface:MessageReturns the client id indicating the client that sent the message.- Specified by:
getClientIdin interfaceMessage- Returns:
- client id
-
getDestination
Description copied from interface:MessageReturns the destination that the message targets.- Specified by:
getDestinationin interfaceMessage- Returns:
- destination
-
getHeader
Description copied from interface:MessageReturns a header value corresponding to the passed header name. -
getHeaders
Description copied from interface:MessageReturns the headers for the message.- Specified by:
getHeadersin interfaceMessage- Returns:
- headers
-
getMessageId
Description copied from interface:MessageReturns the unique message id.- Specified by:
getMessageIdin interfaceMessage- Returns:
- message id
-
getTimestamp
public long getTimestamp()Description copied from interface:MessageReturns the timestamp for the message.- Specified by:
getTimestampin interfaceMessage- Returns:
- timestamp
-
getTimeToLive
public long getTimeToLive()Description copied from interface:MessageReturns the time to live for the message.- Specified by:
getTimeToLivein interfaceMessage- Returns:
- time to live
-
headerExists
Description copied from interface:MessageTests whether a header with the passed name exists.- Specified by:
headerExistsin interfaceMessage- Parameters:
name- header name- Returns:
- true if header exists, false otherwise
-
setBody
Description copied from interface:MessageSets the body of the message. -
setClientId
Description copied from interface:MessageSets the client id indicating the client that sent the message.- Specified by:
setClientIdin interfaceMessage- Parameters:
value- client id
-
setDestination
Description copied from interface:MessageSets the destination that the message targets.- Specified by:
setDestinationin interfaceMessage- Parameters:
value- destination
-
setHeader
Description copied from interface:MessageSets a header on the message. -
setHeaders
Description copied from interface:MessageSets the headers for the message.- Specified by:
setHeadersin interfaceMessage- Parameters:
value- header values
-
setMessageId
Description copied from interface:MessageSets the unique message id.- Specified by:
setMessageIdin interfaceMessage- Parameters:
value- message id
-
setTimestamp
public void setTimestamp(long value) Description copied from interface:MessageSets the timestamp for the message.- Specified by:
setTimestampin interfaceMessage- Parameters:
value- timestamp
-
setTimeToLive
public void setTimeToLive(long value) Description copied from interface:MessageSets the time to live for the message.- Specified by:
setTimeToLivein interfaceMessage- Parameters:
value- ttl
-
toString
Return string representation of the message. -
readFlags
-
readExternal
-
writeExternal
-