Interface UpgradeRequest
-
- All Known Implementing Classes:
ClientUpgradeRequest
,ServletUpgradeRequest
,ServletWebSocketRequest
,UpgradeRequestAdapter
@Deprecated(since="2021-05-27") public interface UpgradeRequest
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.The HTTP Upgrade to WebSocket Request
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addExtensions(java.lang.String... configs)
Deprecated.Add WebSocket Extension Configuration(s) to requestvoid
addExtensions(ExtensionConfig... configs)
Deprecated.Add WebSocket Extension Configuration(s) to Upgrade Request.void
clearHeaders()
Deprecated.(no longer supported, as this can undo the required upgrade request headers)java.util.List<java.net.HttpCookie>
getCookies()
Deprecated.Get the list of Cookies on the Upgrade requestjava.util.List<ExtensionConfig>
getExtensions()
Deprecated.Get the list of WebSocket Extension Configurations for this Upgrade Request.java.lang.String
getHeader(java.lang.String name)
Deprecated.Get a specific Header value from Upgrade Requestint
getHeaderInt(java.lang.String name)
Deprecated.Get the specific Header value, as anint
, from the Upgrade Request.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaders()
Deprecated.Get the headers as a Map of keys to value lists.java.util.List<java.lang.String>
getHeaders(java.lang.String name)
Deprecated.Get the specific header values (for multi-value headers)java.lang.String
getHost()
Deprecated.The host of the Upgrade Request URIjava.lang.String
getHttpVersion()
Deprecated.The HTTP version used for this Upgrade Requestjava.lang.String
getMethod()
Deprecated.The HTTP method for this Upgrade Request.java.lang.String
getOrigin()
Deprecated.The WebSocket Origin of this Upgrade Requestjava.util.Map<java.lang.String,java.util.List<java.lang.String>>
getParameterMap()
Deprecated.Returns a map of the query parameters of the request.java.lang.String
getProtocolVersion()
Deprecated.Get the WebSocket Protocol Versionjava.lang.String
getQueryString()
Deprecated.Get the Query String of the request URI.java.net.URI
getRequestURI()
Deprecated.Get the Request URIjava.lang.Object
getSession()
Deprecated.Access the Servlet HTTP Session (if present)java.util.List<java.lang.String>
getSubProtocols()
Deprecated.Get the list of offered WebSocket sub-protocols.java.security.Principal
getUserPrincipal()
Deprecated.Get the User Principal for this request.boolean
hasSubProtocol(java.lang.String test)
Deprecated.Test if a specific sub-protocol is offeredboolean
isOrigin(java.lang.String test)
Deprecated.Test if supplied Origin is the same as the Requestboolean
isSecure()
Deprecated.Test if connection is secure.void
setCookies(java.util.List<java.net.HttpCookie> cookies)
Deprecated.Set the list of Cookies on the requestvoid
setExtensions(java.util.List<ExtensionConfig> configs)
Deprecated.Set the list of WebSocket Extension configurations on the request.void
setHeader(java.lang.String name, java.lang.String value)
Deprecated.Set a specific header valuevoid
setHeader(java.lang.String name, java.util.List<java.lang.String> values)
Deprecated.Set a specific header with multi-value fieldvoid
setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Deprecated.Sets multiple headers on the request.void
setHttpVersion(java.lang.String httpVersion)
Deprecated.Set the HTTP Version to use.void
setMethod(java.lang.String method)
Deprecated.Set the HTTP method to use.void
setRequestURI(java.net.URI uri)
Deprecated.Set the Request URI to use for this request.void
setSession(java.lang.Object session)
Deprecated.Set the Session associated with this request.void
setSubProtocols(java.lang.String... protocols)
Deprecated.Set the offered WebSocket Sub-Protocol list.void
setSubProtocols(java.util.List<java.lang.String> protocols)
Deprecated.Set the offered WebSocket Sub-Protocol list.
-
-
-
Method Detail
-
addExtensions
void addExtensions(ExtensionConfig... configs)
Deprecated.Add WebSocket Extension Configuration(s) to Upgrade Request.This is merely the list of requested Extensions to use, see
UpgradeResponse.getExtensions()
for what was negotiated- Parameters:
configs
- the configuration(s) to add
-
addExtensions
void addExtensions(java.lang.String... configs)
Deprecated.Add WebSocket Extension Configuration(s) to requestThis is merely the list of requested Extensions to use, see
UpgradeResponse.getExtensions()
for what was negotiated- Parameters:
configs
- the configuration(s) to add
-
clearHeaders
@Deprecated void clearHeaders()
Deprecated.(no longer supported, as this can undo the required upgrade request headers)Remove all headers from request.
-
getCookies
java.util.List<java.net.HttpCookie> getCookies()
Deprecated.Get the list of Cookies on the Upgrade request- Returns:
- the list of Cookies
-
getExtensions
java.util.List<ExtensionConfig> getExtensions()
Deprecated.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- Returns:
- the list of Extension configurations (in the order they were specified)
-
getHeader
java.lang.String getHeader(java.lang.String name)
Deprecated.Get a specific Header value from Upgrade Request- Parameters:
name
- the name of the header- Returns:
- the value of the header (null if header does not exist)
-
getHeaderInt
int getHeaderInt(java.lang.String name)
Deprecated.Get the specific Header value, as anint
, from the Upgrade Request.- Parameters:
name
- the name of the header- Returns:
- the value of the header as an
int
(-1 if header does not exist) - Throws:
java.lang.NumberFormatException
- if unable to parse value as an int.
-
getHeaders
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
Deprecated.Get the headers as a Map of keys to value lists.- Returns:
- the headers
-
getHeaders
java.util.List<java.lang.String> getHeaders(java.lang.String name)
Deprecated.Get the specific header values (for multi-value headers)- Parameters:
name
- the header name- Returns:
- the value list (null if no header exists)
-
getHost
java.lang.String getHost()
Deprecated.The host of the Upgrade Request URI- Returns:
- host of the request URI
-
getHttpVersion
java.lang.String getHttpVersion()
Deprecated.The HTTP version used for this Upgrade RequestAs of RFC6455 (December 2011) this is always
HTTP/1.1
- Returns:
- the HTTP Version used
-
getMethod
java.lang.String getMethod()
Deprecated.The HTTP method for this Upgrade Request.As of RFC6455 (December 2011) this is always
GET
- Returns:
- the HTTP method used
-
getOrigin
java.lang.String getOrigin()
Deprecated.The WebSocket Origin of this Upgrade RequestSee RFC6455: Section 10.2 for details.
Equivalent to
getHeader(String)
passed the "Origin" header.- Returns:
- the Origin header
-
getParameterMap
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterMap()
Deprecated.Returns a map of the query parameters of the request.- Returns:
- a unmodifiable map of query parameters of the request.
-
getProtocolVersion
java.lang.String getProtocolVersion()
Deprecated.Get the WebSocket Protocol VersionAs of RFC6455, Jetty only supports version
13
- Returns:
- the WebSocket protocol version
-
getQueryString
java.lang.String getQueryString()
Deprecated.Get the Query String of the request URI.- Returns:
- the request uri query string
-
getRequestURI
java.net.URI getRequestURI()
Deprecated.Get the Request URI- Returns:
- the request URI
-
getSession
java.lang.Object getSession()
Deprecated.Access the Servlet HTTP Session (if present)Note: Never present on a Client UpgradeRequest.
- Returns:
- the Servlet HTTPSession on server side UpgradeRequests
-
getSubProtocols
java.util.List<java.lang.String> getSubProtocols()
Deprecated.Get the list of offered WebSocket sub-protocols.- Returns:
- the list of offered sub-protocols
-
getUserPrincipal
java.security.Principal getUserPrincipal()
Deprecated.Get the User Principal for this request.Only applicable when using UpgradeRequest from server side.
- Returns:
- the user principal
-
hasSubProtocol
boolean hasSubProtocol(java.lang.String test)
Deprecated.Test if a specific sub-protocol is offered- Parameters:
test
- the sub-protocol to test for- Returns:
- true if sub-protocol exists on request
-
isOrigin
boolean isOrigin(java.lang.String test)
Deprecated.Test if supplied Origin is the same as the Request- Parameters:
test
- the supplied origin- Returns:
- true if the supplied origin matches the request origin
-
isSecure
boolean isSecure()
Deprecated.Test if connection is secure.- Returns:
- true if connection is secure.
-
setCookies
void setCookies(java.util.List<java.net.HttpCookie> cookies)
Deprecated.Set the list of Cookies on the request- Parameters:
cookies
- the cookies to use
-
setExtensions
void setExtensions(java.util.List<ExtensionConfig> configs)
Deprecated.Set the list of WebSocket Extension configurations on the request.- Parameters:
configs
- the list of extension configurations
-
setHeader
void setHeader(java.lang.String name, java.util.List<java.lang.String> values)
Deprecated.Set a specific header with multi-value fieldOverrides any previous value for this named header
- Parameters:
name
- the name of the headervalues
- the multi-value field
-
setHeader
void setHeader(java.lang.String name, java.lang.String value)
Deprecated.Set a specific header valueOverrides any previous value for this named header
- Parameters:
name
- the header to setvalue
- the value to set it to
-
setHeaders
void setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Deprecated.Sets multiple headers on the request.Only sets those headers provided, does not remove headers that exist on request and are not provided in the parameter for this method.
Convenience method vs calling
setHeader(String, List)
multiple times.- Parameters:
headers
- the headers to set
-
setHttpVersion
void setHttpVersion(java.lang.String httpVersion)
Deprecated.Set the HTTP Version to use.As of RFC6455 (December 2011) this should always be
HTTP/1.1
- Parameters:
httpVersion
- the HTTP version to use.
-
setMethod
void setMethod(java.lang.String method)
Deprecated.Set the HTTP method to use.As of RFC6455 (December 2011) this is always
GET
- Parameters:
method
- the HTTP method to use.
-
setRequestURI
void setRequestURI(java.net.URI uri)
Deprecated.Set the Request URI to use for this request.Must be an absolute URI with scheme
'ws'
or'wss'
- Parameters:
uri
- the Request URI
-
setSession
void setSession(java.lang.Object session)
Deprecated.Set the Session associated with this request.Typically used to associate the Servlet HttpSession object.
- Parameters:
session
- the session object to associate with this request
-
setSubProtocols
void setSubProtocols(java.util.List<java.lang.String> protocols)
Deprecated.Set the offered WebSocket Sub-Protocol list.- Parameters:
protocols
- the offered sub-protocol list
-
setSubProtocols
void setSubProtocols(java.lang.String... protocols)
Deprecated.Set the offered WebSocket Sub-Protocol list.- Parameters:
protocols
- the offered sub-protocol list
-
-