Package io.undertow.websockets
Class WebSocketProtocolHandshakeHandler
- java.lang.Object
-
- io.undertow.websockets.WebSocketProtocolHandshakeHandler
-
- All Implemented Interfaces:
HttpHandler
public class WebSocketProtocolHandshakeHandler extends java.lang.Object implements HttpHandler
HttpHandlerwhich will process theHttpServerExchangeand do the actual handshake/upgrade to WebSocket.- Author:
- Norman Maurer
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketProtocolHandshakeHandleraddExtension(ExtensionHandshake extension)Add a new WebSocket Extension into the handshakes defined in this handler.java.util.Set<WebSocketChannel>getPeerConnections()voidhandleRequest(HttpServerExchange exchange)Handle the request.
-
-
-
Constructor Detail
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(WebSocketConnectionCallback callback)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(WebSocketConnectionCallback callback, HttpHandler next)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(java.util.Collection<Handshake> handshakes, WebSocketConnectionCallback callback)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(java.util.Collection<Handshake> handshakes, WebSocketConnectionCallback callback, HttpHandler next)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(HttpUpgradeListener callback)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(HttpUpgradeListener callback, HttpHandler next)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
callback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(java.util.Collection<Handshake> handshakes, HttpUpgradeListener callback)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
WebSocketProtocolHandshakeHandler
public WebSocketProtocolHandshakeHandler(java.util.Collection<Handshake> handshakes, HttpUpgradeListener callback, HttpHandler next)
Create a newWebSocketProtocolHandshakeHandler- Parameters:
handshakes- The supported handshake methodscallback- TheWebSocketConnectionCallbackwhich will be executed once the handshake was established
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws java.lang.Exception
Description copied from interface:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
java.lang.Exception
-
getPeerConnections
public java.util.Set<WebSocketChannel> getPeerConnections()
-
addExtension
public WebSocketProtocolHandshakeHandler addExtension(ExtensionHandshake extension)
Add a new WebSocket Extension into the handshakes defined in this handler.- Parameters:
extension- a newExtensionHandshakeinstance- Returns:
- current handler
-
-