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

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

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

Flow.setMatch介绍

[英]Set the Match for this flow This operation will overwrite an existing Match if present
[中]为此流设置匹配此操作将覆盖现有匹配(如果存在)

代码示例

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

/**
 * Merges the current Flow with the passed Container Flow
 *
 * Note: Container Flow merging is not an injective function. Be m1 and m2
 * two different matches, and be f() the flow merge function, such that y1 =
 * f(m1) and y2 = f(m2) are the two merged matches, we may have: y1 = y2
 *
 *
 * @param containerFlow
 * @return this merged FlowEntry
 */
public FlowEntry mergeWith(ContainerFlow containerFlow) {
  Match myMatch = flow.getMatch();
  Match filter = containerFlow.getMatch();
  // Merge
  Match merge = myMatch.mergeWithFilter(filter);
  // Replace this Flow's match with merged version
  flow.setMatch(merge);
  return this;
}

代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility

/**
 * @param source notification, missing instructions
 * @param node corresponding node where the flow change occured
 * @return ad-sal node, build from given data
 */
public static Flow toFlow(SwitchFlowRemoved source, Node node) {
  final Flow target = new Flow();
  genericFlowToAdFlow(source, target);
  target.setMatch(toMatch(source.getMatch()));
  return target;
}

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

public void _modifyflow(CommandInterpreter ci) throws UnknownHostException {
  Node node = null;
  String nodeId = ci.nextArgument();
  if (nodeId == null) {
    ci.print("Node id not specified");
    return;
  }
  try {
    node = new Node(NodeIDType.OPENFLOW, Long.valueOf(nodeId));
  } catch (NumberFormatException e) {
    logger.error("",e);
  } catch (ConstructionException e) {
    logger.error("",e);
  }
  Flow flowA = getSampleFlow(node);
  Flow flowB = getSampleFlow(node);
  Match matchB = flowB.getMatch();
  matchB.setField(MatchType.NW_DST,
      InetAddress.getByName("190.190.190.190"));
  flowB.setMatch(matchB);
  ci.println(this.modifyFlow(node, flowA, flowB));
}

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

flow.setMatch(match);
List<Action> actions = new ArrayList<Action>();
actions.add(a);

代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility

public static Flow toFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source, Node node) {
  final Flow target = new Flow();
  genericFlowToAdFlow(source, target);
  target.setMatch(toMatch(source.getMatch()));
  List<Action> actions = getAction(source);
  if (actions != null) {
    target.setActions(actionFrom(actions, node));
  }
  return target;
}

相关文章