Package io.undertow.server.handlers
Class NameVirtualHostHandler
- java.lang.Object
-
- io.undertow.server.handlers.NameVirtualHostHandler
-
- All Implemented Interfaces:
HttpHandler
public class NameVirtualHostHandler extends java.lang.Object implements HttpHandler
AHttpHandlerthat implements virtual hosts based on theHost:http header header.- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description NameVirtualHostHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameVirtualHostHandleraddHost(java.lang.String host, HttpHandler handler)HttpHandlergetDefaultHandler()java.util.Map<java.lang.String,HttpHandler>getHosts()voidhandleRequest(HttpServerExchange exchange)Handle the request.NameVirtualHostHandlerremoveHost(java.lang.String host)NameVirtualHostHandlersetDefaultHandler(HttpHandler defaultHandler)
-
-
-
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
-
getDefaultHandler
public HttpHandler getDefaultHandler()
-
getHosts
public java.util.Map<java.lang.String,HttpHandler> getHosts()
-
setDefaultHandler
public NameVirtualHostHandler setDefaultHandler(HttpHandler defaultHandler)
-
addHost
public NameVirtualHostHandler addHost(java.lang.String host, HttpHandler handler)
-
removeHost
public NameVirtualHostHandler removeHost(java.lang.String host)
-
-