Search in sources :

Example 11 with RouteMeta

use of org.webpieces.router.impl.RouteMeta in project webpieces by deanhiller.

the class R1RouterBuilder method applyFilters.

private void applyFilters(L2DomainRoutes domainRoutes, WebAppMeta rm) {
    String domain = domainRoutes.getDomain();
    if (domain == null)
        domain = "ALLOTHER";
    RouteMeta notFoundMeta = domainRoutes.getPageNotFoundRoute();
    RouteMeta internalErrorMeta = domainRoutes.getInternalSvrErrorRoute();
    if (notFoundMeta == null)
        throw new IllegalStateException("router.setNotFoundRoute MUST be called for domain=" + domain + "  Modules=" + rm.getRouteModules());
    else if (internalErrorMeta == null)
        throw new IllegalStateException("router.setInternalSvrErrorRoute MUST be called for domain=" + domain + ".  Modules=" + rm.getRouteModules());
    internalErrorMeta.setFilters(internalErrorFilters);
    notFoundMeta.setFilters(notFoundFilters);
}
Also used : RouteMeta(org.webpieces.router.impl.RouteMeta)

Aggregations

RouteMeta (org.webpieces.router.impl.RouteMeta)11 RouterRequest (org.webpieces.ctx.api.RouterRequest)2 Method (java.lang.reflect.Method)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 HttpMethod (org.webpieces.ctx.api.HttpMethod)1 Action (org.webpieces.router.api.actions.Action)1 MethodMeta (org.webpieces.router.api.dto.MethodMeta)1 RedirectResponse (org.webpieces.router.api.dto.RedirectResponse)1 IllegalReturnValueException (org.webpieces.router.api.exceptions.IllegalReturnValueException)1 FilterInfo (org.webpieces.router.impl.FilterInfo)1 NotFoundInfo (org.webpieces.router.impl.NotFoundInfo)1 ReverseRoutes (org.webpieces.router.impl.ReverseRoutes)1 Route (org.webpieces.router.impl.Route)1 RouteImpl (org.webpieces.router.impl.RouteImpl)1 StaticRoute (org.webpieces.router.impl.StaticRoute)1 UrlPath (org.webpieces.router.impl.UrlPath)1 HaveRouteException (org.webpieces.router.impl.loader.HaveRouteException)1 MatchResult (org.webpieces.router.impl.model.MatchResult)1 RouteModuleInfo (org.webpieces.router.impl.model.RouteModuleInfo)1