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 used to initiate the WebSocket handshake.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringABNF from RFC 2616, RFC 822, and RFC 6455 specified characters requiring quoting. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.ClientUpgradeRequest(URI uri) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtensions(String... configs) Add WebSocket Extension Configuration(s) to requestvoidaddExtensions(org.eclipse.jetty.websocket.api.ExtensionConfig... configs) Add WebSocket Extension Configuration(s) to Upgrade Request.List<org.eclipse.jetty.websocket.api.ExtensionConfig> intgetHeaderInt(String name) getHeaders(String name) getHost()getTag()longbooleanhasSubProtocol(String test) booleanisSecure()static StringjoinValues(List<String> values) voidsetCookies(List<HttpCookie> cookies) Set the list of Cookies on the requestvoidsetExtensions(List<org.eclipse.jetty.websocket.api.ExtensionConfig> configs) Set the list of WebSocket Extension configurations on the request.voidSet a specific header valuevoidSet a specific header with multi-value fieldvoidsetHeaders(Map<String, List<String>> headers) Sets multiple headers on the request.voidsetHttpVersion(String httpVersion) Set the HTTP Version to use for the websocket upgrade.voidsetSubProtocols(String... protocols) Set the offered WebSocket Sub-Protocol list.voidsetSubProtocols(List<String> protocols) Set the offered WebSocket Sub-Protocol list.voidsetTimeout(long timeout, TimeUnit unit) voidTags this request with the given metadata tag.
-
Field Details
-
ABNF_REQUIRED_QUOTING
ABNF from RFC 2616, RFC 822, and RFC 6455 specified characters requiring quoting.- See Also:
-
-
Constructor Details
-
ClientUpgradeRequest
Deprecated, for removal: This API element is subject to removal in a future version.useClientUpgradeRequest(URI)instead. -
ClientUpgradeRequest
-
-
Method Details
-
getCookies
- Specified by:
getCookiesin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getExtensions
- Specified by:
getExtensionsin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeader
-
getHeaderInt
- Specified by:
getHeaderIntin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getHeaders
-
getHeaders
-
getHost
- Specified by:
getHostin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getMethod
- Specified by:
getMethodin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getOrigin
- Specified by:
getOriginin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getParameterMap
-
getProtocolVersion
- Specified by:
getProtocolVersionin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getQueryString
- Specified by:
getQueryStringin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getRequestURI
- Specified by:
getRequestURIin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
getSubProtocols
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
hasSubProtocol
- Specified by:
hasSubProtocolin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecurein 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
-
setHeader
-
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
-
getHttpVersion
- Specified by:
getHttpVersionin interfaceorg.eclipse.jetty.websocket.api.UpgradeRequest
-
setHttpVersion
Set the HTTP Version to use for the websocket upgrade.- Parameters:
httpVersion- the HTTP version to use.
-
setSubProtocols
-
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
-
tag
Tags this request with the given metadata tag.
- Parameters:
tag- the metadata to tag the request with- See Also:
-
getTag
- Returns:
- the metadata this request has been tagged with
- See Also:
-
joinValues
-
ClientUpgradeRequest(URI)instead.