Package com.attivio.sdk.esb
Class MessageMetadata
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- com.attivio.sdk.util.BaseTypesMap<java.lang.String,java.lang.Object>
-
- com.attivio.sdk.esb.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 com.attivio.sdk.util.BaseTypesMap
BaseTypesMap.BaseTypesEntry
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CGI_QUERY_STRING_PROPERTY
static java.lang.String
MESSAGE_CREATION_EPOCH_MILLIS
static java.lang.String
REQUEST_IP_PROPERTY
-
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 com.attivio.sdk.util.BaseTypesMap
checkType, getEntries, put, putAll, setEntries
-
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
-
-
-
-
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
-
MESSAGE_CREATION_EPOCH_MILLIS
public static final java.lang.String MESSAGE_CREATION_EPOCH_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
get
in classjava.util.LinkedHashMap<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
remove
in classjava.util.HashMap<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
containsKey
in classjava.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 keyvalue
- 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 keydefaultValue
- 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 keydefaultValue
- 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 keydefaultValue
- 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 keydefaultValue
- 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
-
clone
public MessageMetadata clone()
Performs a deep clone of this map.- Overrides:
clone
in classBaseTypesMap<java.lang.String,java.lang.Object>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
hashCode
in classjava.util.AbstractMap<java.lang.String,java.lang.Object>
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
equals
in classjava.util.AbstractMap<java.lang.String,java.lang.Object>
-
getEstimatedSize
public long getEstimatedSize()
-
-