Package io.undertow.server.handlers
Class ChannelUpgradeHandler
java.lang.Object
io.undertow.server.handlers.ChannelUpgradeHandler
- All Implemented Interfaces:
HttpHandler
An HTTP request handler which upgrades the HTTP request and hands it off as a socket to any XNIO consumer.
- Author:
- David M. Lloyd, Stuart Douglas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProtocol(String productString, HttpUpgradeListener openListener) Add a protocol to this handler.voidaddProtocol(String productString, HttpUpgradeListener openListener, HttpUpgradeHandshake handshake) Add a protocol to this handler.voidaddProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener) Add a protocol to this handler.voidaddProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener, HttpUpgradeHandshake handshake) Add a protocol to this handler.Get the non-upgrade delegate handler.voidhandleRequest(HttpServerExchange exchange) Handle the request.voidremoveProtocol(String productString) Remove a protocol from this handler.voidremoveProtocol(String productString, HttpUpgradeListener upgradeListener) Remove a protocol from this handler.voidremoveProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener) Remove a protocol from this handler.setNonUpgradeHandler(HttpHandler nonUpgradeHandler) Set the non-upgrade delegate handler.
-
Constructor Details
-
ChannelUpgradeHandler
public ChannelUpgradeHandler()
-
-
Method Details
-
addProtocol
public void addProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener, HttpUpgradeHandshake handshake) Add a protocol to this handler.- Parameters:
productString- the product string to matchopenListener- the open listener to callhandshake- a handshake implementation that can be used to verify the client request and modify the response
-
addProtocol
public void addProtocol(String productString, HttpUpgradeListener openListener, HttpUpgradeHandshake handshake) Add a protocol to this handler.- Parameters:
productString- the product string to matchopenListener- the open listener to callhandshake- a handshake implementation that can be used to verify the client request and modify the response
-
addProtocol
public void addProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener) Add a protocol to this handler.- Parameters:
productString- the product string to matchopenListener- the open listener to call
-
addProtocol
Add a protocol to this handler.- Parameters:
productString- the product string to matchopenListener- the open listener to call
-
removeProtocol
Remove a protocol from this handler. This will remove all upgrade handlers that match the product string- Parameters:
productString- the product string to match
-
removeProtocol
public void removeProtocol(String productString, org.xnio.ChannelListener<? super org.xnio.StreamConnection> openListener) Remove a protocol from this handler.- Parameters:
productString- the product string to matchopenListener- The open listener
-
removeProtocol
Remove a protocol from this handler.- Parameters:
productString- the product string to matchupgradeListener- The upgrade listener
-
getNonUpgradeHandler
Get the non-upgrade delegate handler.- Returns:
- the non-upgrade delegate handler
-
setNonUpgradeHandler
Set the non-upgrade delegate handler.- Parameters:
nonUpgradeHandler- the non-upgrade delegate handler
-
handleRequest
Description copied from interface:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-