本文整理汇总了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);
}
示例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;
}