@Test public void testApplyTo_application() { BaseApplication app = new BaseApplication("app"); app.getTerms() .putAll( ImmutableMap.of( "t1", new Term("t1"), "t2", new Term("t2"))); jc.getMasterLogicalSystem().getApplications().put("app", app); FwFromApplicationOrApplicationSet from = new FwFromApplicationOrApplicationSet("app"); 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, app.getTermTraceElement("t1")), new ExprAclLine( LineAction.PERMIT, new MatchHeaderSpace(HeaderSpace.builder().build()), null, app.getTermTraceElement("t2"))))); }
@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);  }