@Test public void buildVppAclTest() { AccessListWrapper aclWrapper = new IngressAccessListWrapper(); aclWrapper.writeRule(rule1); String key1 = "key1"; Acl acl = aclWrapper.buildVppAcl(new InterfaceKey(key1)); Assert.assertEquals(VppAcl.class, acl.getAclType()); Assert.assertEquals(key1 + ACE_DIRECTION.INGRESS, acl.getAclName()); Assert.assertEquals(1, acl.getAccessListEntries().getAce().size()); }
public Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey) { List<Ace> aces = new ArrayList<>(); for (GbpAceBuilder rule : rules) { aces.add(rule.build()); } AccessListEntries entries = new AccessListEntriesBuilder().setAce(aces).build(); return new AclBuilder().setAclType(VppAcl.class) .setAclName(resolveAclName(ifaceKey)) .setAccessListEntries(entries) .build(); }
AccessListWrapper { public Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey) { List<Ace> aces = new ArrayList<>(); for (GbpAceBuilder rule : rules) { aces.add(rule.build()); } AccessListEntries entries = new AccessListEntriesBuilder().setAce(aces).build(); return new AclBuilder().setAclType(VppAcl.class) .setAclName(resolveAclName(ifaceKey)) .setAccessListEntries(entries) .build(); } }
AccessListWrapper { public Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey) { List<Ace> aces = new ArrayList<>(); for (GbpAceBuilder rule : rules) { aces.add(rule.build()); } AccessListEntries entries = new AccessListEntriesBuilder().setAce(aces).build(); return new AclBuilder().setAclType(VppAcl.class) .setAclName(resolveAclName(ifaceKey)) .setAccessListEntries(entries) .build(); } AccessListWrapper(); }
AccessListWrapper { public Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey) { List<Ace> aces = new ArrayList<>(); for (GbpAceBuilder rule : rules) { aces.add(rule.build()); } AccessListEntries entries = new AccessListEntriesBuilder().setAce(aces).build(); return new AclBuilder().setAclType(VppAcl.class) .setAclName(resolveAclName(ifaceKey)) .setAccessListEntries(entries) .build(); } AccessListWrapper(); void writeRule(@Nullable GbpAceBuilder rule); void writeRules(@Nullable List<GbpAceBuilder> rules); List<GbpAceBuilder> readRules(); abstract AccessListUtil.ACE_DIRECTION getDirection(); abstract void writeAclRefOnIface(@Nonnull InstanceIdentifier<Node> vppIid,
            @Nonnull InstanceIdentifier<Interface> ifaceIid); Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey); void writeAcl(@Nonnull InstanceIdentifier<Node> vppIid, @Nonnull InterfaceKey ifaceKey); static void removeAclsForInterface(@Nonnull InstanceIdentifier<Node> vppIid,
            @Nonnull InterfaceKey ifaceKey); static void removeAclRefFromIface(@Nonnull InstanceIdentifier<Node> vppIid, @Nonnull InterfaceKey ifaceKey); }
AccessListWrapper { public Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey) { List<Ace> aces = new ArrayList<>(); for (GbpAceBuilder rule : rules) { aces.add(rule.build()); } AccessListEntries entries = new AccessListEntriesBuilder().setAce(aces).build(); return new AclBuilder().setAclType(VppAcl.class) .setAclName(resolveAclName(ifaceKey)) .setAccessListEntries(entries) .build(); } AccessListWrapper(); void writeRule(@Nullable GbpAceBuilder rule); void writeRules(@Nullable List<GbpAceBuilder> rules); List<GbpAceBuilder> readRules(); abstract AccessListUtil.ACE_DIRECTION getDirection(); abstract void writeAclRefOnIface(@Nonnull InstanceIdentifier<Node> vppIid,
            @Nonnull InstanceIdentifier<Interface> ifaceIid); Acl buildVppAcl(@Nonnull InterfaceKey ifaceKey); void writeAcl(@Nonnull InstanceIdentifier<Node> vppIid, @Nonnull InterfaceKey ifaceKey); static void removeAclsForInterface(@Nonnull InstanceIdentifier<Node> vppIid,
            @Nonnull InterfaceKey ifaceKey); static void removeAclRefFromIface(@Nonnull InstanceIdentifier<Node> vppIid, @Nonnull InterfaceKey ifaceKey);  }