Class ClientUpgradeRequest
java.lang.Object
org.eclipse.jetty.websocket.client.ClientUpgradeRequest
- All Implemented Interfaces:
org.eclipse.jetty.websocket.api.UpgradeRequest
public final class ClientUpgradeRequest
extends Object
implements org.eclipse.jetty.websocket.api.UpgradeRequest
Client based UpgradeRequest API
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ABNF from RFC 2616, RFC 822, and RFC 6455 specified characters requiring quoting. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtensions
(String... configs) Add WebSocket Extension Configuration(s) to requestvoid
addExtensions
(org.eclipse.jetty.websocket.api.ExtensionConfig... configs) Add WebSocket Extension Configuration(s) to Upgrade Request.List
<org.eclipse.jetty.websocket.api.ExtensionConfig> int
getHeaderInt
(String name) getHeaders
(String name) getHost()
long
boolean
hasSubProtocol
(String test) boolean
isSecure()
static String
joinValues
(List<String> values) void
setCookies
(List<HttpCookie> cookies) Set the list of Cookies on the requestvoid
setExtensions
(List<org.eclipse.jetty.websocket.api.ExtensionConfig> configs) Set the list of WebSocket Extension configurations on the request.void
Set a specific header valuevoid
Set a specific header with multi-value fieldvoid
setHeaders
(Map<String, List<String>> headers) Sets multiple headers on the request.void
setSubProtocols
(String... protocols) Set the offered WebSocket Sub-Protocol list.void
setSubProtocols
(List<String> protocols) Set the offered WebSocket Sub-Protocol list.void
setTimeout
(long timeout, TimeUnit unit)
-
Field Details
-
ABNF_REQUIRED_QUOTING
ABNF from RFC 2616, RFC 822, and RFC 6455 specified characters requiring quoting.- See Also:
-
-
Constructor Details
-
ClientUpgradeRequest
public ClientUpgradeRequest() -
ClientUpgradeRequest
Deprecated.useClientUpgradeRequest()
instead.
-
-
Method Details
-
getCookies
- Specified by:
getCookies
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getExtensions
- Specified by:
getExtensions
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeader
- Specified by:
getHeader
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeaderInt
- Specified by:
getHeaderInt
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeaders
- Specified by:
getHeaders
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeaders
- Specified by:
getHeaders
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHost
- Specified by:
getHost
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHttpVersion
- Specified by:
getHttpVersion
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getMethod
- Specified by:
getMethod
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getOrigin
- Specified by:
getOrigin
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getProtocolVersion
- Specified by:
getProtocolVersion
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getQueryString
- Specified by:
getQueryString
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getRequestURI
- Specified by:
getRequestURI
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getSubProtocols
- Specified by:
getSubProtocols
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
hasSubProtocol
- Specified by:
hasSubProtocol
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
addExtensions
public void addExtensions(org.eclipse.jetty.websocket.api.ExtensionConfig... configs) 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
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
-
setCookies
Set the list of Cookies on the request- Parameters:
cookies
- the cookies to use
-
setExtensions
Set the list of WebSocket Extension configurations on the request.- Parameters:
configs
- the list of extension configurations
-
setHeader
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
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
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
-
setSubProtocols
Set the offered WebSocket Sub-Protocol list.- Parameters:
protocols
- the offered sub-protocol list
-
setSubProtocols
Set the offered WebSocket Sub-Protocol list.- Parameters:
protocols
- the offered sub-protocol list
-
setTimeout
- Parameters:
timeout
- the total timeout for the request/response conversation of the WebSocket handshake; use zero or a negative value to disable the timeoutunit
- the timeout unit
-
getTimeout
public long getTimeout()- Returns:
- the total timeout for this request, in milliseconds; zero or negative if the timeout is disabled
-
joinValues
-
ClientUpgradeRequest()
instead.