Class AbstractMessage

java.lang.Object
org.red5.compatibility.flex.messaging.messages.AbstractMessage
All Implemented Interfaces:
Serializable, Message
Direct Known Subclasses:
AsyncMessage, RPCMessage

public class AbstractMessage extends Object implements Message, Serializable
Base class for all Flex compatibility messages.
Author:
The Red5 Project, Joachim Bauch (jojo@struktur.de)
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • timestamp

      public long timestamp
    • headers

      public Map<String,Object> headers
    • body

      public Object body
    • messageId

      public String messageId
    • messageIdBytes

      protected byte[] messageIdBytes
    • timeToLive

      public long timeToLive
    • clientId

      public String clientId
    • clientIdBytes

      protected byte[] clientIdBytes
    • destination

      public String destination
    • log

      static org.slf4j.Logger log
  • Constructor Details

    • AbstractMessage

      public AbstractMessage()
      Initialize default message fields.
  • Method Details

    • addParameters

      protected void addParameters(StringBuilder result)
      Add message properties to string.
      Parameters:
      result - StringBuilder to add properties to
    • getBody

      public Object getBody()
      Description copied from interface: Message
      Returns the body of the message.
      Specified by:
      getBody in interface Message
      Returns:
      message body
    • getClientId

      public String getClientId()
      Description copied from interface: Message
      Returns the client id indicating the client that sent the message.
      Specified by:
      getClientId in interface Message
      Returns:
      client id
    • getDestination

      public String getDestination()
      Description copied from interface: Message
      Returns the destination that the message targets.
      Specified by:
      getDestination in interface Message
      Returns:
      destination
    • getHeader

      public Object getHeader(String name)
      Description copied from interface: Message
      Returns a header value corresponding to the passed header name.
      Specified by:
      getHeader in interface Message
      Parameters:
      name - header name
      Returns:
      header value
    • getHeaders

      public Map<String,Object> getHeaders()
      Description copied from interface: Message
      Returns the headers for the message.
      Specified by:
      getHeaders in interface Message
      Returns:
      headers
    • getMessageId

      public String getMessageId()
      Description copied from interface: Message
      Returns the unique message id.
      Specified by:
      getMessageId in interface Message
      Returns:
      message id
    • getTimestamp

      public long getTimestamp()
      Description copied from interface: Message
      Returns the timestamp for the message.
      Specified by:
      getTimestamp in interface Message
      Returns:
      timestamp
    • getTimeToLive

      public long getTimeToLive()
      Description copied from interface: Message
      Returns the time to live for the message.
      Specified by:
      getTimeToLive in interface Message
      Returns:
      time to live
    • headerExists

      public boolean headerExists(String name)
      Description copied from interface: Message
      Tests whether a header with the passed name exists.
      Specified by:
      headerExists in interface Message
      Parameters:
      name - header name
      Returns:
      true if header exists, false otherwise
    • setBody

      public void setBody(Object value)
      Description copied from interface: Message
      Sets the body of the message.
      Specified by:
      setBody in interface Message
      Parameters:
      value - body
    • setClientId

      public void setClientId(String value)
      Description copied from interface: Message
      Sets the client id indicating the client that sent the message.
      Specified by:
      setClientId in interface Message
      Parameters:
      value - client id
    • setDestination

      public void setDestination(String value)
      Description copied from interface: Message
      Sets the destination that the message targets.
      Specified by:
      setDestination in interface Message
      Parameters:
      value - destination
    • setHeader

      public void setHeader(String name, Object value)
      Description copied from interface: Message
      Sets a header on the message.
      Specified by:
      setHeader in interface Message
      Parameters:
      name - header name
      value - header value
    • setHeaders

      public void setHeaders(Map<String,Object> value)
      Description copied from interface: Message
      Sets the headers for the message.
      Specified by:
      setHeaders in interface Message
      Parameters:
      value - header values
    • setMessageId

      public void setMessageId(String value)
      Description copied from interface: Message
      Sets the unique message id.
      Specified by:
      setMessageId in interface Message
      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 interface Message
      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 interface Message
      Parameters:
      value - ttl
    • toString

      public String toString()
      Return string representation of the message.
      Overrides:
      toString in class Object
      Returns:
      value
    • readFlags

      protected short[] readFlags(IDataInput input)
    • readExternal

      public void readExternal(IDataInput input)
    • writeExternal

      public void writeExternal(IDataOutput output)