Class HashMapMessage

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Message, Message.Mutable
Direct Known Subclasses:
ServerMessageImpl

public class HashMapMessage extends HashMap<String,Object> implements Message.Mutable, Serializable
See Also:
  • Constructor Details Link icon

    • HashMapMessage Link icon

      public HashMapMessage()
    • HashMapMessage Link icon

      public HashMapMessage(Message message)
  • Method Details Link icon

    • getAdvice Link icon

      public Map<String,Object> getAdvice()
      Description copied from interface: Message
      Convenience method to retrieve the Message.ADVICE_FIELD
      Specified by:
      getAdvice in interface Message
      Returns:
      the advice of the message
    • getChannel Link icon

      public String getChannel()
      Description copied from interface: Message
      Convenience method to retrieve the Message.CHANNEL_FIELD. Bayeux message always have a non null channel.
      Specified by:
      getChannel in interface Message
      Returns:
      the channel of the message
    • getChannelId Link icon

      public ChannelId getChannelId()
      Description copied from interface: Message
      Convenience method to retrieve the Message.CHANNEL_FIELD. Bayeux message always have a non null channel.
      Specified by:
      getChannelId in interface Message
      Returns:
      the channel of the message
    • getClientId Link icon

      public String getClientId()
      Description copied from interface: Message
      Convenience method to retrieve the Message.CLIENT_ID_FIELD
      Specified by:
      getClientId in interface Message
      Returns:
      the client id of the message
    • getData Link icon

      public Object getData()
      Description copied from interface: Message
      Convenience method to retrieve the Message.DATA_FIELD
      Specified by:
      getData in interface Message
      Returns:
      the data of the message
      See Also:
    • getDataAsMap Link icon

      public Map<String,Object> getDataAsMap()
      Specified by:
      getDataAsMap in interface Message
      Returns:
      the data of the message as a map
      See Also:
    • getExt Link icon

      public Map<String,Object> getExt()
      Description copied from interface: Message
      Convenience method to retrieve the Message.EXT_FIELD
      Specified by:
      getExt in interface Message
      Returns:
      the ext of the message
    • getId Link icon

      public String getId()
      Description copied from interface: Message
      Convenience method to retrieve the Message.ID_FIELD
      Specified by:
      getId in interface Message
      Returns:
      the id of the message
    • getAdvice Link icon

      public Map<String,Object> getAdvice(boolean create)
      Description copied from interface: Message.Mutable
      Convenience method to retrieve the Message.ADVICE_FIELD and create it if it does not exist
      Specified by:
      getAdvice in interface Message.Mutable
      Parameters:
      create - whether to create the advice field if it does not exist
      Returns:
      the advice of the message
    • getDataAsMap Link icon

      public Map<String,Object> getDataAsMap(boolean create)
      Description copied from interface: Message.Mutable
      Convenience method to retrieve the Message.DATA_FIELD and create it if it does not exist
      Specified by:
      getDataAsMap in interface Message.Mutable
      Parameters:
      create - whether to create the data field if it does not exist
      Returns:
      the data of the message
    • getExt Link icon

      public Map<String,Object> getExt(boolean create)
      Description copied from interface: Message.Mutable
      Convenience method to retrieve the Message.EXT_FIELD and create it if it does not exist
      Specified by:
      getExt in interface Message.Mutable
      Parameters:
      create - whether to create the ext field if it does not exist
      Returns:
      the ext of the message
    • isMeta Link icon

      public boolean isMeta()
      Description copied from interface: Message
      A messages that has a meta channel is dubbed a "meta message".
      Specified by:
      isMeta in interface Message
      Returns:
      whether the channel's message is a meta channel
    • isPublishReply Link icon

      public boolean isPublishReply()
      Description copied from interface: Message
      Publish message replies contain the "successful" field
      Specified by:
      isPublishReply in interface Message
      Returns:
      whether this message is a publish reply (as opposed to a published message)
    • isSuccessful Link icon

      public boolean isSuccessful()
      Description copied from interface: Message
      Convenience method to retrieve the Message.SUCCESSFUL_FIELD
      Specified by:
      isSuccessful in interface Message
      Returns:
      whether the message is successful
    • setChannel Link icon

      public void setChannel(String channel)
      Specified by:
      setChannel in interface Message.Mutable
      Parameters:
      channel - the channel of this message
    • setClientId Link icon

      public void setClientId(String clientId)
      Specified by:
      setClientId in interface Message.Mutable
      Parameters:
      clientId - the client id of this message
    • setData Link icon

      public void setData(Object data)
      Specified by:
      setData in interface Message.Mutable
      Parameters:
      data - the data of this message
    • setId Link icon

      public void setId(String id)
      Specified by:
      setId in interface Message.Mutable
      Parameters:
      id - the id of this message
    • setSuccessful Link icon

      public void setSuccessful(boolean successful)
      Specified by:
      setSuccessful in interface Message.Mutable
      Parameters:
      successful - the successfulness of this message