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


Java FlowBuilder.setCookie方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder.setCookie方法的典型用法代码示例。如果您正苦于以下问题:Java FlowBuilder.setCookie方法的具体用法?Java FlowBuilder.setCookie怎么用?Java FlowBuilder.setCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder的用法示例。


在下文中一共展示了FlowBuilder.setCookie方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFlowBuilder

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder; //导入方法依赖的package包/类
public static FlowBuilder createFlowBuilder(final short table, final int priority, final BigInteger cookieValue,
                                            final String flowName, final String flowIdStr, MatchBuilder match,
                                            InstructionsBuilder isb) {
    FlowBuilder flow = new FlowBuilder();
    flow.setId(new FlowId(flowIdStr));
    flow.setKey(new FlowKey(new FlowId(flowIdStr)));
    flow.setTableId(table);
    flow.setFlowName(flowName);
    flow.setCookie(new FlowCookie(cookieValue));
    flow.setCookieMask(new FlowCookie(cookieValue));
    flow.setContainerName(null);
    flow.setStrict(false);
    flow.setMatch(match.build());
    flow.setInstructions(isb.build());
    flow.setPriority(priority);
    flow.setHardTimeout(0);
    flow.setIdleTimeout(0);
    flow.setFlags(new FlowModFlags(false, false, false, false, false));
    if (null == flow.isBarrier()) {
        flow.setBarrier(Boolean.FALSE);
    }

    return flow;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:OpenFlow13Utils.java

示例2: createFlowOnTable

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder; //导入方法依赖的package包/类
public static Flow createFlowOnTable(Match match, int priority, short tableId, BigInteger cookie,
        boolean isCreateFlowIdFromMatch, Integer timeout) {
    FlowBuilder fb = new FlowBuilder();
    if (match != null) {
        fb.setMatch(match);
    }
    FlowId flowId = createFlowId();
    fb.setTableId(tableId);
    fb.setIdleTimeout(0).setHardTimeout(0);
    fb.setId(flowId);
    if (timeout != null) {
        fb.setHardTimeout(timeout);
    }
    if (cookie != null) {
        fb.setCookie(new FlowCookie(cookie));
    }

    fb.setPriority(priority);
    Flow flow = fb.build();
    return flow;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:CountersServiceUtils.java

示例3: createFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder; //导入方法依赖的package包/类
public FlowBuilder createFlow(final Dataflow dataFlow) throws DataflowCreationException {
    FlowBuilder flowBuilder = new FlowBuilder();
    try {
        final FlowModFlags flowModFlags = new FlowModFlags(false, false, false, false, false);
        final FlowId flowId = new FlowId(dataFlow.getId().toString());
        final FlowKey flowKey = new FlowKey(flowId);
        final MeterId meterId = new MeterId(dataFlow.getMeterId().longValue());

        flowBuilder.setFlowName("NIC_METER" + meterId.getValue());
        flowBuilder.setId(new FlowId(Long.toString(flowBuilder.hashCode())));
        flowBuilder.setMatch(createMatch(dataFlow.getSourceIpAddress()));
        flowBuilder.setInstructions(createInstruction(meterId));
        flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
        flowBuilder.setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement())));
        flowBuilder.setBufferId(OFP_NO_BUFFER);
        flowBuilder.setHardTimeout((int) dataFlow.getTimeout());
        flowBuilder.setIdleTimeout((int) dataFlow.getTimeout());
        flowBuilder.setFlags(flowModFlags);
        flowBuilder.setKey(flowKey);
    } catch (Exception e) {
        throw new DataflowCreationException(e.getMessage());
    }

    return flowBuilder;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:26,代码来源:OFRuleWithMeterManager.java

示例4: createFlowBuilder

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder; //导入方法依赖的package包/类
private FlowBuilder createFlowBuilder(final MatchBuilder matchBuilder, final FlowId flowId) {
    final Match match = matchBuilder.build();
    final FlowKey key = new FlowKey(flowId);
    final FlowBuilder flowBuilder = new FlowBuilder();
    final BigInteger cookieId = new BigInteger("20", RADIX);

    flowBuilder.setId(flowId);
    flowBuilder.setKey(key);
    flowBuilder.setFlowName(flowName);
    flowBuilder.setCookie(new FlowCookie(cookieId));
    flowBuilder.setCookieMask(new FlowCookie(cookieId));
    flowBuilder.setContainerName(null);
    flowBuilder.setStrict(false);
    flowBuilder.setMatch(match);
    flowBuilder.setFlags(new FlowModFlags(false, false, false, false, false));
    flowBuilder.setBarrier(true);
    flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
    flowBuilder.setHardTimeout(OFRendererConstants.DEFAULT_HARD_TIMEOUT);
    flowBuilder.setIdleTimeout(OFRendererConstants.DEFAULT_IDLE_TIMEOUT);

    return flowBuilder;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:23,代码来源:IntentFlowManager.java


注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder.setCookie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。