@Test public void testAcl() { IpAccessList.Builder aclBuilder = IpAccessList.builder().setName("foo"); IpAccessList acl = aclBuilder.setLines(ImmutableList.of(ExprAclLine.ACCEPT_ALL)).build(); Map<String, IpAccessList> namedAcls = ImmutableMap.of(); assertThat(referencedSources(namedAcls, acl), empty()); acl = aclBuilder .setLines( ImmutableList.of( accepting().setMatchCondition(matchSrcInterface("a")).build(), rejecting().setMatchCondition(matchSrcInterface("b")).build(), accepting().setMatchCondition(matchSrcInterface("c")).build())) .build(); assertThat(referencedSources(namedAcls, acl), containsInAnyOrder("a", "b", "c")); }
public static Set<String> referencedSources( Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr) { ReferenceSourcesVisitor visitor = new ReferenceSourcesVisitor(namedAcls); visitor.visit(expr); return visitor.referencedInterfaces(); }
SourcesReferencedByIpAccessLists { public static Set<String> referencedSources( Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr) { ReferenceSourcesVisitor visitor = new ReferenceSourcesVisitor(namedAcls); visitor.visit(expr); return visitor.referencedInterfaces(); } }
SourcesReferencedByIpAccessLists { public static Set<String> referencedSources( Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr) { ReferenceSourcesVisitor visitor = new ReferenceSourcesVisitor(namedAcls); visitor.visit(expr); return visitor.referencedInterfaces(); }  }
SourcesReferencedByIpAccessLists { public static Set<String> referencedSources( Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr) { ReferenceSourcesVisitor visitor = new ReferenceSourcesVisitor(namedAcls); visitor.visit(expr); return visitor.referencedInterfaces(); }  static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr); static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, IpAccessList acl); static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, Set<String> acls); }
SourcesReferencedByIpAccessLists { public static Set<String> referencedSources( Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr) { ReferenceSourcesVisitor visitor = new ReferenceSourcesVisitor(namedAcls); visitor.visit(expr); return visitor.referencedInterfaces(); }  static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, AclLineMatchExpr expr); static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, IpAccessList acl); static Set<String> referencedSources(
      Map<String, IpAccessList> namedAcls, Set<String> acls); static final String SOURCE_ORIGINATING_FROM_DEVICE; }