本文整理了Java中org.opendaylight.controller.sal.flowprogrammer.Flow.getPriority()
方法的一些代码示例,展示了Flow.getPriority()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.getPriority()
方法的具体详情如下:
包路径:org.opendaylight.controller.sal.flowprogrammer.Flow
类名称:Flow
方法名:getPriority
暂无
代码示例来源:origin: org.opendaylight.controller/protocol_plugins.openflow
@Override
public FlowOnNode readFlow(String container, Node node, Flow flow, boolean cached) {
if (controller == null) {
// Avoid to provide cached statistics if controller went down.
// They are not valid anymore anyway
logger.error("Internal plugin error");
return null;
}
long sid = (Long) node.getID();
OFMatch ofMatch = new FlowConverter(flow).getOFMatch();
List<OFStatistics> ofList;
if (cached == true){
ofList = statsMgr.getOFFlowStatistics(sid, ofMatch, flow.getPriority());
} else {
ofList = statsMgr.queryStatistics(sid, OFStatisticsType.FLOW, ofMatch);
for (OFStatistics ofStat : ofList) {
if (((OFFlowStatisticsReply)ofStat).getPriority() == flow.getPriority()){
ofList = new ArrayList<OFStatistics>(1);
ofList.add(ofStat);
break;
}
}
}
// Convert and filter the statistics per container
List<FlowOnNode> flowOnNodeList = new FlowStatisticsConverter(ofList).getFlowOnNodeList(node);
List<FlowOnNode> filteredList = filterFlowListPerContainer(container, node, flowOnNodeList);
return (filteredList.isEmpty()) ? null : filteredList.get(0);
}
代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((node == null) ? 0 : node.hashCode());
result = prime * result + ((flow == null) ? 0 : (int) flow.getPriority());
result = prime * result + ((flow == null || flow.getMatch() == null) ? 0 : flow.getMatch().hashCode());
return result;
}
代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager
return false;
if (flow.getPriority() != other.flow.getPriority()) {
return false;
代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility
private static FlowBuilder internalToMDFlow(final Flow sourceFlow) {
Preconditions.checkArgument(sourceFlow != null);
// Instruct switch to let controller know when flow is removed.
FlowModFlags flags = new FlowModFlags(false, false, false, false, true);
return new FlowBuilder()
.setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
.setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
.setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
.setPriority(Integer.valueOf((sourceFlow.getPriority())))
.setFlags(flags)
.setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
.setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()));
}
代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility
public static FlowAdded flowAdded(final Flow sourceFlow) {
Preconditions.checkArgument(sourceFlow != null);
return new FlowAddedBuilder()
.setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
.setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
.setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
.setPriority(Integer.valueOf(sourceFlow.getPriority()))
.setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
.setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()))
.setTableId((short)0)
.build();
}
代码示例来源:origin: org.opendaylight.controller/troubleshoot.web
((Integer) flowOnNode.getDurationSeconds()).toString());
row.put("idleTimeout", ((Short) flow.getIdleTimeout()).toString());
row.put("priority", String.valueOf(NetUtils.getUnsignedShort(flow.getPriority())));
return row;
代码示例来源:origin: org.opendaylight.controller/protocol_plugins.openflow
if (oldFlow.getPriority() != newFlow.getPriority()
|| !oldFlow.getMatch().equals(newFlow.getMatch())) {
msg1 = new FlowConverter(oldFlow).getOFFlowMod(
代码示例来源:origin: org.opendaylight.controller/protocol_plugins.openflow
((OFFlowMod) fm).setMatch(this.ofMatch);
((OFFlowMod) fm).setActions(this.actionsList);
((OFFlowMod) fm).setPriority(flow.getPriority());
((OFFlowMod) fm).setCookie(flow.getId());
((OFFlowMod) fm).setBufferId(OFPacketOut.BUFFER_ID_NONE);
((V6FlowMod) fm).setMatch((V6Match) ofMatch);
((V6FlowMod) fm).setActions(this.actionsList);
((V6FlowMod) fm).setPriority(flow.getPriority());
((V6FlowMod) fm).setCookie(flow.getId());
((V6FlowMod) fm).setLength(U16.t(OFVendor.MINIMUM_LENGTH
代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility
private FlowAndStatisticsMapList toOdFlowStatistics(FlowOnNode flowOnNode) {
FlowAndStatisticsMapListBuilder builder = new FlowAndStatisticsMapListBuilder();
builder.setByteCount(toCounter64(flowOnNode.getByteCount()));
builder.setPacketCount(toCounter64(flowOnNode.getPacketCount()));
builder.setDuration(extractDuration(flowOnNode));
builder.setMatch(FromSalConversionsUtils.toMatch(flowOnNode.getFlow().getMatch()));
builder.setPriority((int)flowOnNode.getFlow().getPriority());
builder.setHardTimeout((int)flowOnNode.getFlow().getHardTimeout());
builder.setIdleTimeout((int)flowOnNode.getFlow().getIdleTimeout());
//TODO: actions to instruction conversion
builder.setInstructions(null);
return builder.build();
}
内容来源于网络,如有侵权,请联系作者删除!