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


Java FlowOnNode.setByteCount方法代码示例

本文整理汇总了Java中org.opendaylight.controller.sal.reader.FlowOnNode.setByteCount方法的典型用法代码示例。如果您正苦于以下问题:Java FlowOnNode.setByteCount方法的具体用法?Java FlowOnNode.setByteCount怎么用?Java FlowOnNode.setByteCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.sal.reader.FlowOnNode的用法示例。


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

示例1: testFlowOnNodeMethods

import org.opendaylight.controller.sal.reader.FlowOnNode; //导入方法依赖的package包/类
@Test
        public void testFlowOnNodeMethods () {
        Match match = new Match();
        NodeConnector inNC = NodeConnectorCreator.createNodeConnector((short)10, NodeCreator.createOFNode((long)10));
        NodeConnector outNC = NodeConnectorCreator.createNodeConnector((short)20, NodeCreator.createOFNode((long)20));

        match.setField(MatchType.DL_TYPE, EtherTypes.IPv4.shortValue());
        match.setField(MatchType.IN_PORT, inNC);

        Output output = new Output(outNC);
        ArrayList<Action> action = new ArrayList<Action>();
        action.add(output);

        Flow flow = new Flow (match, action);

        FlowOnNode flowOnNode = new FlowOnNode (flow);

        Assert.assertTrue(flowOnNode.getFlow().equals(flow));

        flowOnNode.setPacketCount((long)100);
        flowOnNode.setByteCount((long)800);
        flowOnNode.setTableId((byte)0x55);
        flowOnNode.setDurationNanoseconds(40);
        flowOnNode.setDurationSeconds(45);

        Assert.assertTrue(flowOnNode.getPacketCount() == 100);
        Assert.assertTrue(flowOnNode.getByteCount() == 800);
        Assert.assertTrue(flowOnNode.getDurationNanoseconds() == 40);
        Assert.assertTrue(flowOnNode.getDurationSeconds() == 45);
        Assert.assertTrue(flowOnNode.getTableId() == (byte)0x55);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:32,代码来源:FlowOnNodeTest.java

示例2: readFlow

import org.opendaylight.controller.sal.reader.FlowOnNode; //导入方法依赖的package包/类
@Override
public FlowOnNode readFlow(Node node, Flow flow, boolean cached) {
    FlowOnNode fn1 = new FlowOnNode(flow);
    fn1.setByteCount(100);
    fn1.setDurationNanoseconds(400);
    fn1.setDurationSeconds(40);
    fn1.setTableId((byte) 0x1);
    fn1.setPacketCount(200);
    return fn1;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:11,代码来源:ReadService.java


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