@Test public void testApplyTo_applicationSet() { ApplicationSet appSet = new ApplicationSet("appSet"); appSet.setMembers( ImmutableList.of(new ApplicationReference("app1"), new ApplicationReference("app2"))); jc.getMasterLogicalSystem().getApplicationSets().put("appSet", appSet); BaseApplication app1 = new BaseApplication("app1"); BaseApplication app2 = new BaseApplication("app2"); jc.getMasterLogicalSystem() .getApplications() .putAll(ImmutableMap.of("app1", app1, "app2", app2)); FwFromApplicationOrApplicationSet from = new FwFromApplicationOrApplicationSet("appSet"); List<ExprAclLine> lines = new ArrayList<>(); HeaderSpace.Builder hsBuilder = HeaderSpace.builder(); from.applyTo(jc, hsBuilder, LineAction.PERMIT, lines, null); assertThat( lines, equalTo( ImmutableList.of( new ExprAclLine( LineAction.PERMIT, new MatchHeaderSpace(HeaderSpace.builder().build()), null, app1.getTermTraceElement(null)), new ExprAclLine( LineAction.PERMIT, new MatchHeaderSpace(HeaderSpace.builder().build()), null, app2.getTermTraceElement(null))))); }
@Override public void applyTo( JuniperConfiguration jc, HeaderSpace.Builder srcHeaderSpaceBuilder, LineAction action, List<? super ExprAclLine> lines, Warnings w) { ApplicationSetMember application = jc.getMasterLogicalSystem().getApplications().get(_applicationOrApplicationSetName); if (application == null) { application = jc.getMasterLogicalSystem().getApplicationSets().get(_applicationOrApplicationSetName); } if (application != null) { application.applyTo(jc, srcHeaderSpaceBuilder, action, lines, w); } }
FwFromApplicationOrApplicationSet implements FwFromApplicationSetMember { @Override public void applyTo( JuniperConfiguration jc, HeaderSpace.Builder srcHeaderSpaceBuilder, LineAction action, List<? super ExprAclLine> lines, Warnings w) { ApplicationSetMember application = jc.getMasterLogicalSystem().getApplications().get(_applicationOrApplicationSetName); if (application == null) { application = jc.getMasterLogicalSystem().getApplicationSets().get(_applicationOrApplicationSetName); } if (application != null) { application.applyTo(jc, srcHeaderSpaceBuilder, action, lines, w); } } }
FwFromApplicationOrApplicationSet implements FwFromApplicationSetMember { @Override public void applyTo( JuniperConfiguration jc, HeaderSpace.Builder srcHeaderSpaceBuilder, LineAction action, List<? super ExprAclLine> lines, Warnings w) { ApplicationSetMember application = jc.getMasterLogicalSystem().getApplications().get(_applicationOrApplicationSetName); if (application == null) { application = jc.getMasterLogicalSystem().getApplicationSets().get(_applicationOrApplicationSetName); } if (application != null) { application.applyTo(jc, srcHeaderSpaceBuilder, action, lines, w); } } FwFromApplicationOrApplicationSet(String applicationOrApplicationSetName); }
FwFromApplicationOrApplicationSet implements FwFromApplicationSetMember { @Override public void applyTo( JuniperConfiguration jc, HeaderSpace.Builder srcHeaderSpaceBuilder, LineAction action, List<? super ExprAclLine> lines, Warnings w) { ApplicationSetMember application = jc.getMasterLogicalSystem().getApplications().get(_applicationOrApplicationSetName); if (application == null) { application = jc.getMasterLogicalSystem().getApplicationSets().get(_applicationOrApplicationSetName); } if (application != null) { application.applyTo(jc, srcHeaderSpaceBuilder, action, lines, w); } } FwFromApplicationOrApplicationSet(String applicationOrApplicationSetName); @Override void applyTo(
      JuniperConfiguration jc,
      HeaderSpace.Builder srcHeaderSpaceBuilder,
      LineAction action,
      List<? super ExprAclLine> lines,
      Warnings w); @Override AclLineMatchExpr toAclLineMatchExpr(JuniperConfiguration jc, Warnings w); }
FwFromApplicationOrApplicationSet implements FwFromApplicationSetMember { @Override public void applyTo( JuniperConfiguration jc, HeaderSpace.Builder srcHeaderSpaceBuilder, LineAction action, List<? super ExprAclLine> lines, Warnings w) { ApplicationSetMember application = jc.getMasterLogicalSystem().getApplications().get(_applicationOrApplicationSetName); if (application == null) { application = jc.getMasterLogicalSystem().getApplicationSets().get(_applicationOrApplicationSetName); } if (application != null) { application.applyTo(jc, srcHeaderSpaceBuilder, action, lines, w); } } FwFromApplicationOrApplicationSet(String applicationOrApplicationSetName); @Override void applyTo(
      JuniperConfiguration jc,
      HeaderSpace.Builder srcHeaderSpaceBuilder,
      LineAction action,
      List<? super ExprAclLine> lines,
      Warnings w); @Override AclLineMatchExpr toAclLineMatchExpr(JuniperConfiguration jc, Warnings w);  }