當前位置: 首頁>>代碼示例>>Java>>正文


Java OvsdbTableStore類代碼示例

本文整理匯總了Java中org.onosproject.ovsdb.controller.OvsdbTableStore的典型用法代碼示例。如果您正苦於以下問題:Java OvsdbTableStore類的具體用法?Java OvsdbTableStore怎麽用?Java OvsdbTableStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OvsdbTableStore類屬於org.onosproject.ovsdb.controller包,在下文中一共展示了OvsdbTableStore類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBridges

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbBridge> getBridges() {
    Set<OvsdbBridge> ovsdbBridges = new HashSet<OvsdbBridge>();
    OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.BRIDGE);
    if (rowStore == null) {
        return null;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(OvsdbConstant.DATABASENAME, OvsdbConstant.BRIDGE,
                         uuid);
        OvsdbBridge ovsdbBridge = getOvsdbBridge(row);
        if (ovsdbBridge != null) {
            ovsdbBridges.add(ovsdbBridge);
        }
    }
    return ovsdbBridges;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:23,代碼來源:DefaultOvsdbClient.java

示例2: getPorts

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbPort> getPorts() {
    Set<OvsdbPort> ovsdbPorts = new HashSet<OvsdbPort>();
    OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.INTERFACE);
    if (rowStore == null) {
        return null;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(OvsdbConstant.DATABASENAME,
                         OvsdbConstant.INTERFACE, uuid);
        OvsdbPort ovsdbPort = getOvsdbPort(row);
        if (ovsdbPort != null) {
            ovsdbPorts.add(ovsdbPort);
        }
    }
    return ovsdbPorts;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:23,代碼來源:DefaultOvsdbClient.java

示例3: getBridges

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbBridge> getBridges() {
    Set<OvsdbBridge> ovsdbBridges = new HashSet<>();
    OvsdbTableStore tableStore = getTableStore(DATABASENAME);
    if (tableStore == null) {
        return ovsdbBridges;
    }
    OvsdbRowStore rowStore = tableStore.getRows(BRIDGE);
    if (rowStore == null) {
        return ovsdbBridges;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row bridgeRow = getRow(DATABASENAME, BRIDGE, uuid);
        OvsdbBridge ovsdbBridge = getOvsdbBridge(bridgeRow, Uuid.uuid(uuid));
        if (ovsdbBridge != null) {
            ovsdbBridges.add(ovsdbBridge);
        }
    }
    return ovsdbBridges;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:22,代碼來源:DefaultOvsdbClient.java

示例4: getPorts

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbPort> getPorts() {
    Set<OvsdbPort> ovsdbPorts = new HashSet<>();
    OvsdbTableStore tableStore = getTableStore(DATABASENAME);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(INTERFACE);
    if (rowStore == null) {
        return null;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(DATABASENAME, INTERFACE, uuid);
        OvsdbPort ovsdbPort = getOvsdbPort(row);
        if (ovsdbPort != null) {
            ovsdbPorts.add(ovsdbPort);
        }
    }
    return ovsdbPorts;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:22,代碼來源:DefaultOvsdbClient.java

示例5: getTableStore

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
/**
 * Gets the ovsdb table store.
 *
 * @param dbName the ovsdb database name
 * @return ovsTableStore, empty if table store is find
 */
private OvsdbTableStore getTableStore(String dbName) {
    if (ovsdbStore == null) {
        return null;
    }
    return ovsdbStore.getOvsdbTableStore(dbName);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:13,代碼來源:DefaultOvsdbClient.java

示例6: getRow

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
/**
 * Gets the ovsdb row.
 *
 * @param dbName    the ovsdb database name
 * @param tableName the ovsdb table name
 * @param uuid      the key of the row
 * @return row, empty if row is find
 */
@Override
public Row getRow(String dbName, String tableName, String uuid) {
    OvsdbTableStore tableStore = getTableStore(dbName);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(tableName);
    if (rowStore == null) {
        return null;
    }
    return rowStore.getRow(uuid);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:21,代碼來源:DefaultOvsdbClient.java

示例7: removeRow

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public void removeRow(String dbName, String tableName, String uuid) {
    OvsdbTableStore tableStore = getTableStore(dbName);
    if (tableStore == null) {
        return;
    }
    OvsdbRowStore rowStore = tableStore.getRows(tableName);
    if (rowStore == null) {
        return;
    }
    rowStore.deleteRow(uuid);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:13,代碼來源:DefaultOvsdbClient.java

示例8: getLocalPorts

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbPort> getLocalPorts(Iterable<String> ifaceids) {
    Set<OvsdbPort> ovsdbPorts = new HashSet<OvsdbPort>();
    OvsdbTableStore tableStore = getTableStore(OvsdbConstant.DATABASENAME);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(OvsdbConstant.INTERFACE);
    if (rowStore == null) {
        return null;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(OvsdbConstant.DATABASENAME,
                         OvsdbConstant.INTERFACE, uuid);
        DatabaseSchema dbSchema = getDatabaseSchema(OvsdbConstant.DATABASENAME);
        Interface intf = (Interface) TableGenerator
                .getTable(dbSchema, row, OvsdbTable.INTERFACE);
        if (intf == null || getIfaceid(intf) == null) {
            continue;
        }
        String portName = intf.getName();
        Set<String> ifaceidSet = Sets.newHashSet(ifaceids);
        if (portName.startsWith("vxlan")
                || !ifaceidSet.contains(getIfaceid(intf))) {
            continue;
        }
        long ofPort = getOfPort(intf);
        if ((ofPort < 0) || (portName == null)) {
            continue;
        }

        OvsdbPort ovsdbPort = new OvsdbPort(new OvsdbPortNumber(ofPort),
                                            new OvsdbPortName(portName));
        if (ovsdbPort != null) {
            ovsdbPorts.add(ovsdbPort);
        }
    }
    return ovsdbPorts;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:41,代碼來源:DefaultOvsdbClient.java

示例9: getLocalPorts

import org.onosproject.ovsdb.controller.OvsdbTableStore; //導入依賴的package包/類
@Override
public Set<OvsdbPort> getLocalPorts(Iterable<String> ifaceids) {
    Set<OvsdbPort> ovsdbPorts = new HashSet<>();
    OvsdbTableStore tableStore = getTableStore(DATABASENAME);
    if (tableStore == null) {
        return null;
    }
    OvsdbRowStore rowStore = tableStore.getRows(INTERFACE);
    if (rowStore == null) {
        return null;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(DATABASENAME, INTERFACE, uuid);
        DatabaseSchema dbSchema = getDatabaseSchema(DATABASENAME);
        Interface intf = (Interface) TableGenerator
                .getTable(dbSchema, row, OvsdbTable.INTERFACE);
        if (intf == null || getIfaceid(intf) == null) {
            continue;
        }
        String portName = intf.getName();
        if (portName == null) {
            continue;
        }
        Set<String> ifaceidSet = Sets.newHashSet(ifaceids);
        if (portName.startsWith(TYPEVXLAN) || !ifaceidSet.contains(getIfaceid(intf))) {
            continue;
        }
        long ofPort = getOfPort(intf);
        if (ofPort < 0) {
            continue;
        }
        ovsdbPorts.add(new OvsdbPort(new OvsdbPortNumber(ofPort),
                                     new OvsdbPortName(portName)));
    }
    return ovsdbPorts;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:38,代碼來源:DefaultOvsdbClient.java


注:本文中的org.onosproject.ovsdb.controller.OvsdbTableStore類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。