((NextObjective.Builder) ctx.objective.copy()).addToExisting(ctx); ctx.setObjective(newObj, ctx.deviceId); ctx.increaseRetryValue();
break; case ADD_TO_EXISTING: objective = ((NextObjective.Builder) objBuilder).addToExisting(context); break; case REMOVE: break; case REMOVE_FROM_EXISTING: objective = ((NextObjective.Builder) objBuilder).removeFromExisting(context); break; case MODIFY: objective = ((NextObjective.Builder) objBuilder).modify(context); break; case VERIFY: objective = ((NextObjective.Builder) objBuilder).verify(context); break; default:
metabuilder.matchVlanId(vlanId); nextObjBuilder.withMeta(metabuilder.build()); nextObjBuilder.addTreatment(ttBuilder.build()); log.debug("Submitted next objective {} in device {} for port/vlan {}/{}", nextId, deviceId, portNumber, vlanId); if (install) { flowObjectiveService.next(deviceId, nextObjBuilder.add()); } else { flowObjectiveService.next(deviceId, nextObjBuilder.remove());
private int createPeerGroup(MacAddress srcMac, MacAddress dstMac, VlanId vlanId, DeviceId deviceId, PortNumber port) { int nextId = flowObjectiveService.allocateNextId(); NextObjective.Builder nextObjBuilder = DefaultNextObjective.builder() .withId(nextId) .withType(NextObjective.Type.SIMPLE) .fromApp(appId); TrafficTreatment.Builder ttBuilder = DefaultTrafficTreatment.builder(); ttBuilder.setEthSrc(srcMac); ttBuilder.setEthDst(dstMac); ttBuilder.setOutput(port); nextObjBuilder.addTreatment(ttBuilder.build()); TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder(); VlanId matchVlanId = (vlanId.equals(VlanId.NONE)) ? VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN) : vlanId; metabuilder.matchVlanId(matchVlanId); nextObjBuilder.withMeta(metabuilder.build()); flowObjectiveService.next(deviceId, nextObjBuilder.add()); return nextId; }