Class StompHeaderAccessor
MessageHeaderAccessor to use when creating a Message from
 a decoded STOMP frame, or when encoding a Message to a STOMP frame.
 When created from STOMP frame content, the actual STOMP headers are
 stored in the native header sub-map managed by the parent class
 NativeMessageHeaderAccessor
 while the parent class SimpMessageHeaderAccessor manages common
 processing headers some of which are based on STOMP headers
 (e.g. destination, content-type, etc).
 
An instance of this class can also be created by wrapping an existing
 Message. That message may have been created with the more generic
 SimpMessageHeaderAccessor in
 which case STOMP headers are created from common processing headers.
 In this case it is also necessary to invoke either
 updateStompCommandAsClientMessage() or
 updateStompCommandAsServerMessage() if sending a message and
 depending on whether a message is sent to a client or the message broker.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.springframework.messaging.simp.SimpMessageHeaderAccessorCONNECT_MESSAGE_HEADER, DESTINATION_HEADER, DISCONNECT_MESSAGE_HEADER, HEART_BEAT_HEADER, IGNORE_ERROR, MESSAGE_TYPE_HEADER, ORIGINAL_DESTINATION, SESSION_ATTRIBUTES, SESSION_ID_HEADER, SUBSCRIPTION_ID_HEADER, USER_HEADERFields inherited from class org.springframework.messaging.support.NativeMessageHeaderAccessorNATIVE_HEADERSFields inherited from class org.springframework.messaging.support.MessageHeaderAccessorDEFAULT_CHARSET
- 
Method SummaryModifier and TypeMethodDescriptionstatic StompHeaderAccessorcreate(StompCommand command) Create an instance for the given STOMP command.static StompHeaderAccessorCreate an instance for the given STOMP command and headers.protected MessageHeaderAccessorcreateAccessor(Message<?> message) Build a 'nested' accessor for the given message.static StompHeaderAccessorCreate headers for a heartbeat.getAck()Return the STOMP command, ornullif not yet set.static StompCommandgetCommand(Map<String, Object> headers) Return the STOMP command from the given headers, ornullif not set.static IntegergetContentLength(Map<String, List<String>> nativeHeaders) getDetailedLogMessage(Object payload) Return a more detailed message for logging purposes.long[]getHost()getLogin()getNack()Subclasses can use this method to access the "native" headers sub-map.Return the passcode header value, ornullif not set.static StringgetPasscode(Map<String, Object> headers) Return the passcode header value, ornullif not set.getShortLogMessage(Object payload) Return a concise message for logging purposes.booleanvoidsetAcceptVersion(String acceptVersion) voidvoidsetContentLength(int contentLength) voidsetContentType(MimeType contentType) voidsetDestination(String destination) voidsetHeartbeat(long cx, long cy) voidvoidvoidsetMessage(String content) voidsetMessageId(String id) voidvoidsetPasscode(String passcode) voidsetReceipt(String receiptId) voidsetReceiptId(String receiptId) voidsetSubscriptionId(String subscriptionId) voidsetVersion(String version) voidstatic StompHeaderAccessorCreate an instance from the payload and headers of the given Message.Methods inherited from class org.springframework.messaging.simp.SimpMessageHeaderAccessorcreate, create, getDestination, getDestination, getHeartbeat, getMessageType, getMessageType, getSessionAttributes, getSessionAttributes, getSessionId, getSessionId, getSubscriptionId, getSubscriptionId, getUser, getUser, setMessageTypeIfNotSet, setSessionAttributes, setSessionId, setUser, setUserChangeCallbackMethods inherited from class org.springframework.messaging.support.NativeMessageHeaderAccessoraddNativeHeader, addNativeHeaders, containsNativeHeader, copyHeaders, copyHeadersIfAbsent, getFirstNativeHeader, getFirstNativeHeader, getNativeHeader, removeNativeHeader, setImmutable, setNativeHeader, setNativeHeaderValues, toNativeHeaderMapMethods inherited from class org.springframework.messaging.support.MessageHeaderAccessorfromMap, fromMessageHeaders, getAccessor, getAccessor, getAccessor, getContentType, getDetailedPayloadLogMessage, getErrorChannel, getHeader, getId, getMessageHeaders, getMutableAccessor, getReplyChannel, getShortPayloadLogMessage, getTimestamp, isModified, isMutable, isReadableContentType, isReadOnly, removeHeader, removeHeaders, setErrorChannel, setErrorChannelName, setHeader, setHeaderIfAbsent, setLeaveMutable, setModified, setReplyChannel, setReplyChannelName, toMap, toMessageHeaders, toString, verifyType
- 
Field Details- 
STOMP_ID_HEADER- See Also:
 
