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


Java OvsdbRowStore類代碼示例

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


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

示例1: getOvsUuid

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public String getOvsUuid(String dbName) {
    OvsdbRowStore rowStore = getRowStore(OvsdbConstant.DATABASENAME,
                                         OvsdbConstant.DATABASENAME);
    if (rowStore == null) {
        log.debug("The bridge uuid is null");
        return null;
    }
    ConcurrentMap<String, Row> ovsTableRows = rowStore.getRowStore();
    if (ovsTableRows != null) {
        for (String uuid : ovsTableRows.keySet()) {
            Row row = ovsTableRows.get(uuid);
            String tableName = row.tableName();
            if (tableName.equals(dbName)) {
                return uuid;
            }
        }
    }
    return null;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:21,代碼來源:DefaultOvsdbClient.java

示例2: getBridges

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例3: getPorts

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例4: getBridgeUuid

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public String getBridgeUuid(String bridgeName) {
    DatabaseSchema dbSchema = schema.get(DATABASENAME);
    OvsdbRowStore rowStore = getRowStore(DATABASENAME, BRIDGE);
    if (rowStore == null) {
        log.debug("The bridge uuid is null");
        return null;
    }

    ConcurrentMap<String, Row> bridgeTableRows = rowStore.getRowStore();
    if (bridgeTableRows == null) {
        log.debug("The bridge uuid is null");
        return null;
    }

    for (String uuid : bridgeTableRows.keySet()) {
        Bridge bridge = (Bridge) TableGenerator
                .getTable(dbSchema, bridgeTableRows.get(uuid), OvsdbTable.BRIDGE);
        if (bridge.getName().equals(bridgeName)) {
            return uuid;
        }
    }
    return null;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:25,代碼來源:DefaultOvsdbClient.java

示例5: getOvsUuid

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
private String getOvsUuid(String dbName) {
    OvsdbRowStore rowStore = getRowStore(DATABASENAME, DATABASENAME);
    if (rowStore == null) {
        log.debug("The bridge uuid is null");
        return null;
    }
    ConcurrentMap<String, Row> ovsTableRows = rowStore.getRowStore();
    if (ovsTableRows != null) {
        for (String uuid : ovsTableRows.keySet()) {
            Row row = ovsTableRows.get(uuid);
            String tableName = row.tableName();
            if (tableName.equals(dbName)) {
                return uuid;
            }
        }
    }
    return null;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:19,代碼來源:DefaultOvsdbClient.java

示例6: getQoses

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public Set<OvsdbQos> getQoses() {
    Set<OvsdbQos> ovsdbQoses = new HashSet<>();
    OvsdbRowStore rowStore = getRowStore(DATABASENAME, QOS);
    if (rowStore == null) {
        log.debug("The qos uuid is null");
        return ovsdbQoses;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(DATABASENAME, QOS, uuid);
        OvsdbQos ovsdbQos = getOvsdbQos(row);
        if (ovsdbQos != null) {
            ovsdbQoses.add(ovsdbQos);
        }
    }
    return ovsdbQoses;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:19,代碼來源:DefaultOvsdbClient.java

示例7: createQueue

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public boolean createQueue(OvsdbQueue ovsdbQueue) {
    DatabaseSchema dbSchema = schema.get(DATABASENAME);
    Queue queue = (Queue) TableGenerator.createTable(dbSchema, OvsdbTable.QUEUE);
    ArrayList<Operation> operations = Lists.newArrayList();
    OvsdbRowStore rowStore = getRowStore(DATABASENAME, QUEUE);
    if (rowStore == null) {
        log.debug("The queue uuid is null");
        return false;
    }

    if (ovsdbQueue.dscp().isPresent()) {
        queue.setDscp(ImmutableSet.of(ovsdbQueue.dscp().get()));
    }
    queue.setOtherConfig(ovsdbQueue.otherConfigs());
    queue.setExternalIds(ovsdbQueue.externalIds());
    Insert queueInsert = new Insert(dbSchema.getTableSchema(QUEUE), QUEUE, queue.getRow());
    operations.add(queueInsert);

    try {
        transactConfig(DATABASENAME, operations).get();
    } catch (InterruptedException | ExecutionException e) {
        log.error("createQueue transactConfig get exception !");
    }
    return true;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:27,代碼來源:DefaultOvsdbClient.java

示例8: getQueues

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public Set<OvsdbQueue> getQueues() {
    Set<OvsdbQueue> ovsdbqueues = new HashSet<>();
    OvsdbRowStore rowStore = getRowStore(DATABASENAME, QUEUE);
    if (rowStore == null) {
        log.debug("The queue uuid is null");
        return ovsdbqueues;
    }
    ConcurrentMap<String, Row> rows = rowStore.getRowStore();
    for (String uuid : rows.keySet()) {
        Row row = getRow(DATABASENAME, QUEUE, uuid);
        OvsdbQueue ovsdbQueue = getOvsdbQueue(row);
        if (ovsdbQueue != null) {
            ovsdbqueues.add(ovsdbQueue);
        }
    }
    return ovsdbqueues;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:19,代碼來源:DefaultOvsdbClient.java

示例9: getBridges

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例10: getPorts

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例11: getRow

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例12: removeRow

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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

示例13: getBridgeUuid

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public String getBridgeUuid(String bridgeName) {
    DatabaseSchema dbSchema = schema.get(OvsdbConstant.DATABASENAME);

    OvsdbRowStore rowStore = getRowStore(OvsdbConstant.DATABASENAME,
                                         OvsdbConstant.BRIDGE);
    if (rowStore == null) {
        log.debug("The bridge uuid is null");
        return null;
    }

    ConcurrentMap<String, Row> bridgeTableRows = rowStore.getRowStore();
    if (bridgeTableRows == null) {
        log.debug("The bridge uuid is null");
        return null;
    }

    for (String uuid : bridgeTableRows.keySet()) {
        Bridge bridge = (Bridge) TableGenerator
                .getTable(dbSchema, bridgeTableRows.get(uuid),
                          OvsdbTable.BRIDGE);

        if (bridge.getName().equals(bridgeName)) {
            return uuid;
        }

    }
    return null;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:30,代碼來源:DefaultOvsdbClient.java

示例14: getControllerUuid

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的package包/類
@Override
public String getControllerUuid(String controllerName,
                                String controllerTarget) {
    DatabaseSchema dbSchema = schema.get(OvsdbConstant.DATABASENAME);
    OvsdbRowStore rowStore = getRowStore(OvsdbConstant.DATABASENAME,
                                         OvsdbConstant.CONTROLLER);
    if (rowStore == null) {
        log.debug("The controller uuid is null");
        return null;
    }

    ConcurrentMap<String, Row> controllerTableRows = rowStore.getRowStore();
    if (controllerTableRows != null) {
        for (String uuid : controllerTableRows.keySet()) {

            Controller controller = (Controller) TableGenerator
                    .getTable(dbSchema, controllerTableRows.get(uuid),
                              OvsdbTable.CONTROLLER);
            String target = (String) controller.getTargetColumn().data();
            if (target.equalsIgnoreCase(controllerTarget)) {
                return uuid;
            }

        }
    }
    return null;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:28,代碼來源:DefaultOvsdbClient.java

示例15: getLocalPorts

import org.onosproject.ovsdb.controller.OvsdbRowStore; //導入依賴的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


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