MessageHeaders

The headers for a {@link Message}.

<p><b>IMPORTANT</b>: This class is immutable. Any mutating operation such as {@code put(..)}, {@code putAll(..)} and others will throw {@link UnsupportedOperationException}. <p>Subclasses do have access to the raw headers, however, via {@link #getRawHeaders()}.

<p>One way to create message headers is to use the {@link hunt.stomp.support.MessageBuilder MessageBuilder}: <pre class="code"> MessageBuilder.withPayload("foo").setHeader("key1", "value1").setHeader("key2", "value2"); </pre>

A second option is to create {@link hunt.stomp.support.GenericMessage} passing a payload as {@link Object} and headers as a {@link Map java.util.Map}: <pre class="code"> Map headers = new HashMap(); headers.put("key1", "value1"); headers.put("key2", "value2"); new GenericMessage("foo", headers); </pre>

A third option is to use {@link hunt.stomp.support.MessageHeaderAccessor} or one of its subclasses to create specific categories of headers.

@author Arjen Poutsma @author Mark Fisher @author Gary Russell @author Juergen Hoeller @since 4.0 @see hunt.stomp.support.MessageBuilder @see hunt.stomp.support.MessageHeaderAccessor

Constructors

this
this(Map!(string, Object) headers)

Construct a {@link MessageHeaders} with the given headers. An {@link #ID} and {@link #TIMESTAMP} headers will also be added, overriding any existing values. @param headers a map with headers to add

this
this(Map!(string, Object) headers, UUID* id, long timestamp)
Undocumented in source.
this
this(Map!(string, Object) headers, UUID* id, Long timestamp)

Constructor providing control over the ID and TIMESTAMP header values. @param headers a map with headers to add @param id the {@link #ID} header value @param timestamp the {@link #TIMESTAMP} header value

Members

Functions

byKey
InputRange!string byKey()
Undocumented in source. Be warned that the author may not have intended to support it.
byValue
InputRange!Object byValue()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()

Since MessageHeaders are immutable, the call to this method will result in {@link UnsupportedOperationException}.

containsKey
bool containsKey(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
containsValue
bool containsValue(Object value)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Object get(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
getAs
T getAs(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
getErrorChannel
Object getErrorChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
getId
UUID getId()
Undocumented in source. Be warned that the author may not have intended to support it.
getRawHeaders
Map!(string, Object) getRawHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.
getReplyChannel
Object getReplyChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
getTimestamp
Long getTimestamp()
Undocumented in source. Be warned that the author may not have intended to support it.
isEmpty
bool isEmpty()
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(ref string, ref Object) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(MapEntry!(string, Object) entry) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Object other)
Undocumented in source. Be warned that the author may not have intended to support it.
put
Object put(string key, Object value)

Since MessageHeaders are immutable, the call to this method will result in {@link UnsupportedOperationException}.

putAll
void putAll(Map!(string, Object) map)

Since MessageHeaders are immutable, the call to this method will result in {@link UnsupportedOperationException}.

remove
Object remove(string key)

Since MessageHeaders are immutable, the call to this method will result in {@link UnsupportedOperationException}.

size
int size()
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

getIdGenerator
IdGenerator getIdGenerator()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

ID_VALUE_NONE
UUID ID_VALUE_NONE;

UUID for none.

Variables

CONTENT_TYPE
enum string CONTENT_TYPE;

The key for the message content type.

ERROR_CHANNEL
enum string ERROR_CHANNEL;

The key for the message error channel.

ID
enum string ID;

The key for the Message ID. This is an automatically generated UUID and should never be explicitly set in the header map <b>except</b> in the case of Message deserialization where the serialized Message's generated UUID is being restored.

REPLY_CHANNEL
enum string REPLY_CHANNEL;

The key for the message reply channel.

TIMESTAMP
enum string TIMESTAMP;

The key for the message timestamp.

Meta