@Test public void testTransformIntraAreaRouteOnImport() { final OspfIntraAreaRoute.Builder builder = OspfIntraAreaRoute.builder() .setArea(0) .setNetwork(Prefix.parse("1.1.1.1/29")) .setMetric(1) .setNonRouting(true) .setNonForwarding(true) .setNextHopIp(Ip.parse("8.8.8.8")); OspfIntraAreaRoute.Builder transformedBuilder = _routingProcess.transformIntraAreaRouteOnImport(builder.build(), 10); assertThat( transformedBuilder.build(), equalTo( builder .setMetric(11L) .setAdmin(100) .setNonRouting(false) .setNonForwarding(false) .build())); }
@Nonnull @VisibleForTesting OspfIntraAreaRoute.Builder transformIntraAreaRouteOnImport( OspfIntraAreaRoute route, long incrementalCost) { return route .toBuilder() .setMetric(route.getMetric() + incrementalCost) .setAdmin(_process.getAdminCosts().get(route.getProtocol())) .setNonRouting(false) .setNonForwarding(false); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfIntraAreaRoute.Builder transformIntraAreaRouteOnImport( OspfIntraAreaRoute route, long incrementalCost) { return route .toBuilder() .setMetric(route.getMetric() + incrementalCost) .setAdmin(_process.getAdminCosts().get(route.getProtocol())) .setNonRouting(false) .setNonForwarding(false); } }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfIntraAreaRoute.Builder transformIntraAreaRouteOnImport( OspfIntraAreaRoute route, long incrementalCost) { return route .toBuilder() .setMetric(route.getMetric() + incrementalCost) .setAdmin(_process.getAdminCosts().get(route.getProtocol())) .setNonRouting(false) .setNonForwarding(false); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfIntraAreaRoute.Builder transformIntraAreaRouteOnImport( OspfIntraAreaRoute route, long incrementalCost) { return route .toBuilder() .setMetric(route.getMetric() + incrementalCost) .setAdmin(_process.getAdminCosts().get(route.getProtocol())) .setNonRouting(false) .setNonForwarding(false); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty(); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfIntraAreaRoute.Builder transformIntraAreaRouteOnImport( OspfIntraAreaRoute route, long incrementalCost) { return route .toBuilder() .setMetric(route.getMetric() + incrementalCost) .setAdmin(_process.getAdminCosts().get(route.getProtocol())) .setNonRouting(false) .setNonForwarding(false); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty();  }