StompHeaderAccessor

A {@code MessageHeaderAccessor} to use when creating a {@code Message} from a decoded STOMP frame, or when encoding a {@code Message} to a STOMP frame.

<p>When created from STOMP frame content, the actual STOMP headers are stored in the native header sub-map managed by the parent class {@link hunt.stomp.support.NativeMessageHeaderAccessor} while the parent class {@link SimpMessageHeaderAccessor} manages common processing headers some of which are based on STOMP headers (e.g. destination, content-type, etc).

<p>An instance of this class can also be created by wrapping an existing {@code Message}. That message may have been created with the more generic {@link hunt.stomp.simp.SimpMessageHeaderAccessor} in which case STOMP headers are created from common processing headers. In this case it is also necessary to invoke either {@link #updateStompCommandAsClientMessage()} or {@link #updateStompCommandAsServerMessage()} if sending a message and depending on whether a message is sent to a client or the message broker.

@author Rossen Stoyanchev @since 4.0

class StompHeaderAccessor : SimpMessageHeaderAccessor {}

Constructors

this
this(StompCommand command, Map!(string, List!(string)) externalSourceHeaders)

A constructor for creating message headers from a parsed STOMP frame.

this
this(MessageBase message)

A constructor for accessing and modifying existing message headers. Note that the message headers may not have been created from a STOMP frame but may have rather originated from using the more generic {@link hunt.stomp.simp.SimpMessageHeaderAccessor}.

this
this()
Undocumented in source.

Members

Functions

createAccessor
MessageHeaderAccessor createAccessor(MessageBase message)
Undocumented in source. Be warned that the author may not have intended to support it.
getAcceptVersion
string[] getAcceptVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
getAck
string getAck()
Undocumented in source. Be warned that the author may not have intended to support it.
getCommand
Nullable!StompCommand getCommand()

Return the STOMP command, or {@code null} if not yet set.

getContentLength
Integer getContentLength()
Undocumented in source. Be warned that the author may not have intended to support it.
getDetailedLogMessage
string getDetailedLogMessage(Object payload)
Undocumented in source. Be warned that the author may not have intended to support it.
getHeartbeat
long[] getHeartbeat()
Undocumented in source. Be warned that the author may not have intended to support it.
getHost
string getHost()
Undocumented in source. Be warned that the author may not have intended to support it.
getLogin
string getLogin()
Undocumented in source. Be warned that the author may not have intended to support it.
getMessage
string getMessage()
Undocumented in source. Be warned that the author may not have intended to support it.
getMessageId
string getMessageId()
Undocumented in source. Be warned that the author may not have intended to support it.
getNack
string getNack()
Undocumented in source. Be warned that the author may not have intended to support it.
getNativeHeaders
Map!(string, List!(string)) getNativeHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.
getPasscode
string getPasscode()

Return the passcode header value, or {@code null} if not set.

getReceipt
string getReceipt()
Undocumented in source. Be warned that the author may not have intended to support it.
getReceiptId
string getReceiptId()
Undocumented in source. Be warned that the author may not have intended to support it.
getShortLogMessage
string getShortLogMessage(Object payload)
Undocumented in source. Be warned that the author may not have intended to support it.
getVersion
string getVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
isHeartbeat
bool isHeartbeat()
Undocumented in source. Be warned that the author may not have intended to support it.
setAcceptVersion
void setAcceptVersion(string acceptVersion)
Undocumented in source. Be warned that the author may not have intended to support it.
setAck
void setAck(string ack)
Undocumented in source. Be warned that the author may not have intended to support it.
setContentLength
void setContentLength(int contentLength)
Undocumented in source. Be warned that the author may not have intended to support it.
setContentType
void setContentType(MimeType contentType)
Undocumented in source. Be warned that the author may not have intended to support it.
setDestination
void setDestination(string destination)
Undocumented in source. Be warned that the author may not have intended to support it.
setHeartbeat
void setHeartbeat(long cx, long cy)
Undocumented in source. Be warned that the author may not have intended to support it.
setHost
void setHost(string host)
Undocumented in source. Be warned that the author may not have intended to support it.
setLogin
void setLogin(string login)
Undocumented in source. Be warned that the author may not have intended to support it.
setMessage
void setMessage(string content)
Undocumented in source. Be warned that the author may not have intended to support it.
setMessageId
void setMessageId(string id)
Undocumented in source. Be warned that the author may not have intended to support it.
setNack
void setNack(string nack)
Undocumented in source. Be warned that the author may not have intended to support it.
setPasscode
void setPasscode(string passcode)
Undocumented in source. Be warned that the author may not have intended to support it.
setReceipt
void setReceipt(string receiptId)
Undocumented in source. Be warned that the author may not have intended to support it.
setReceiptId
void setReceiptId(string receiptId)
Undocumented in source. Be warned that the author may not have intended to support it.
setSubscriptionId
void setSubscriptionId(string subscriptionId)
Undocumented in source. Be warned that the author may not have intended to support it.
setVersion
void setVersion(string ver)
Undocumented in source. Be warned that the author may not have intended to support it.
updateSimpMessageHeadersFromStompHeaders
void updateSimpMessageHeadersFromStompHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.
updateStompCommandAsClientMessage
StompCommand updateStompCommandAsClientMessage()
Undocumented in source. Be warned that the author may not have intended to support it.
updateStompCommandAsServerMessage
void updateStompCommandAsServerMessage()
Undocumented in source. Be warned that the author may not have intended to support it.
updateStompHeadersFromSimpMessageHeaders
void updateStompHeadersFromSimpMessageHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

create
StompHeaderAccessor create(StompCommand command)

Create an instance for the given STOMP command.

create
StompHeaderAccessor create(StompCommand command, Map!(string, List!(string)) headers)

Create an instance for the given STOMP command and headers.

createForHeartbeat
StompHeaderAccessor createForHeartbeat()

Create headers for a heartbeat. While a STOMP heartbeat frame does not have headers, a session id is needed for processing purposes at a minimum.

getCommand
Nullable!StompCommand getCommand(Map!(string, Object) headers)

Return the STOMP command from the given headers, or {@code null} if not set.

getContentLength
Integer getContentLength(Map!(string, List!(string)) nativeHeaders)
Undocumented in source. Be warned that the author may not have intended to support it.
getPasscode
string getPasscode(Map!(string, Object) headers)

Return the passcode header value, or {@code null} if not set.

wrap
StompHeaderAccessor wrap(MessageBase message)

Create an instance from the payload and headers of the given Message.

Variables

STOMP_ACCEPT_VERSION_HEADER
enum string STOMP_ACCEPT_VERSION_HEADER;
Undocumented in source.
STOMP_ACK_HEADER
enum string STOMP_ACK_HEADER;
Undocumented in source.
STOMP_CONTENT_LENGTH_HEADER
enum string STOMP_CONTENT_LENGTH_HEADER;
Undocumented in source.
STOMP_CONTENT_TYPE_HEADER
enum string STOMP_CONTENT_TYPE_HEADER;
Undocumented in source.
STOMP_DESTINATION_HEADER
enum string STOMP_DESTINATION_HEADER;
Undocumented in source.
STOMP_HEARTBEAT_HEADER
enum string STOMP_HEARTBEAT_HEADER;
Undocumented in source.
STOMP_HOST_HEADER
enum string STOMP_HOST_HEADER;
Undocumented in source.
STOMP_ID_HEADER
enum string STOMP_ID_HEADER;
Undocumented in source.
STOMP_LOGIN_HEADER
enum string STOMP_LOGIN_HEADER;
Undocumented in source.
STOMP_MESSAGE_HEADER
enum string STOMP_MESSAGE_HEADER;
Undocumented in source.
STOMP_MESSAGE_ID_HEADER
enum string STOMP_MESSAGE_ID_HEADER;
Undocumented in source.
STOMP_NACK_HEADER
enum string STOMP_NACK_HEADER;
Undocumented in source.
STOMP_PASSCODE_HEADER
enum string STOMP_PASSCODE_HEADER;
Undocumented in source.
STOMP_RECEIPT_HEADER
enum string STOMP_RECEIPT_HEADER;
Undocumented in source.
STOMP_RECEIPT_ID_HEADER
enum string STOMP_RECEIPT_ID_HEADER;
Undocumented in source.
STOMP_SUBSCRIPTION_HEADER
enum string STOMP_SUBSCRIPTION_HEADER;
Undocumented in source.
STOMP_VERSION_HEADER
enum string STOMP_VERSION_HEADER;
Undocumented in source.

Inherited Members

From SimpMessageHeaderAccessor

DESTINATION_HEADER
enum string DESTINATION_HEADER;
Undocumented in source.
MESSAGE_TYPE_HEADER
enum string MESSAGE_TYPE_HEADER;
Undocumented in source.
SESSION_ID_HEADER
enum string SESSION_ID_HEADER;
Undocumented in source.
SESSION_ATTRIBUTES
enum string SESSION_ATTRIBUTES;
Undocumented in source.
SUBSCRIPTION_ID_HEADER
enum string SUBSCRIPTION_ID_HEADER;
Undocumented in source.
USER_HEADER
enum string USER_HEADER;
Undocumented in source.
CONNECT_MESSAGE_HEADER
enum string CONNECT_MESSAGE_HEADER;
Undocumented in source.
DISCONNECT_MESSAGE_HEADER
enum string DISCONNECT_MESSAGE_HEADER;
Undocumented in source.
HEART_BEAT_HEADER
enum string HEART_BEAT_HEADER;
Undocumented in source.
ORIGINAL_DESTINATION
enum string ORIGINAL_DESTINATION;

A header for internal use with "user" destinations where we need to restore the destination prior to sending messages to clients.

IGNORE_ERROR
enum string IGNORE_ERROR;

A header that indicates to the broker that the sender will ignore errors. The header is simply checked for presence or absence.

createAccessor
MessageHeaderAccessor createAccessor(MessageBase message)
Undocumented in source. Be warned that the author may not have intended to support it.
setMessageTypeIfNotSet
void setMessageTypeIfNotSet(SimpMessageType messageType)
Undocumented in source. Be warned that the author may not have intended to support it.
getMessageType
Nullable!SimpMessageType getMessageType()
Undocumented in source. Be warned that the author may not have intended to support it.
setDestination
void setDestination(string destination)
Undocumented in source. Be warned that the author may not have intended to support it.
getDestination
string getDestination()
Undocumented in source. Be warned that the author may not have intended to support it.
setSubscriptionId
void setSubscriptionId(string subscriptionId)
Undocumented in source. Be warned that the author may not have intended to support it.
getSubscriptionId
string getSubscriptionId()
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionId
void setSessionId(int sessionId)
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionId
void setSessionId(string sessionId)
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionId
string getSessionId()

Return the id of the current session.

setSessionAttributes
void setSessionAttributes(Map!(string, Object) attributes)

A static alternative for access to the session attributes header.

getSessionAttributes
Map!(string, Object) getSessionAttributes()

Return the attributes associated with the current session.

getShortLogMessage
string getShortLogMessage(Object payload)

Return the user associated with the current session.

getDetailedLogMessage
string getDetailedLogMessage(Object payload)
Undocumented in source. Be warned that the author may not have intended to support it.
create
SimpMessageHeaderAccessor create()

Create an instance with {@link hunt.stomp.simp.SimpMessageType} {@code MESSAGE}.

create
SimpMessageHeaderAccessor create(SimpMessageType messageType)

Create an instance with the given {@link hunt.stomp.simp.SimpMessageType}.

wrap
SimpMessageHeaderAccessor wrap(MessageBase message)

Create an instance from the payload and headers of the given Message.

getMessageType
Nullable!SimpMessageType getMessageType(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.
getDestination
string getDestination(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.
getSubscriptionId
string getSubscriptionId(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionId
string getSessionId(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionAttributes
Map!(string, Object) getSessionAttributes(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.
getHeartbeat
long[] getHeartbeat(Map!(string, Object) headers)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta