Class MessageMetadata

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    public class MessageMetadata
    extends BaseTypesMap<java.lang.String,​java.lang.Object>
    implements java.lang.Cloneable
    Container for arbitrary metadata about a message. Extends LinkedHashMap in order to provide dependable iteration order for serialization purposes.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageMetadata()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(java.util.Properties p)
      Adds all values from the properties object.
      MessageMetadata clone()
      Performs a deep clone of this map.
      boolean containsKey​(java.lang.Object key)
      boolean equals​(java.lang.Object other)
      java.lang.Object get​(java.lang.Object key)
      java.lang.String getCgiQueryString()
      Gets the cgi query string.
      long getEstimatedSize()  
      java.lang.Object getProperty​(java.lang.String key)
      Gets a property.
      boolean getProperty​(java.lang.String key, boolean defaultValue)
      Gets arbitrary boolean property from the query.
      int getProperty​(java.lang.String key, int defaultValue)
      Gets arbitrary integer property from the query.
      long getProperty​(java.lang.String key, long defaultValue)
      Gets arbitrary long property from the query.
      java.lang.String getProperty​(java.lang.String key, java.lang.String defaultValue)
      Gets arbitrary String property from the query.
      java.lang.String getRequestIp()
      Gets the request ip.
      int hashCode()
      java.lang.Object remove​(java.lang.Object key)
      void setCgiQueryString​(java.lang.String value)
      Sets the cgi query string.
      void setProperty​(java.lang.String key, java.lang.Object value)
      Sets a property.
      void setRequestIp​(java.lang.String value)
      Sets the request ip.
      java.util.Properties toProperties()
      Gets a new Properties object that represents this metadata object.
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, values
      • Methods inherited from class java.util.HashMap

        compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putIfAbsent, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putIfAbsent, remove, replace, replace, size
    • Field Detail

      • CGI_QUERY_STRING_PROPERTY

        public static final java.lang.String CGI_QUERY_STRING_PROPERTY
        See Also:
        Constant Field Values
      • REQUEST_IP_PROPERTY

        public static final java.lang.String REQUEST_IP_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageMetadata

        public MessageMetadata()
    • Method Detail

      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        get in class java.util.LinkedHashMap<java.lang.String,​java.lang.Object>
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        remove in class java.util.HashMap<java.lang.String,​java.lang.Object>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        containsKey in class java.util.HashMap<java.lang.String,​java.lang.Object>
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Gets a property.
        Parameters:
        key - the key
        Returns:
        the value
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object value)
        Sets a property.
        Parameters:
        key - the key
        value - the value
      • setCgiQueryString

        public void setCgiQueryString​(java.lang.String value)
        Sets the cgi query string.
        Parameters:
        value - the value
      • getCgiQueryString

        public java.lang.String getCgiQueryString()
        Gets the cgi query string.
        Returns:
        the value
      • setRequestIp

        public void setRequestIp​(java.lang.String value)
        Sets the request ip.
        Parameters:
        value - the value
      • getRequestIp

        public java.lang.String getRequestIp()
        Gets the request ip.
        Returns:
        the value
      • toProperties

        public java.util.Properties toProperties()
        Gets a new Properties object that represents this metadata object.
        Returns:
        the data as a Properties object
      • getProperty

        public java.lang.String getProperty​(java.lang.String key,
                                            java.lang.String defaultValue)
        Gets arbitrary String property from the query.
        Parameters:
        key - the key
        defaultValue - the default value
        Returns:
        the property value or the default value if not found
      • getProperty

        public boolean getProperty​(java.lang.String key,
                                   boolean defaultValue)
        Gets arbitrary boolean property from the query.
        Parameters:
        key - the key
        defaultValue - the default value
        Returns:
        the property value or the default value if not found
      • getProperty

        public int getProperty​(java.lang.String key,
                               int defaultValue)
        Gets arbitrary integer property from the query.
        Parameters:
        key - the key
        defaultValue - the default value
        Returns:
        the property value or the default value if not found
      • getProperty

        public long getProperty​(java.lang.String key,
                                long defaultValue)
        Gets arbitrary long property from the query.
        Parameters:
        key - the key
        defaultValue - the default value
        Returns:
        the property value or the default value if not found
      • addAll

        public void addAll​(java.util.Properties p)
        Adds all values from the properties object.
        Parameters:
        p - the properties object to populate from
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        hashCode in class java.util.AbstractMap<java.lang.String,​java.lang.Object>
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        equals in class java.util.AbstractMap<java.lang.String,​java.lang.Object>
      • getEstimatedSize

        public long getEstimatedSize()