Search in sources :

Example 1 with StaticBodyHttpHandler

use of com.hotels.styx.common.http.handler.StaticBodyHttpHandler in project styx by ExpediaGroup.

the class AdminServerBuilder method extensionEndpoints.

private static List<Route> extensionEndpoints(String root, String name, Map<String, HttpHandler> endpoints) {
    List<AdminEndpointRoute> routes = extensionAdminEndpointRoutes(root, name, endpoints);
    List<IndexHandler.Link> endpointLinks = routes.stream().map(AdminEndpointRoute::link).collect(toList());
    WebServiceHandler handler = endpointLinks.isEmpty() ? new StaticBodyHttpHandler(HTML, format("This plugin (%s) does not expose any admin interfaces", name)) : new IndexHandler(endpointLinks);
    Route indexRoute = new Route(adminPath(root, name), new HttpAggregator(MEGABYTE, handler));
    return concatenate(indexRoute, routes);
}
Also used : StaticBodyHttpHandler(com.hotels.styx.common.http.handler.StaticBodyHttpHandler) IndexHandler(com.hotels.styx.admin.handlers.IndexHandler) HttpAggregator(com.hotels.styx.common.http.handler.HttpAggregator) WebServiceHandler(com.hotels.styx.api.WebServiceHandler)

Aggregations

IndexHandler (com.hotels.styx.admin.handlers.IndexHandler)1 WebServiceHandler (com.hotels.styx.api.WebServiceHandler)1 HttpAggregator (com.hotels.styx.common.http.handler.HttpAggregator)1 StaticBodyHttpHandler (com.hotels.styx.common.http.handler.StaticBodyHttpHandler)1