public class SimpMessageHeaderAccessor extends NativeMessageHeaderAccessor
Use one of the static factory method in this class, then call getters and setters,
and at the end if necessary call NativeMessageHeaderAccessor.toMap()
to obtain the updated headers.
Modifier and Type | Field and Description |
---|---|
static String |
CONNECT_MESSAGE_HEADER |
static String |
DESTINATION_HEADER |
static String |
MESSAGE_TYPE_HEADER |
static String |
SESSION_ID_HEADER |
static String |
SUBSCRIPTION_ID_HEADER |
static String |
USER_HEADER |
NATIVE_HEADERS
logger
Modifier | Constructor and Description |
---|---|
protected |
SimpMessageHeaderAccessor(Message<?> message)
A constructor for accessing and modifying existing message headers.
|
protected |
SimpMessageHeaderAccessor(SimpMessageType messageType,
Map<String,List<String>> externalSourceHeaders)
A constructor for creating new message headers.
|
Modifier and Type | Method and Description |
---|---|
static SimpMessageHeaderAccessor |
create()
|
static SimpMessageHeaderAccessor |
create(SimpMessageType messageType)
Create
SimpMessageHeaderAccessor for a new Message of a specific type. |
String |
getDestination() |
SimpMessageType |
getMessageType() |
String |
getSessionId() |
String |
getSubscriptionId() |
Principal |
getUser() |
void |
setDestination(String destination) |
void |
setMessageTypeIfNotSet(SimpMessageType messageType) |
void |
setSessionId(String sessionId) |
void |
setSubscriptionId(String subscriptionId) |
void |
setUser(Principal principal) |
static SimpMessageHeaderAccessor |
wrap(Message<?> message)
Create
SimpMessageHeaderAccessor from the headers of an existing message. |
addNativeHeader, getFirstNativeHeader, getNativeHeader, isModified, setNativeHeader, toMap, toNativeHeaderMap
copyHeaders, copyHeadersIfAbsent, getContentType, getErrorChannel, getHeader, getId, getReplyChannel, getTimestamp, isReadOnly, removeHeader, removeHeaders, setContentType, setErrorChannel, setErrorChannelName, setHeader, setHeaderIfAbsent, setReplyChannel, setReplyChannelName, toString, verifyType
public static final String CONNECT_MESSAGE_HEADER
public static final String DESTINATION_HEADER
public static final String MESSAGE_TYPE_HEADER
public static final String SESSION_ID_HEADER
public static final String SUBSCRIPTION_ID_HEADER
public static final String USER_HEADER
protected SimpMessageHeaderAccessor(SimpMessageType messageType, Map<String,List<String>> externalSourceHeaders)
protected SimpMessageHeaderAccessor(Message<?> message)
public static SimpMessageHeaderAccessor create()
public static SimpMessageHeaderAccessor create(SimpMessageType messageType)
SimpMessageHeaderAccessor
for a new Message
of a specific type.public static SimpMessageHeaderAccessor wrap(Message<?> message)
SimpMessageHeaderAccessor
from the headers of an existing message.public void setMessageTypeIfNotSet(SimpMessageType messageType)
public SimpMessageType getMessageType()
public void setDestination(String destination)
public String getDestination()
public String getSubscriptionId()
public void setSubscriptionId(String subscriptionId)
public String getSessionId()
public void setSessionId(String sessionId)
public Principal getUser()
public void setUser(Principal principal)