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

public Class ServerUpgradeRequestImpl

extends Wrapper
implements ServerUpgradeRequest
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest, org.eclipse.jetty.server.Request, org.eclipse.jetty.io.Content.Source, org.eclipse.jetty.util.Attributes
Imports
java.util.List, .Set, org.eclipse.jetty.http.BadMessageException, .HttpHeader, org.eclipse.jetty.server.Request, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.websocket.core.ExtensionConfig, .WebSocketComponents, .WebSocketConstants, org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest

Upgrade request used for websocket negotiation. Provides getters for things like the requested extensions and subprotocols so that the headers don't have to be parsed manually.

Field Summary

Modifier and TypeField and Description
private final Attributes
private final WebSocketNegotiation
private final Request
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public Object
public Set<String>
public List<ExtensionConfig>
public String
getProtocolVersion()

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getProtocolVersion.

Returns: WebSocket protocol version from "Sec-WebSocket-Version" header

public List<String>
getSubProtocols()

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getSubProtocols.

Returns: Get WebSocket negotiation offered sub protocols

public WebSocketComponents
public boolean
hasSubProtocol(String
A sub protocol name
subprotocol
)

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.hasSubProtocol.

Returns: True if the sub protocol was offered

public Object
public Object
setAttribute(String
the attribute to set
name
,
Object
the value to set. A null value is equivalent to removing the attribute.
attribute
)

Overrides org.eclipse.jetty.server.Request.Wrapper.setAttribute.

Implements org.eclipse.jetty.util.Attributes.setAttribute.

Set an attribute

public void
Inherited from org.eclipse.jetty.server.Request.Wrapper:
addFailureListeneraddHttpStreamWrapperaddIdleTimeoutListenerasAttributeMapconsumeAvailabledemandfailgetBeginNanoTimegetComponentsgetConnectionMetaDatagetContextgetHeadersgetHeadersNanoTimegetHttpURIgetIdgetLengthgetMethodgetSessiongetTrailersgetTunnelSupportgetWrappedisSecurepushread

Field Detail

attributesback to summary
private final Attributes attributes
negotiationback to summary
private final WebSocketNegotiation negotiation
requestback to summary
private final Request request
upgradedback to summary
private boolean upgraded

Constructor Detail

ServerUpgradeRequestImplback to summary
public ServerUpgradeRequestImpl(WebSocketNegotiation negotiation, Request baseRequest) throws BadMessageException

Method Detail

clearAttributesback to summary
public void clearAttributes()

Overrides org.eclipse.jetty.server.Request.Wrapper.clearAttributes.

Overrides default org.eclipse.jetty.util.Attributes.clearAttributes.

Doc from org.eclipse.jetty.util.Attributes.clearAttributes.

Clear all attribute names

Annotations
@Override
getAttributeback to summary
public Object getAttribute(String name)

Overrides org.eclipse.jetty.server.Request.Wrapper.getAttribute.

Implements org.eclipse.jetty.util.Attributes.getAttribute.

Doc from org.eclipse.jetty.util.Attributes.getAttribute.

Get an attribute

Parameters
name:String

the attribute to get

Returns:Object

the value of the attribute

Annotations
@Override
getAttributeNameSetback to summary
public Set<String> getAttributeNameSet()

Overrides org.eclipse.jetty.server.Request.Wrapper.getAttributeNameSet.

Implements org.eclipse.jetty.util.Attributes.getAttributeNameSet.

Doc from org.eclipse.jetty.util.Attributes.getAttributeNameSet.

Get the immutable set of attribute names.

Returns:Set<String>

Set of attribute names

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

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getExtensions.

Returns:List<ExtensionConfig>

The extensions offered

Annotations
@Override
getProtocolVersionback to summary
public String getProtocolVersion()

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getProtocolVersion.

Returns:String

WebSocket protocol version from "Sec-WebSocket-Version" header

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

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getSubProtocols.

Returns:List<String>

Get WebSocket negotiation offered sub protocols

Annotations
@Override
getWebSocketComponentsback to summary
public WebSocketComponents getWebSocketComponents()

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.getWebSocketComponents.

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

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.hasSubProtocol.

Parameters
subprotocol:String

A sub protocol name

Returns:boolean

True if the sub protocol was offered

Annotations
@Override
removeAttributeback to summary
public Object removeAttribute(String name)

Overrides org.eclipse.jetty.server.Request.Wrapper.removeAttribute.

Implements org.eclipse.jetty.util.Attributes.removeAttribute.

Doc from org.eclipse.jetty.util.Attributes.removeAttribute.

Remove an attribute

Parameters
name:String

the attribute to remove

Returns:Object

the value of the attribute if removed, else null

Annotations
@Override
setAttributeback to summary
public Object setAttribute(String name, Object attribute)

Overrides org.eclipse.jetty.server.Request.Wrapper.setAttribute.

Implements org.eclipse.jetty.util.Attributes.setAttribute.

Doc from org.eclipse.jetty.util.Attributes.setAttribute.

Set an attribute

Parameters
name:String

the attribute to set

attribute:Object

the value to set. A null value is equivalent to removing the attribute.

Returns:Object

the previous value of the attribute if set, else null

Annotations
@Override
upgradeback to summary
public void upgrade(Attributes attributes)

Implements org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest.upgrade.

Annotations
@Override