本文整理汇总了Java中org.onosproject.ovsdb.rfc.message.TableUpdates类的典型用法代码示例。如果您正苦于以下问题:Java TableUpdates类的具体用法?Java TableUpdates怎么用?Java TableUpdates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableUpdates类属于org.onosproject.ovsdb.rfc.message包,在下文中一共展示了TableUpdates类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: monitorTables
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
@Override
public ListenableFuture<TableUpdates> monitorTables(String dbName, String id) {
if (dbName == null) {
return null;
}
DatabaseSchema dbSchema = schema.get(dbName);
if (dbSchema != null) {
Function<JsonNode, TableUpdates> rowFunction = new Function<JsonNode, TableUpdates>() {
@Override
public TableUpdates apply(JsonNode input) {
log.info("Get table updates");
TableUpdates updates = FromJsonUtil
.jsonNodeToTableUpdates(input, dbSchema);
if (updates == null) {
log.debug("Get table updates error");
return null;
}
return updates;
}
};
return Futures.transform(monitor(dbSchema, id), rowFunction);
}
return null;
}
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:DefaultOvsdbClient.java
示例2: update
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
@Override
public void update(UpdateNotification updateNotification) {
Object key = updateNotification.jsonValue();
OvsdbClientService ovsdbClient = requestNotification.get(key);
String dbName = requestDbName.get(key);
JsonNode updatesJson = updateNotification.tbUpdatesJsonNode();
DatabaseSchema dbSchema = ovsdbClient.getDatabaseSchema(dbName);
TableUpdates updates = FromJsonUtil
.jsonNodeToTableUpdates(updatesJson, dbSchema);
try {
processTableUpdates(ovsdbClient, updates, dbName);
} catch (InterruptedException e) {
log.warn("Interrupted while processing table updates");
Thread.currentThread().interrupt();
}
}
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OvsdbControllerImpl.java
示例3: monitorTables
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
@Override
public ListenableFuture<TableUpdates> monitorTables(String dbName, String id) {
if (dbName == null) {
return null;
}
DatabaseSchema dbSchema = schema.get(dbName);
if (dbSchema != null) {
Function<JsonNode, TableUpdates> rowFunction = input -> {
log.debug("Get table updates");
TableUpdates updates = FromJsonUtil.jsonNodeToTableUpdates(input, dbSchema);
if (updates == null) {
log.debug("Get table updates error");
return null;
}
return updates;
};
return Futures.transform(monitor(dbSchema, id), rowFunction);
}
return null;
}
开发者ID:opennetworkinglab,项目名称:onos,代码行数:21,代码来源:DefaultOvsdbClient.java
示例4: processTableUpdates
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
/**
* Processes table updates.
*
* @param clientService OvsdbClientService instance
* @param updates TableUpdates instance
* @param dbName ovsdb database name
*/
private void processTableUpdates(OvsdbClientService clientService,
TableUpdates updates, String dbName)
throws InterruptedException {
checkNotNull(clientService, "OvsdbClientService is not null");
DatabaseSchema dbSchema = clientService.getDatabaseSchema(dbName);
for (String tableName : updates.result().keySet()) {
TableUpdate update = updates.result().get(tableName);
for (Uuid uuid : (Set<Uuid>) update.rows().keySet()) {
log.debug("Begin to process table updates uuid: {}, databaseName: {}, tableName: {}",
uuid.value(), dbName, tableName);
Row newRow = update.getNew(uuid);
if (newRow != null) {
clientService.updateOvsdbStore(dbName, tableName,
uuid.value(), newRow);
if (OvsdbConstant.INTERFACE.equals(tableName)) {
dispatchInterfaceEvent(clientService,
newRow,
OvsdbEvent.Type.PORT_ADDED,
dbSchema);
}
} else if (update.getOld(uuid) != null) {
if (OvsdbConstant.INTERFACE.equals(tableName)) {
Row row = clientService.getRow(OvsdbConstant.DATABASENAME, tableName, uuid.value());
dispatchInterfaceEvent(clientService,
row,
OvsdbEvent.Type.PORT_REMOVED,
dbSchema);
}
clientService.removeRow(dbName, tableName, uuid.value());
}
}
}
}
开发者ID:shlee89,项目名称:athena,代码行数:45,代码来源:OvsdbControllerImpl.java
示例5: jsonNodeToTableUpdates
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
/**
* convert the params of Update Notification into TableUpdates.
* @param updatesJson the params of Update Notification
* @param dbSchema DatabaseSchema entity
* @return TableUpdates
*/
public static TableUpdates jsonNodeToTableUpdates(JsonNode updatesJson, DatabaseSchema dbSchema) {
Map<String, TableUpdate> tableUpdateMap = Maps.newHashMap();
Iterator<Map.Entry<String, JsonNode>> tableUpdatesItr = updatesJson.fields();
while (tableUpdatesItr.hasNext()) {
Map.Entry<String, JsonNode> entry = tableUpdatesItr.next();
TableSchema tableSchema = dbSchema.getTableSchema(entry.getKey());
TableUpdate tableUpdate = jsonNodeToTableUpdate(tableSchema, entry.getValue());
tableUpdateMap.put(entry.getKey(), tableUpdate);
}
return TableUpdates.tableUpdates(tableUpdateMap);
}
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:FromJsonUtil.java
示例6: monitorTables
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
@Override
public ListenableFuture<TableUpdates> monitorTables(String dbName, String id) {
return null;
}
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:OvsdbClientServiceAdapter.java
示例7: monitorTables
import org.onosproject.ovsdb.rfc.message.TableUpdates; //导入依赖的package包/类
/**
* Gets the OVSDB table updates.
*
* @param dbName database name
* @param id random uuid
* @return table updates
*/
ListenableFuture<TableUpdates> monitorTables(String dbName, String id);
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:OvsdbClientService.java
注:本文中的org.onosproject.ovsdb.rfc.message.TableUpdates类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论