Package io.undertow.server.handlers
Class NameVirtualHostHandler
- java.lang.Object
-
- io.undertow.server.handlers.NameVirtualHostHandler
-
- All Implemented Interfaces:
HttpHandler
public class NameVirtualHostHandler extends 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(String host, HttpHandler handler)HttpHandlergetDefaultHandler()Map<String,HttpHandler>getHosts()voidhandleRequest(HttpServerExchange exchange)Handle the request.NameVirtualHostHandlerremoveHost(String host)NameVirtualHostHandlersetDefaultHandler(HttpHandler defaultHandler)
-
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
getDefaultHandler
public HttpHandler getDefaultHandler()
-
getHosts
public Map<String,HttpHandler> getHosts()
-
setDefaultHandler
public NameVirtualHostHandler setDefaultHandler(HttpHandler defaultHandler)
-
addHost
public NameVirtualHostHandler addHost(String host, HttpHandler handler)
-
removeHost
public NameVirtualHostHandler removeHost(String host)
-
-