Class HashMapMessage

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, Message, Message.Mutable
    Direct Known Subclasses:
    ServerMessageImpl

    public class HashMapMessage
    extends java.util.HashMap<java.lang.String,java.lang.Object>
    implements Message.Mutable, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • HashMapMessage

        public HashMapMessage()
      • HashMapMessage

        public HashMapMessage​(Message message)
    • Method Detail

      • getAdvice

        public java.util.Map<java.lang.String,java.lang.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

        public java.lang.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

        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

        public java.lang.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
      • getDataAsMap

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

        public java.util.Map<java.lang.String,java.lang.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

        public java.lang.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
      • getJSON

        public java.lang.String getJSON()
        Specified by:
        getJSON in interface Message
        Returns:
        this message as a JSON string
      • getAdvice

        public java.util.Map<java.lang.String,java.lang.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

        public java.util.Map<java.lang.String,java.lang.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

        public java.util.Map<java.lang.String,java.lang.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

        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

        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)
      • setChannel

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

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

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

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

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