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


Java DataObjectModification.ModificationType方法代码示例

本文整理汇总了Java中org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType方法的典型用法代码示例。如果您正苦于以下问题:Java DataObjectModification.ModificationType方法的具体用法?Java DataObjectModification.ModificationType怎么用?Java DataObjectModification.ModificationType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.md.sal.binding.api.DataObjectModification的用法示例。


在下文中一共展示了DataObjectModification.ModificationType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getModificationType

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
@Override
public DataObjectModification.ModificationType getModificationType() {
    switch(domData.getModificationType()) {
        case WRITE:
            return DataObjectModification.ModificationType.WRITE;
        case APPEARED:
        case SUBTREE_MODIFIED:
            return DataObjectModification.ModificationType.SUBTREE_MODIFIED;
        case DISAPPEARED:
        case DELETE:
            return DataObjectModification.ModificationType.DELETE;
        default:
            // TODO: Should we lie about modification type instead of exception?
            throw new IllegalStateException("Unsupported DOM Modification type " + domData.getModificationType());
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:LazyDataObjectModification.java

示例2: extractDataChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
/**
 * Only when Subtree modification happen this is called .
 * @param key - IID of child data
 * @param parentModification - Modified data
 * @param updatedMacsGrouped - Subtree updated data
 * @param deletedMacsGrouped - Subtree deleted datas
 */
private void extractDataChanged(final InstanceIdentifier<P> key,
                                final DataObjectModification<P> parentModification,
                                final Map<G, Map<InstanceIdentifier, C>> updatedMacsGrouped,
                                final Map<G, Map<InstanceIdentifier, C>> deletedMacsGrouped) {

    Map<InstanceIdentifier<C>, DataObjectModification<C>> children = getChildMod(key, parentModification);
    for (Map.Entry<InstanceIdentifier<C>, DataObjectModification<C>> entry : children.entrySet()) {
        DataObjectModification<C> childMod = entry.getValue();
        InstanceIdentifier<C> childIid = entry.getKey();
        DataObjectModification.ModificationType modificationType = getModificationType(childMod);
        G group;
        C dataBefore = childMod.getDataBefore();
        C dataAfter = childMod.getDataAfter();
        switch (modificationType) {
            case WRITE:
            case SUBTREE_MODIFIED:
                group = getGroup(childIid, dataAfter);
                updatedMacsGrouped.computeIfAbsent(group, (grp) -> new ConcurrentHashMap<>());
                updatedMacsGrouped.get(group).put(childIid, dataAfter);
                break;
            case DELETE:
                group = getGroup(childIid, dataBefore);
                deletedMacsGrouped.computeIfAbsent(group, (grp) -> new ConcurrentHashMap<>());
                deletedMacsGrouped.get(group).put(childIid, dataBefore);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:38,代码来源:ChildListener.java

示例3: getModificationType

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
protected DataObjectModification.ModificationType getModificationType(
        final DataObjectModification<? extends DataObject> mod) {
    try {
        return mod.getModificationType();
    } catch (IllegalStateException e) {
        //LOG.warn("Failed to get the modification type for mod {}", mod);
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:10,代码来源:ChildListener.java

示例4: getModificationType

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
private DataObjectModification.ModificationType getModificationType(
        DataObjectModification<? extends DataObject> mod) {
    try {
        return mod.getModificationType();
    } catch (IllegalStateException e) {
        //not sure why this getter throws this exception, could be some mdsal bug
        LOG.warn("Failed to get the modification type for mod {}", mod);
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:TransactCommandAggregator.java

示例5: extractDataChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
private void extractDataChanged(final Collection<DataObjectModification<? extends DataObject>> children,
                                final Map<Class<? extends Identifiable>, List<Identifiable>> updatedData,
                                final Map<Class<? extends Identifiable>, List<Identifiable>> deletedData) {
    if (children == null) {
        return;
    }
    for (DataObjectModification<? extends DataObject> child : children) {
        DataObjectModification.ModificationType type = getModificationType(child);
        if (type == null) {
            continue;
        }
        InstanceIdentifier instanceIdentifier = null;
        Class<? extends Identifiable> childClass = (Class<? extends Identifiable>) child.getDataType();
        InstanceIdentifier.PathArgument pathArgument = child.getIdentifier();
        switch (type) {
            case WRITE:
            case SUBTREE_MODIFIED:
                DataObject dataAfter = child.getDataAfter();
                if (!(dataAfter instanceof Identifiable)) {
                    continue;
                }
                DataObject before = child.getDataBefore();
                if (Objects.equals(dataAfter, before)) {
                    /*
                    in cluster reboot scenarios,
                    application rewrites the data tx.put( logicalswitchiid, logicalswitch )
                    that time it fires the update again ignoring such updates here
                     */
                    continue;
                }
                Identifiable identifiable = (Identifiable) dataAfter;
                addToUpdatedData(updatedData, childClass, identifiable);
                break;
            case DELETE:
                DataObject dataBefore = child.getDataBefore();
                if (!(dataBefore instanceof Identifiable)) {
                    continue;
                }
                addToUpdatedData(deletedData, childClass, (Identifiable)dataBefore);
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:44,代码来源:TransactCommandAggregator.java


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