for(Route route :routes){
Map<String, MatchPair> rule = RouteRule.parseRule(route.getMatchRule());
MatchPair pair = rule.get("consumer.host");
if(pair != null){
for(String host : pair.getMatches()){
Access access = new Access();
access.setAddress(host);
access.setService(route.getService());
access.setAllow(false);
accesses.add(access);
}
for(String host : pair.getUnmatches()){
Access access = new Access();
access.setAddress(host);
access.setService(route.getService());
access.setAllow(true);
accesses.add(access);
}
}
}
context.put("accesses", accesses);