本文整理汇总了Java中org.onosproject.ovsdb.rfc.message.UpdateNotification类的典型用法代码示例。如果您正苦于以下问题:Java UpdateNotification类的具体用法?Java UpdateNotification怎么用?Java UpdateNotification使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UpdateNotification类属于org.onosproject.ovsdb.rfc.message包,在下文中一共展示了UpdateNotification类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的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();
}
}
示例2: jsonCallbackRequestParser
import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的package包/类
/**
* When monitor the ovsdb tables, if a table update, ovs send update
* notification, then call callback function.
* @param jsonNode the result JsonNode
* @param callback the callback function
* @throws UnsupportedException this is an unsupported exception
*/
public static void jsonCallbackRequestParser(JsonNode jsonNode, Callback callback) {
ObjectMapper objectMapper = ObjectMapperUtil.getObjectMapper();
JsonNode params = jsonNode.get("params");
Object param = null;
String methodName = jsonNode.get("method").asText();
switch (methodName) {
case "update":
param = objectMapper.convertValue(params, UpdateNotification.class);
callback.update((UpdateNotification) param);
break;
default:
throw new UnsupportedException("does not support this callback method: " + methodName);
}
}
示例3: deserialize
import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的package包/类
/**
* JsonNode convert into UpdateNotification.
* @param node the "params" node of UpdateNotification JsonNode
*/
private UpdateNotification deserialize(JsonNode node) {
if (node.isArray()) {
if (node.size() == 2) {
return new UpdateNotification(node.get(0).asText(), node.get(1));
}
}
return null;
}
示例4: convert
import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的package包/类
@Override
public UpdateNotification convert(JsonNode value) {
return deserialize(value);
}
示例5: update
import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的package包/类
/**
* The "update" notification is sent by the server to the client to report
* changes in tables that are being monitored following a "*monitor"
* request.
* @param updateNotification the information of the update
*/
void update(UpdateNotification updateNotification);