当前位置: 首页>>代码示例>>Java>>正文


Java UpdateNotification类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OvsdbControllerImpl.java

示例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);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:FromJsonUtil.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:UpdateNotificationConverter.java

示例4: convert

import org.onosproject.ovsdb.rfc.message.UpdateNotification; //导入依赖的package包/类
@Override
public UpdateNotification convert(JsonNode value) {
    return deserialize(value);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:UpdateNotificationConverter.java

示例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);
 
开发者ID:shlee89,项目名称:athena,代码行数:8,代码来源:Callback.java


注:本文中的org.onosproject.ovsdb.rfc.message.UpdateNotification类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。