當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。