WebSocketSession#getAttributes().
Copies a subset or all HTTP session attributes and/or the HTTP session ID
under the key HTTP_SESSION_ID_ATTR_NAME.
| Modifier and Type | Field and Description |
|---|---|
| private final Collection | |
| private boolean | |
| private boolean | |
| private boolean | |
| public static final String | HTTP_SESSION_ID_ATTR_NAME
The name of the attribute under which the HTTP session id is exposed when
|
| Access | Constructor and Description |
|---|---|
| public | HttpSessionHandshakeInterceptor()
Default constructor for copying all HTTP session attributes and the HTTP session id. |
| public | HttpSessionHandshakeInterceptor(Collection<String>
session attributes to copy attributeNames)Constructor for copying specific HTTP session attributes and the HTTP session id. |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterHandshake(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, WebSocketHandler the target WebSocket handler wsHandler, Exception an exception raised during the handshake, or ex)null if noneImplements org. Invoked after the handshake is done. |
| public boolean | beforeHandshake(ServerHttpRequest
the current request request, ServerHttpResponse the current response response, WebSocketHandler the target WebSocket handler wsHandler, Map<String, Object> the attributes from the HTTP handshake to associate with the WebSocket
session; the provided attributes are copied, the original map is not used. attributes)Implements org. Invoked before the handshake is processed. |
| public Collection | |
| private HttpSession | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | setCopyAllAttributes(boolean
whether to copy all attributes copyAllAttributes)Whether to copy all attributes from the HTTP session. |
| public void | setCopyHttpSessionId(boolean
whether to copy the HTTP session id. copyHttpSessionId)Whether the HTTP session id should be copied to the handshake attributes
under the key |
| public void | setCreateSession(boolean createSession)
Whether to allow the HTTP session to be created while accessing it. |
| attributeNames | back to summary |
|---|---|
| private final Collection<String> attributeNames | |
| copyAllAttributes | back to summary |
|---|---|
| private boolean copyAllAttributes | |
| copyHttpSessionId | back to summary |
|---|---|
| private boolean copyHttpSessionId | |
| createSession | back to summary |
|---|---|
| private boolean createSession | |
| HTTP_SESSION_ID_ATTR_NAME | back to summary |
|---|---|
| public static final String HTTP_SESSION_ID_ATTR_NAME The name of the attribute under which the HTTP session id is exposed when
| |
| HttpSessionHandshakeInterceptor | back to summary |
|---|---|
| public HttpSessionHandshakeInterceptor() Default constructor for copying all HTTP session attributes and the HTTP session id.
| |
| HttpSessionHandshakeInterceptor | back to summary |
|---|---|
| public HttpSessionHandshakeInterceptor(Collection<String> attributeNames) Constructor for copying specific HTTP session attributes and the HTTP session id.
| |
| afterHandshake | back to summary |
|---|---|
| public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception ex) Implements org. Doc from org. Invoked after the handshake is done. The response status and headers indicate the results of the handshake, i.e. whether it was successful or not.
| |
| beforeHandshake | back to summary |
|---|---|
| public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception Implements org. Doc from org. Invoked before the handshake is processed.
| |
| getAttributeNames | back to summary |
|---|---|
| public Collection Return the configured attribute names to copy (read-only). | |
| getSession | back to summary |
|---|---|
private HttpSession getSession(ServerHttpRequest request)
| |
| isCopyAllAttributes | back to summary |
|---|---|
| public boolean isCopyAllAttributes() Whether to copy all HTTP session attributes. | |
| isCopyHttpSessionId | back to summary |
|---|---|
| public boolean isCopyHttpSessionId() Whether to copy the HTTP session id to the handshake attributes. | |
| isCreateSession | back to summary |
|---|---|
| public boolean isCreateSession() Whether the HTTP session is allowed to be created. | |
| setCopyAllAttributes | back to summary |
|---|---|
| public void setCopyAllAttributes(boolean copyAllAttributes) Whether to copy all attributes from the HTTP session. If set to "true", any explicitly configured attribute names are ignored. By default this is set to either "true" or "false" depending on which constructor was used (default or with attribute names respectively).
| |
| setCopyHttpSessionId | back to summary |
|---|---|
| public void setCopyHttpSessionId(boolean copyHttpSessionId) Whether the HTTP session id should be copied to the handshake attributes
under the key By default this is "true".
| |
| setCreateSession | back to summary |
|---|---|
| public void setCreateSession(boolean createSession) Whether to allow the HTTP session to be created while accessing it. By default set to | |