- 
STOMP_HOST_HEADER- See Also:
 
- 
STOMP_ACCEPT_VERSION_HEADER- See Also:
 
- 
STOMP_MESSAGE_ID_HEADER- See Also:
 
- 
STOMP_RECEIPT_HEADER- See Also:
 
- 
STOMP_RECEIPT_ID_HEADER- See Also:
 
- 
STOMP_SUBSCRIPTION_HEADER- See Also:
 
- 
STOMP_VERSION_HEADER- See Also:
 
- 
STOMP_MESSAGE_HEADER- See Also:
 
- 
STOMP_ACK_HEADER- See Also:
 
- 
STOMP_NACK_HEADER- See Also:
 
- 
STOMP_LOGIN_HEADER- See Also:
 
- 
STOMP_PASSCODE_HEADER- See Also:
 
- 
STOMP_DESTINATION_HEADER- See Also:
 
- 
STOMP_CONTENT_TYPE_HEADER- See Also:
 
- 
STOMP_CONTENT_LENGTH_HEADER- See Also:
 
- 
STOMP_HEARTBEAT_HEADER- See Also:
 
 
- 
- 
Method Details- 
createAccessorDescription copied from class:MessageHeaderAccessorBuild a 'nested' accessor for the given message.- Overrides:
- createAccessorin class- SimpMessageHeaderAccessor
- Parameters:
- message- the message to build a new accessor for
- Returns:
- the nested accessor (typically a specific subclass)
 
- 
getNativeHeadersDescription copied from class:NativeMessageHeaderAccessorSubclasses can use this method to access the "native" headers sub-map.- Overrides:
- getNativeHeadersin class- NativeMessageHeaderAccessor
 
- 
updateStompCommandAsClientMessage
- 
updateStompCommandAsServerMessagepublic void updateStompCommandAsServerMessage()
- 
getCommandReturn the STOMP command, ornullif not yet set.
- 
isHeartbeatpublic boolean isHeartbeat()
- 
getHeartbeatpublic long[] getHeartbeat()
- 
setAcceptVersion
- 
getAcceptVersion
- 
setHost
- 
getHost
- 
setDestination- Overrides:
- setDestinationin class- SimpMessageHeaderAccessor
 
- 
setContentType- Overrides:
- setContentTypein class- MessageHeaderAccessor
 
- 
setSubscriptionId- Overrides:
- setSubscriptionIdin class- SimpMessageHeaderAccessor
 
- 
getContentLength
- 
setContentLengthpublic void setContentLength(int contentLength) 
- 
setHeartbeatpublic void setHeartbeat(long cx, long cy) 
- 
setAck
- 
getAck
- 
setNack
- 
getNack
- 
setLogin
- 
getLogin
- 
setPasscode
- 
getPasscodeReturn the passcode header value, ornullif not set.
- 
setReceiptId
- 
getReceiptId
- 
setReceipt
- 
getReceipt
- 
getMessage
- 
setMessage
- 
getMessageId
- 
setMessageId
- 
getVersion
- 
setVersion
- 
getShortLogMessageDescription copied from class:MessageHeaderAccessorReturn a concise message for logging purposes.- Overrides:
- getShortLogMessagein class- SimpMessageHeaderAccessor
- Parameters:
- payload- the payload that corresponds to the headers.
- Returns:
- the message
 
- 
getDetailedLogMessageDescription copied from class:MessageHeaderAccessorReturn a more detailed message for logging purposes.- Overrides:
- getDetailedLogMessagein class- SimpMessageHeaderAccessor
- Parameters:
- payload- the payload that corresponds to the headers.
- Returns:
- the message
 
- 
createCreate an instance for the given STOMP command.
- 
createCreate an instance for the given STOMP command and headers.
- 
createForHeartbeatCreate headers for a heartbeat. While a STOMP heartbeat frame does not have headers, a session id is needed for processing purposes at a minimum.
- 
wrapCreate an instance from the payload and headers of the given Message.
- 
getCommandReturn the STOMP command from the given headers, ornullif not set.
- 
getPasscodeReturn the passcode header value, ornullif not set.
- 
getContentLength
 
-