use of org.webpieces.router.impl.FilterInfo in project webpieces by deanhiller.
the class R1RouterBuilder method findMatchingFilters.
public List<FilterInfo<?>> findMatchingFilters(String path, boolean isHttps) {
List<FilterInfo<?>> matchingFilters = new ArrayList<>();
for (FilterInfo<?> info : routeFilters) {
if (!info.securityMatch(isHttps))
//skip this filter
continue;
Pattern patternToMatch = info.getPatternToMatch();
Matcher matcher = patternToMatch.matcher(path);
if (matcher.matches()) {
matchingFilters.add(0, info);
}
}
return matchingFilters;
}
use of org.webpieces.router.impl.FilterInfo in project webpieces by deanhiller.
the class R1RouterBuilder method applyFilters.
public void applyFilters(WebAppMeta rm) {
ReverseRoutes reverseRoutes = holder.getReverseRoutes();
Collection<RouteMeta> metas = reverseRoutes.getAllRouteMetas();
for (RouteMeta meta : metas) {
String path = meta.getRoute().getFullPath();
List<FilterInfo<?>> filters = findMatchingFilters(path, meta.getRoute().isHttpsRoute());
meta.setFilters(filters);
}
List<L2DomainRoutes> allDomains = allRouting.getAllDomains();
for (L2DomainRoutes domainRoutes : allDomains) {
applyFilters(domainRoutes, rm);
}
}
Aggregations