Class DelegatedServerUpgradeRequest
java.lang.Object
org.eclipse.jetty.websocket.server.internal.DelegatedServerUpgradeRequest
- All Implemented Interfaces:
UpgradeRequest
,JettyServerUpgradeRequest
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the list of Cookies on the Upgrade requestGet the list of WebSocket Extension Configurations for this Upgrade Request.Get a specific Header value from Upgrade Requestint
getHeaderInt
(String name) Get the specific Header value, as anint
, from the Upgrade Request.Get the headers as a Map of keys to value lists.getHeaders
(String name) Get the specific header values (for multi-value headers)getHost()
The host of the Upgrade Request URIjakarta.servlet.http.HttpServletRequest
The HTTP version used for this Upgrade RequestThe HTTP method for this Upgrade Request.The WebSocket Origin of this Upgrade RequestReturns a map of the query parameters of the request.Get the WebSocket Protocol VersionGet the Query String of the request URI.Get the Request URIgetServletAttribute
(String name) jakarta.servlet.http.HttpSession
Access the Servlet HTTP Session (if present)Get the list of offered WebSocket sub-protocols.Get the User Principal for this request.boolean
hasSubProtocol
(String subprotocol) Test if a specific sub-protocol is offeredboolean
isSecure()
Test if connection is secure.boolean
isUserInRole
(String role) void
setServletAttribute
(String name, Object value)
-
Constructor Details
-
DelegatedServerUpgradeRequest
-
-
Method Details
-
getCookies
Description copied from interface:UpgradeRequest
Get the list of Cookies on the Upgrade request- Specified by:
getCookies
in interfaceUpgradeRequest
- Returns:
- the list of Cookies
-
getExtensions
Description copied from interface:UpgradeRequest
Get the list of WebSocket Extension Configurations for this Upgrade Request.This is merely the list of requested Extensions to use, see
UpgradeResponse.getExtensions()
for what was negotiated- Specified by:
getExtensions
in interfaceUpgradeRequest
- Returns:
- the list of Extension configurations (in the order they were specified)
-
getHeader
Description copied from interface:UpgradeRequest
Get a specific Header value from Upgrade Request- Specified by:
getHeader
in interfaceUpgradeRequest
- Parameters:
name
- the name of the header- Returns:
- the value of the header (null if header does not exist)
-
getHeaderInt
Description copied from interface:UpgradeRequest
Get the specific Header value, as anint
, from the Upgrade Request.- Specified by:
getHeaderInt
in interfaceUpgradeRequest
- Parameters:
name
- the name of the header- Returns:
- the value of the header as an
int
(-1 if header does not exist)
-
getHeaders
Description copied from interface:UpgradeRequest
Get the headers as a Map of keys to value lists.- Specified by:
getHeaders
in interfaceUpgradeRequest
- Returns:
- the headers
-
getHeaders
Description copied from interface:UpgradeRequest
Get the specific header values (for multi-value headers)- Specified by:
getHeaders
in interfaceUpgradeRequest
- Parameters:
name
- the header name- Returns:
- the value list (null if no header exists)
-
getHost
Description copied from interface:UpgradeRequest
The host of the Upgrade Request URI- Specified by:
getHost
in interfaceUpgradeRequest
- Returns:
- host of the request URI
-
getHttpVersion
Description copied from interface:UpgradeRequest
The HTTP version used for this Upgrade RequestAs of RFC6455 (December 2011) this is always
HTTP/1.1
- Specified by:
getHttpVersion
in interfaceUpgradeRequest
- Returns:
- the HTTP Version used
-
getMethod
Description copied from interface:UpgradeRequest
The HTTP method for this Upgrade Request.As of RFC6455 (December 2011) this is always
GET
- Specified by:
getMethod
in interfaceUpgradeRequest
- Returns:
- the HTTP method used
-
getOrigin
Description copied from interface:UpgradeRequest
The WebSocket Origin of this Upgrade RequestSee RFC6455: Section 10.2 for details.
Equivalent to
UpgradeRequest.getHeader(String)
passed the "Origin" header.- Specified by:
getOrigin
in interfaceUpgradeRequest
- Returns:
- the Origin header
-
getParameterMap
Description copied from interface:UpgradeRequest
Returns a map of the query parameters of the request.- Specified by:
getParameterMap
in interfaceUpgradeRequest
- Returns:
- a unmodifiable map of query parameters of the request.
-
getProtocolVersion
Description copied from interface:UpgradeRequest
Get the WebSocket Protocol VersionAs of RFC6455, Jetty only supports version
13
- Specified by:
getProtocolVersion
in interfaceUpgradeRequest
- Returns:
- the WebSocket protocol version
-
getQueryString
Description copied from interface:UpgradeRequest
Get the Query String of the request URI.- Specified by:
getQueryString
in interfaceUpgradeRequest
- Returns:
- the request uri query string
-
getRequestURI
Description copied from interface:UpgradeRequest
Get the Request URI- Specified by:
getRequestURI
in interfaceUpgradeRequest
- Returns:
- the request URI
-
getSession
public jakarta.servlet.http.HttpSession getSession()Description copied from interface:JettyServerUpgradeRequest
Access the Servlet HTTP Session (if present)Note: Never present on a Client UpgradeRequest.
- Specified by:
getSession
in interfaceJettyServerUpgradeRequest
- Returns:
- the Servlet HTTPSession on server side UpgradeRequests
-
getSubProtocols
Description copied from interface:UpgradeRequest
Get the list of offered WebSocket sub-protocols.- Specified by:
getSubProtocols
in interfaceUpgradeRequest
- Returns:
- the list of offered sub-protocols
-
getUserPrincipal
Description copied from interface:UpgradeRequest
Get the User Principal for this request.Only applicable when using UpgradeRequest from server side.
- Specified by:
getUserPrincipal
in interfaceUpgradeRequest
- Returns:
- the user principal
-
hasSubProtocol
Description copied from interface:UpgradeRequest
Test if a specific sub-protocol is offered- Specified by:
hasSubProtocol
in interfaceUpgradeRequest
- Parameters:
subprotocol
- the sub-protocol to test for- Returns:
- true if sub-protocol exists on request
-
isSecure
public boolean isSecure()Description copied from interface:UpgradeRequest
Test if connection is secure.- Specified by:
isSecure
in interfaceUpgradeRequest
- Returns:
- true if connection is secure.
-
getCertificates
- Specified by:
getCertificates
in interfaceJettyServerUpgradeRequest
- Returns:
- The
X509Certificate
instance at request attribute "jakarta.servlet.request.X509Certificate" or null.
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()- Specified by:
getHttpServletRequest
in interfaceJettyServerUpgradeRequest
- Returns:
- Immutable version of
HttpServletRequest
-
getLocale
- Specified by:
getLocale
in interfaceJettyServerUpgradeRequest
- Returns:
- The requested Locale
- See Also:
-
ServletRequest.getLocale()
-
getLocales
- Specified by:
getLocales
in interfaceJettyServerUpgradeRequest
- Returns:
- The requested Locales
- See Also:
-
ServletRequest.getLocales()
-
getLocalSocketAddress
- Specified by:
getLocalSocketAddress
in interfaceJettyServerUpgradeRequest
- Returns:
- The local requested address, which is typically an
InetSocketAddress
, but may be another derivation ofSocketAddress
- See Also:
-
ServletRequest.getLocalAddr()
ServletRequest.getLocalPort()
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddress
in interfaceJettyServerUpgradeRequest
- Returns:
- The remote request address, which is typically an
InetSocketAddress
, but may be another derivation ofSocketAddress
- See Also:
-
ServletRequest.getRemoteAddr()
ServletRequest.getRemotePort()
-
getRequestPath
- Specified by:
getRequestPath
in interfaceJettyServerUpgradeRequest
- Returns:
- The request URI path within the context
-
getServletAttribute
- Specified by:
getServletAttribute
in interfaceJettyServerUpgradeRequest
- Parameters:
name
- Attribute name- Returns:
- Attribute value or null
- See Also:
-
ServletRequest.getAttribute(String)
-
getServletAttributes
- Specified by:
getServletAttributes
in interfaceJettyServerUpgradeRequest
- Returns:
- Request attribute map
-
getServletParameters
- Specified by:
getServletParameters
in interfaceJettyServerUpgradeRequest
- Returns:
- Request parameters
- See Also:
-
ServletRequest.getParameterMap()
-
isUserInRole
- Specified by:
isUserInRole
in interfaceJettyServerUpgradeRequest
- Parameters:
role
- The user role- Returns:
- True if the requests user has the role
- See Also:
-
HttpServletRequest.isUserInRole(String)
-
setServletAttribute
- Specified by:
setServletAttribute
in interfaceJettyServerUpgradeRequest
- Parameters:
name
- Attribute namevalue
- Attribute value to set- See Also:
-
ServletRequest.setAttribute(String, Object)
-