@Test public void forwardingObjective() { TrafficSelector selector = DefaultTrafficSelector.emptySelector(); TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment(); ForwardingObjective forward = DefaultForwardingObjective.builder() .fromApp(NetTestTools.APP_ID) .withFlag(ForwardingObjective.Flag.SPECIFIC) .withSelector(selector) .withTreatment(treatment) .makePermanent() .add(); manager.forward(id1, forward); TestTools.assertAfter(RETRY_MS, () -> assertThat(forwardingObjectives, hasSize(1))); assertThat(forwardingObjectives, hasItem("of:d1")); assertThat(filteringObjectives, hasSize(0)); assertThat(nextObjectives, hasSize(0)); }
@Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (queueObjective(deviceId, forwardingObjective)) { return; } executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); }
FlowObjectiveManager implements FlowObjectiveService { @Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (queueObjective(deviceId, forwardingObjective)) { return; } executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); } }
FlowObjectiveManager implements FlowObjectiveService { @Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (queueObjective(deviceId, forwardingObjective)) { return; } executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); }  }
FlowObjectiveManager implements FlowObjectiveService { @Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (queueObjective(deviceId, forwardingObjective)) { return; } executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); }  @Override void filter(DeviceId deviceId, FilteringObjective filteringObjective); @Override void forward(DeviceId deviceId, ForwardingObjective forwardingObjective); @Override void next(DeviceId deviceId, NextObjective nextObjective); @Override int allocateNextId(); @Override void initPolicy(String policy); @Override List<String> getNextMappings(); @Override List<String> getPendingNexts(); }
FlowObjectiveManager implements FlowObjectiveService { @Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (queueObjective(deviceId, forwardingObjective)) { return; } executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); }  @Override void filter(DeviceId deviceId, FilteringObjective filteringObjective); @Override void forward(DeviceId deviceId, ForwardingObjective forwardingObjective); @Override void next(DeviceId deviceId, NextObjective nextObjective); @Override int allocateNextId(); @Override void initPolicy(String policy); @Override List<String> getNextMappings(); @Override List<String> getPendingNexts(); static final int INSTALL_RETRY_ATTEMPTS; static final long INSTALL_RETRY_INTERVAL; }