/** * Removes all groups in multiple possible group-chains that represent the next * objective. * * @param nextObjective the next objective to remove * @param next the NextGroup that represents the existing group-chain for * this next objective */ protected void removeGroup(NextObjective nextObjective, NextGroup next) { List<Deque<GroupKey>> allgkeys = Ofdpa2Pipeline.appKryo.deserialize(next.data()); List<GroupKey> groupKeys = allgkeys.stream() .map(Deque::getFirst).collect(Collectors.toList()); pendingRemoveNextObjectives.put(nextObjective, groupKeys); allgkeys.forEach(groupChain -> groupChain.forEach(groupKey -> groupService.removeGroup(deviceId, groupKey, nextObjective.appId()))); flowObjectiveStore.removeNextGroup(nextObjective.id()); }
private void removeGroup(NextObjective nextObjective) { log.debug("removeGroup in {}: for next objective id {}", deviceId, nextObjective.id()); final GroupKey key = new DefaultGroupKey( appKryo.serialize(nextObjective.id())); groupService.removeGroup(deviceId, key, appId); }
@Override public void purge(Intent intent) { checkPermission(INTENT_WRITE); checkNotNull(intent, INTENT_NULL); IntentData data = IntentData.purge(intent); store.addPending(data); // remove associated group if there is one if (intent instanceof PointToPointIntent) { PointToPointIntent pointIntent = (PointToPointIntent) intent; DeviceId deviceId = pointIntent.filteredIngressPoint().connectPoint().deviceId(); GroupKey groupKey = PointToPointIntentCompiler.makeGroupKey(intent.id()); groupService.removeGroup(deviceId, groupKey, intent.appId()); } }
break; case REMOVE: groupService.removeGroup(deviceId, key, nextObjective.appId()); break; case ADD_TO_EXISTING: