当前位置: 首页>>代码示例>>Java>>正文


Java Operation.ADD属性代码示例

本文整理汇总了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()));
        }
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:22,代码来源:Ofdpa2GroupHandler.java

示例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));
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:10,代码来源:FlowObjectiveManager.java


注:本文中的org.onosproject.net.flowobjective.Objective.Operation.ADD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。