Top Fields Constructors Methods
org.eclipse.jetty.websocket.server.internal

pack-priv Class UpgradeRequestDelegate

extends Object
implements UpgradeRequest
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.websocket.api.UpgradeRequest
Imports
java.net.HttpCookie, .URI, java.security.Principal, java.util.LinkedHashMap, .List, .Map, java.util.stream.Collectors, org.eclipse.jetty.http.HttpField, .HttpFields, .HttpHeader, .HttpScheme, .HttpURI, org.eclipse.jetty.server.Request, org.eclipse.jetty.util.Fields, org.eclipse.jetty.websocket.api.ExtensionConfig, .UpgradeRequest, org.eclipse.jetty.websocket.common.JettyExtensionConfig, org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest

Field Summary

Modifier and TypeField and Description
private final ServerUpgradeRequest

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public List<HttpCookie>
getCookies()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getCookies.

Get the list of Cookies on the Upgrade request

public List<ExtensionConfig>
getExtensions()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getExtensions.

Get the list of WebSocket Extension Configurations for this Upgrade Request.

public String
getHeader(String
the name of the header
name
)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeader.

Get a specific Header value from Upgrade Request

public int
getHeaderInt(String
the name of the header
name
)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaderInt.

Get the specific Header value, as an int, from the Upgrade Request.

public Map<String, List<String>>
getHeaders()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Get the headers as a Map of keys to value lists.

public List<String>
getHeaders(String
the header name
name
)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Get the specific header values (for multi-value headers)

public String
getHost()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHost.

The host of the Upgrade Request URI

public String
getHttpVersion()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHttpVersion.

The HTTP version used for this Upgrade Request

As of RFC6455 (December 2011) this is always HTTP/1.1

public String
getMethod()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getMethod.

The HTTP method for this Upgrade Request.

public String
getOrigin()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getOrigin.

The WebSocket Origin of this Upgrade Request

See RFC6455: Section 10.2 for details.

public Map<String, List<String>>
getParameterMap()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getParameterMap.

Returns a map of the query parameters of the request.

public String
getProtocolVersion()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getProtocolVersion.

Get the WebSocket Protocol Version

As of RFC6455, Jetty only supports version 13

public String
getQueryString()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getQueryString.

Get the Query String of the request URI.

public URI
public List<String>
getSubProtocols()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getSubProtocols.

Get the list of offered WebSocket sub-protocols.

public Principal
getUserPrincipal()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getUserPrincipal.

Get the User Principal for this request.

public boolean
hasSubProtocol(String
the sub-protocol to test for
subProtocol
)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.hasSubProtocol.

Test if a specific sub-protocol is offered

public boolean
isSecure()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.isSecure.

Test if connection is secure.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

requestback to summary
private final ServerUpgradeRequest request

Constructor Detail

UpgradeRequestDelegateback to summary
pack-priv UpgradeRequestDelegate(ServerUpgradeRequest request)

Method Detail

getCookiesback to summary
public List<HttpCookie> getCookies()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getCookies.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getCookies.

Get the list of Cookies on the Upgrade request

Returns:List<HttpCookie>

the list of Cookies

Annotations
@Override
getExtensionsback to summary
public List<ExtensionConfig> getExtensions()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getExtensions.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getExtensions.

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:List<ExtensionConfig>

the list of Extension configurations (in the order they were specified)

Annotations
@Override
getHeaderback to summary
public String getHeader(String name)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeader.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHeader.

Get a specific Header value from Upgrade Request

Parameters
name:String

the name of the header

Returns:String

the value of the header (null if header does not exist)

Annotations
@Override
getHeaderIntback to summary
public int getHeaderInt(String name)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaderInt.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaderInt.

Get the specific Header value, as an int, from the Upgrade Request.

Parameters
name:String

the name of the header

Returns:int

the value of the header as an int (-1 if header does not exist)

Annotations
@Override
getHeadersback to summary
public Map<String, List<String>> getHeaders()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Get the headers as a Map of keys to value lists.

Returns:Map<String, List<String>>

the headers

Annotations
@Override
getHeadersback to summary
public List<String> getHeaders(String name)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHeaders.

Get the specific header values (for multi-value headers)

Parameters
name:String

the header name

Returns:List<String>

the value list (null if no header exists)

Annotations
@Override
getHostback to summary
public String getHost()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHost.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHost.

The host of the Upgrade Request URI

Returns:String

host of the request URI

Annotations
@Override
getHttpVersionback to summary
public String getHttpVersion()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getHttpVersion.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getHttpVersion.

The HTTP version used for this Upgrade Request

As of RFC6455 (December 2011) this is always HTTP/1.1

Returns:String

the HTTP Version used

Annotations
@Override
getMethodback to summary
public String getMethod()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getMethod.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getMethod.

The HTTP method for this Upgrade Request.

As of RFC6455 (December 2011) this is always GET

Returns:String

the HTTP method used

Annotations
@Override
getOriginback to summary
public String getOrigin()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getOrigin.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getOrigin.

The WebSocket Origin of this Upgrade Request

See RFC6455: Section 10.2 for details.

Equivalent to getHeader(String) passed the "Origin" header.

Returns:String

the Origin header

Annotations
@Override
getParameterMapback to summary
public Map<String, List<String>> getParameterMap()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getParameterMap.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getParameterMap.

Returns a map of the query parameters of the request.

Returns:Map<String, List<String>>

a unmodifiable map of query parameters of the request.

Annotations
@Override
getProtocolVersionback to summary
public String getProtocolVersion()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getProtocolVersion.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getProtocolVersion.

Get the WebSocket Protocol Version

As of RFC6455, Jetty only supports version 13

Returns:String

the WebSocket protocol version

Annotations
@Override
getQueryStringback to summary
public String getQueryString()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getQueryString.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getQueryString.

Get the Query String of the request URI.

Returns:String

the request uri query string

Annotations
@Override
getRequestURIback to summary
public URI getRequestURI()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getRequestURI.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getRequestURI.

Get the Request URI

Returns:URI

the request URI

Annotations
@Override
getSubProtocolsback to summary
public List<String> getSubProtocols()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getSubProtocols.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getSubProtocols.

Get the list of offered WebSocket sub-protocols.

Returns:List<String>

the list of offered sub-protocols

Annotations
@Override
getUserPrincipalback to summary
public Principal getUserPrincipal()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.getUserPrincipal.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.getUserPrincipal.

Get the User Principal for this request.

Only applicable when using UpgradeRequest from server side.

Returns:Principal

the user principal

Annotations
@Override
hasSubProtocolback to summary
public boolean hasSubProtocol(String subProtocol)

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.hasSubProtocol.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.hasSubProtocol.

Test if a specific sub-protocol is offered

Parameters
subProtocol:String

the sub-protocol to test for

Returns:boolean

true if sub-protocol exists on request

Annotations
@Override
isSecureback to summary
public boolean isSecure()

Implements org.eclipse.jetty.websocket.api.UpgradeRequest.isSecure.

Doc from org.eclipse.jetty.websocket.api.UpgradeRequest.isSecure.

Test if connection is secure.

Returns:boolean

true if connection is secure.

Annotations
@Override