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


Java NodeTableCreator类代码示例

本文整理汇总了Java中org.opendaylight.controller.sal.utils.NodeTableCreator的典型用法代码示例。如果您正苦于以下问题:Java NodeTableCreator类的具体用法?Java NodeTableCreator怎么用?Java NodeTableCreator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testNodeTableStatisticsMethods

import org.opendaylight.controller.sal.utils.NodeTableCreator; //导入依赖的package包/类
@Test
public void testNodeTableStatisticsMethods() {
    NodeTable nt = NodeTableCreator.createNodeTable(Byte.valueOf("2") , NodeCreator.createOFNode((long)20));
    NodeTableStatistics ntStats = new NodeTableStatistics();

    ntStats.setNodeTable(nt);
    ntStats.setActiveCount(100);
    ntStats.setLookupCount(200);
    ntStats.setMatchedCount(500);
    ntStats.setName("Test");

    Assert.assertTrue(ntStats.getNodeTable().equals(nt));
    Assert.assertTrue(ntStats.getActiveCount() == 100);
    Assert.assertTrue(ntStats.getLookupCount() == 200);
    Assert.assertTrue(ntStats.getMatchedCount() == 500);
    Assert.assertTrue(ntStats.getName().equals("Test"));
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:18,代码来源:NodeTableStatisticsTest.java

示例2: filterTableListPerContainer

import org.opendaylight.controller.sal.utils.NodeTableCreator; //导入依赖的package包/类
public List<OFStatistics> filterTableListPerContainer(
        String container, long switchId, List<OFStatistics> list) {
    if (list == null) {
        return null;
    }

    // Create new filtered list of node tables
    List<OFStatistics> newList = new ArrayList<OFStatistics>();

    for (OFStatistics stat : list) {
        OFTableStatistics target = (OFTableStatistics) stat;
        NodeTable nt = NodeTableCreator.createOFNodeTable(target.getTableId(), NodeCreator.createOFNode(switchId));
        if (containerOwnsNodeTable(container, nt)) {
            newList.add(target);
        }
    }

    return newList;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:20,代码来源:ReadServiceFilter.java

示例3: _readtable

import org.opendaylight.controller.sal.utils.NodeTableCreator; //导入依赖的package包/类
public void _readtable(CommandInterpreter ci) {
    String nodeId = ci.nextArgument();
    String tableId = ci.nextArgument();
    String cacheReq = ci.nextArgument();
    boolean cached;
    if (nodeId == null) {
        ci.print("Node id not specified");
        return;
    }
    if (tableId == null) {
        ci.print("Table id not specified");
        return;
    }
    cached = (cacheReq == null) ? true : cacheReq.equals("true");
    NodeTable nodeTable = null;
    Node node = NodeCreator.createOFNode(Long.parseLong(nodeId));
    nodeTable = NodeTableCreator.createNodeTable(Byte
            .valueOf(tableId), node);
    NodeTableStatistics stats = (cached) ? this
            .readNodeTable(nodeTable) : this
            .nonCachedReadNodeTable(nodeTable);
            if (stats != null) {
                ci.println(stats.toString());
            } else {
                ci.println("null");
            }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:28,代码来源:ReadService.java

示例4: toNodeTable

import org.opendaylight.controller.sal.utils.NodeTableCreator; //导入依赖的package包/类
public static NodeTable toNodeTable(byte tableId, Node node) {
    log.trace("Openflow table ID: {}", Byte.toString(tableId));
    return NodeTableCreator.createNodeTable(tableId, node);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:TableConverter.java


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