Top Description Fields Constructors Methods
io.undertow.websockets

public Class WebSocketProtocolHandshakeHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.server.HttpHandler, .HttpServerExchange, .HttpUpgradeListener, io.undertow.server.handlers.ResponseCodeHandler, io.undertow.util.Methods, io.undertow.websockets.core.WebSocketChannel, .WebSocketLogger, io.undertow.websockets.core.protocol.Handshake, io.undertow.websockets.core.protocol.version07.Hybi07Handshake, io.undertow.websockets.core.protocol.version08.Hybi08Handshake, io.undertow.websockets.core.protocol.version13.Hybi13Handshake, io.undertow.websockets.extensions.ExtensionHandshake, io.undertow.websockets.spi.AsyncWebSocketHttpServerExchange, org.xnio.StreamConnection, java.util.Collection, .Collections, .HashSet, .Set, java.util.concurrent.ConcurrentHashMap

HttpHandler which will process the HttpServerExchange and do the actual handshake/upgrade to WebSocket.
Author
Norman Maurer

Field Summary

Modifier and TypeField and Description
private final WebSocketConnectionCallback
private final Set<Handshake>
private final HttpHandler
next

The handler that is invoked if there are no web socket headers

private final Set<WebSocketChannel>
private final HttpUpgradeListener
upgradeListener

The upgrade listener.

Constructor Summary

AccessConstructor and Description
public
WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
,
final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(Collection<Handshake>
The supported handshake methods
handshakes
,
final WebSocketConnectionCallback
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(Collection<Handshake>
The supported handshake methods
handshakes
,
final WebSocketConnectionCallback
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
,
final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(final HttpUpgradeListener
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(final HttpUpgradeListener
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
,
final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(Collection<Handshake>
The supported handshake methods
handshakes
,
final HttpUpgradeListener
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
)

Create a new WebSocketProtocolHandshakeHandler

public
WebSocketProtocolHandshakeHandler(Collection<Handshake>
The supported handshake methods
handshakes
,
final HttpUpgradeListener
The WebSocketConnectionCallback which will be executed once the handshake was established
callback
,
final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

Method Summary

Modifier and TypeMethod and Description
public WebSocketProtocolHandshakeHandler

Returns:

current handler
addExtension
(ExtensionHandshake
a new ExtensionHandshake instance
extension
)

Add a new WebSocket Extension into the handshakes defined in this handler.

public Set<WebSocketChannel>
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private final WebSocketConnectionCallback callback
handshakesback to summary
private final Set<Handshake> handshakes
nextback to summary
private final HttpHandler next

The handler that is invoked if there are no web socket headers

peerConnectionsback to summary
private final Set<WebSocketChannel> peerConnections
upgradeListenerback to summary
private final HttpUpgradeListener upgradeListener

The upgrade listener. This will only be used if another web socket implementation is being layered on top.

Constructor Detail

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback callback)

Create a new WebSocketProtocolHandshakeHandler

Parameters
callback:WebSocketConnectionCallback

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback callback, final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

Parameters
callback:WebSocketConnectionCallback

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final WebSocketConnectionCallback callback)

Create a new WebSocketProtocolHandshakeHandler

Parameters
handshakes:Collection<Handshake>

The supported handshake methods

callback:WebSocketConnectionCallback

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final WebSocketConnectionCallback callback, final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

Parameters
handshakes:Collection<Handshake>

The supported handshake methods

callback:WebSocketConnectionCallback

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(final HttpUpgradeListener callback)

Create a new WebSocketProtocolHandshakeHandler

Parameters
callback:HttpUpgradeListener

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(final HttpUpgradeListener callback, final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

Parameters
callback:HttpUpgradeListener

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final HttpUpgradeListener callback)

Create a new WebSocketProtocolHandshakeHandler

Parameters
handshakes:Collection<Handshake>

The supported handshake methods

callback:HttpUpgradeListener

The WebSocketConnectionCallback which will be executed once the handshake was established

WebSocketProtocolHandshakeHandlerback to summary
public WebSocketProtocolHandshakeHandler(Collection<Handshake> handshakes, final HttpUpgradeListener callback, final HttpHandler next)

Create a new WebSocketProtocolHandshakeHandler

Parameters
handshakes:Collection<Handshake>

The supported handshake methods

callback:HttpUpgradeListener

The WebSocketConnectionCallback which will be executed once the handshake was established

Method Detail

addExtensionback to summary
public WebSocketProtocolHandshakeHandler addExtension(ExtensionHandshake extension)

Add a new WebSocket Extension into the handshakes defined in this handler.

Parameters
extension:ExtensionHandshake

a new ExtensionHandshake instance

Returns:WebSocketProtocolHandshakeHandler

current handler

getPeerConnectionsback to summary
public Set<WebSocketChannel> getPeerConnections()
handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override