public class HandshakeInfo
extends java.lang.Object
WebSocketSession
session.WebSocketSession.getHandshakeInfo()
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
attributes |
private HttpHeaders |
headers |
private java.lang.String |
logPrefix |
private <any> |
principalMono |
private java.lang.String |
protocol |
private java.net.InetSocketAddress |
remoteAddress |
private java.net.URI |
uri |
Constructor and Description |
---|
HandshakeInfo(java.net.URI uri,
HttpHeaders headers,
<any> principal,
java.lang.String protocol)
Constructor with basic information about the handshake.
|
HandshakeInfo(java.net.URI uri,
HttpHeaders headers,
<any> principal,
java.lang.String protocol,
java.net.InetSocketAddress remoteAddress,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.lang.String logPrefix)
Constructor targetting server-side use with extra information about the
handshake, the remote address, and a pre-existing log prefix for
correlation.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Attributes extracted from the handshake request to be added to the
WebSocket session.
|
HttpHeaders |
getHeaders()
Return the handshake HTTP headers.
|
java.lang.String |
getLogPrefix()
A log prefix used in the handshake to correlate log messages, if any.
|
<any> |
getPrincipal()
Return the principal associated with the handshake HTTP request.
|
java.net.InetSocketAddress |
getRemoteAddress()
For a server-side session this is the remote address where the handshake
request came from.
|
java.lang.String |
getSubProtocol()
The sub-protocol negotiated at handshake time, or
null if none. |
java.net.URI |
getUri()
Return the URL for the WebSocket endpoint.
|
java.lang.String |
toString() |
private final java.net.URI uri
private final <any> principalMono
private final HttpHeaders headers
@Nullable private final java.lang.String protocol
@Nullable private final java.net.InetSocketAddress remoteAddress
private final java.util.Map<java.lang.String,java.lang.Object> attributes
@Nullable private final java.lang.String logPrefix
public HandshakeInfo(java.net.URI uri, HttpHeaders headers, <any> principal, @Nullable java.lang.String protocol)
uri
- the endpoint URLheaders
- request headers for server or response headers or clientprincipal
- the principal for the sessionprotocol
- the negotiated sub-protocol (may be null
)public HandshakeInfo(java.net.URI uri, HttpHeaders headers, <any> principal, @Nullable java.lang.String protocol, @Nullable java.net.InetSocketAddress remoteAddress, java.util.Map<java.lang.String,java.lang.Object> attributes, @Nullable java.lang.String logPrefix)
uri
- the endpoint URLheaders
- request headers for server or response headers or clientprincipal
- the principal for the sessionprotocol
- the negotiated sub-protocol (may be null
)remoteAddress
- the remote address where the handshake came fromattributes
- initial attributes to use for the WebSocket sessionlogPrefix
- log prefix used during the handshake for correlating log
messages, if any.public java.net.URI getUri()
public HttpHeaders getHeaders()
public <any> getPrincipal()
@Nullable public java.lang.String getSubProtocol()
null
if none.@Nullable public java.net.InetSocketAddress getRemoteAddress()
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
@Nullable public java.lang.String getLogPrefix()
null
if not specifiedpublic java.lang.String toString()
toString
in class java.lang.Object