Package net.solarnetwork.web.support
Class RequestInfoHandshakeInterceptor
java.lang.Object
net.solarnetwork.web.support.RequestInfoHandshakeInterceptor
- All Implemented Interfaces:
org.springframework.web.socket.server.HandshakeInterceptor
public class RequestInfoHandshakeInterceptor
extends Object
implements org.springframework.web.socket.server.HandshakeInterceptor
HandshakeInterceptor that populates properties from the connection as
message headers.- Since:
- 1.14
- Version:
- 1.1
- Author:
- matt
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Exception exception) booleanbeforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) Populate request information as session attributes.
-
Field Details
-
REQUEST_URI_ATTR
The attribute name for theURIof the HTTP request.- See Also:
-
REQUEST_HEADERS
The attribute name for theHttpHeadersof the HTTP request.- See Also:
-
-
Constructor Details
-
RequestInfoHandshakeInterceptor
public RequestInfoHandshakeInterceptor()
-
-
Method Details
-
beforeHandshake
public boolean beforeHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Map<String, Object> attributes) throws ExceptionPopulate request information as session attributes.The following attributes will be populated:
- requestUri
- The
URIof the HTTP request.
- Specified by:
beforeHandshakein interfaceorg.springframework.web.socket.server.HandshakeInterceptor- Throws:
Exception
-
afterHandshake
public void afterHandshake(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response, org.springframework.web.socket.WebSocketHandler wsHandler, Exception exception) - Specified by:
afterHandshakein interfaceorg.springframework.web.socket.server.HandshakeInterceptor
-