当前位置: 首页>>代码示例>>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;未经允许,请勿转载。