本文整理汇总了Java中org.onosproject.net.flowobjective.Objective.Operation.ADD属性的典型用法代码示例。如果您正苦于以下问题:Java Operation.ADD属性的具体用法?Java Operation.ADD怎么用?Java Operation.ADD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.onosproject.net.flowobjective.Objective.Operation
的用法示例。
在下文中一共展示了Operation.ADD属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFlowObjectiveStore
private void updateFlowObjectiveStore(Integer nextId, OfdpaNextGroup nextGrp) {
synchronized (flowObjectiveStore) {
// get fresh copy of what the store holds
NextGroup next = flowObjectiveStore.getNextGroup(nextId);
if (next == null || nextGrp.nextObjective().op() == Operation.ADD) {
flowObjectiveStore.putNextGroup(nextId, nextGrp);
return;
}
if (nextGrp.nextObjective().op() == Operation.ADD_TO_EXISTING) {
List<Deque<GroupKey>> allActiveKeys = appKryo.deserialize(next.data());
allActiveKeys = Lists.newArrayList(allActiveKeys);
// If active keys shows only the top-level group without a chain of groups,
// then it represents an empty group. Update by replacing empty chain.
if (allActiveKeys.size() == 1 && allActiveKeys.get(0).size() == 1) {
allActiveKeys.clear();
}
allActiveKeys.addAll(nextGrp.allKeys());
flowObjectiveStore.putNextGroup(nextId,
new OfdpaNextGroup(allActiveKeys, nextGrp.nextObjective()));
}
}
}
示例2: next
@Override
public void next(DeviceId deviceId, NextObjective nextObjective) {
checkPermission(FLOWRULE_WRITE);
if (nextObjective.op() == Operation.ADD ||
flowObjectiveStore.getNextGroup(nextObjective.id()) != null ||
!queueNextObjective(deviceId, nextObjective)) {
// either group exists or we are trying to create it - let it through
executorService.execute(new ObjectiveInstaller(deviceId, nextObjective));
}
}