本文整理匯總了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());
}
示例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());
}
示例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;
}
示例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();
}
}