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


Java Controller類代碼示例

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


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

示例1: getControllers

import org.onosproject.ovsdb.rfc.table.Controller; //導入依賴的package包/類
@Override
public Set<ControllerInfo> getControllers(DeviceId openflowDeviceId) {
    Uuid bridgeUuid = getBridgeUuid(openflowDeviceId);
    if (bridgeUuid == null) {
        log.warn("bad bridge Uuid");
        return null;
    }
    List<Controller> controllers = getControllers(bridgeUuid);
    if (controllers == null) {
        log.warn("bad list of controllers");
        return null;
    }
    return controllers.stream().
            map(controller -> new ControllerInfo(
                    (String) controller.getTargetColumn()
                            .data())).collect(Collectors.toSet());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:18,代碼來源:DefaultOvsdbClient.java

示例2: getControllers

import org.onosproject.ovsdb.rfc.table.Controller; //導入依賴的package包/類
@Override
public Set<ControllerInfo> getControllers(DeviceId openflowDeviceId) {
    Uuid bridgeUuid = getBridgeUuid(openflowDeviceId);
    if (bridgeUuid == null) {
        log.warn("bad bridge Uuid");
        return null;
    }
    List<Controller> controllers = getControllers(bridgeUuid);
    if (controllers == null) {
        log.warn("bad list of controllers");
        return null;
    }
    return controllers.stream().map(controller -> new ControllerInfo(
            (String) controller.getTargetColumn()
                    .data())).collect(Collectors.toSet());
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:17,代碼來源:DefaultOvsdbClient.java

示例3: getControllerUuid

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

示例4: getOvsdbBridge

import org.onosproject.ovsdb.rfc.table.Controller; //導入依賴的package包/類
private OvsdbBridge getOvsdbBridge(Row row, Uuid bridgeUuid) {
    DatabaseSchema dbSchema = getDatabaseSchema(DATABASENAME);
    Bridge bridge = (Bridge) TableGenerator.getTable(dbSchema, row, OvsdbTable.BRIDGE);
    if (bridge == null) {
        return null;
    }

    OvsdbSet datapathIdSet = (OvsdbSet) bridge.getDatapathIdColumn().data();
    @SuppressWarnings("unchecked")
    Set<String> datapathIds = datapathIdSet.set();
    if (datapathIds == null || datapathIds.isEmpty()) {
        return null;
    }
    String datapathId = (String) datapathIds.toArray()[0];
    String bridgeName = bridge.getName();
    if ((datapathId == null) || (bridgeName == null)) {
        return null;
    }

    List<Controller> controllers = getControllers(bridgeUuid);

    if (controllers != null) {
        List<ControllerInfo> controllerInfos = controllers.stream().map(
                controller -> new ControllerInfo(
                (String) controller.getTargetColumn()
                        .data())).collect(Collectors.toList());

        return OvsdbBridge.builder()
                .name(bridgeName)
                .datapathId(datapathId)
                .controllers(controllerInfos)
                .build();
    } else {
        return OvsdbBridge.builder()
                .name(bridgeName)
                .datapathId(datapathId)
                .build();
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:40,代碼來源:DefaultOvsdbClient.java


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