org.opendaylight.controller.sal.flowprogrammer.Flow.removeAction()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中org.opendaylight.controller.sal.flowprogrammer.Flow.removeAction()方法的一些代码示例,展示了Flow.removeAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.removeAction()方法的具体详情如下:
包路径:org.opendaylight.controller.sal.flowprogrammer.Flow
类名称:Flow
方法名:removeAction

Flow.removeAction介绍

[英]remove ALL actions of type actionType from the list of actions of this flow
[中]从该流的操作列表中删除actionType类型的所有操作

代码示例

代码示例来源:origin: org.opendaylight.controller/sal

/**
 * remove ALL actions of type actionType from the list of actions of this
 * flow
 *
 * @param actionType
 * @return false if an action of that type is present and it fails to remove
 *         it
 */
public boolean removeAction(ActionType actionType) {
  Iterator<Action> actionIter = this.getActions().iterator();
  while (actionIter.hasNext()) {
    Action action = actionIter.next();
    if (action.getType() == actionType) {
      if (!this.removeAction(action)) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager.implementation

@Override
public void removeOutputPort(Node node, String flowName, List<NodeConnector> portList) {
  for (FlowEntryInstall index : this.nodeFlows.get(node)) {
    FlowEntryInstall flow = this.installedSwView.get(index);
    if (flow.getFlowName().equals(flowName)) {
      FlowEntry currentFlowEntry = flow.getOriginal();
      FlowEntry newFlowEntry = currentFlowEntry.clone();
      for (NodeConnector dstPort : portList) {
        Action action = new Output(dstPort);
        newFlowEntry.getFlow().removeAction(action);
      }
      Status status = modifyEntry(currentFlowEntry, newFlowEntry, false);
      if (status.isSuccess()) {
        log.trace("Ports {} removed from FlowEntry {}", portList, flowName);
      } else {
        log.warn("Failed to remove ports {} from Flow entry {}. The failure is: {}", portList,
            currentFlowEntry.toString(), status.getDescription());
      }
      return;
    }
  }
  log.warn("Failed to remove ports from Flow {} on Node {}: Entry Not Found", flowName, node);
}

代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager.implementation

newFlowEntry.getFlow().removeAction(target);
newFlowEntry.getFlow().addAction(new Output(outPort));

相关文章