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


Java DataObjectModification.getDataAfter方法代码示例

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


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

示例1: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
    for (DataTreeModification<Node> change: changes) {
        final DataObjectModification<Node> rootNode = change.getRootNode();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final Node node = rootNode.getDataAfter();
                if (getNodeIdRegexPattern().matcher(node.getNodeId().getValue()).matches()) {
                    notifyNode(change.getRootPath().getRootIdentifier());
                }
                break;
            default:
                break;
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:EventSourceTopic.java

示例2: ouputChanges

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
private static void ouputChanges(final DataTreeModification<Cars> change) {
    final DataObjectModification<Cars> rootNode = change.getRootNode();
    final ModificationType modificationType = rootNode.getModificationType();
    final InstanceIdentifier<Cars> rootIdentifier = change.getRootPath().getRootIdentifier();
    switch (modificationType) {
        case WRITE:
        case SUBTREE_MODIFIED: {
            final Cars dataBefore = rootNode.getDataBefore();
            final Cars dataAfter = rootNode.getDataAfter();
            LOG.trace("onDataTreeChanged - Cars config with path {} was added or changed from {} to {}",
                    rootIdentifier, dataBefore, dataAfter);
            break;
        }
        case DELETE: {
            LOG.trace("onDataTreeChanged - Cars config with path {} was deleted", rootIdentifier);
            break;
        }
        default: {
            LOG.trace("onDataTreeChanged called with unknown modificationType: {}", modificationType);
            break;
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:CarDataTreeChangeListener.java

示例3: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
/**
 * Implemented from the DataTreeChangeListener interface.
 */
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Toaster>> changes) {
    for (DataTreeModification<Toaster> change: changes) {
        DataObjectModification<Toaster> rootNode = change.getRootNode();
        if (rootNode.getModificationType() == WRITE) {
            Toaster oldToaster = rootNode.getDataBefore();
            Toaster newToaster = rootNode.getDataAfter();
            LOG.info("onDataTreeChanged - Toaster config with path {} was added or replaced: "
                    + "old Toaster: {}, new Toaster: {}", change.getRootPath().getRootIdentifier(),
                    oldToaster, newToaster);

            Long darkness = newToaster.getDarknessFactor();
            if (darkness != null) {
                darknessFactor.set(darkness);
            }
        } else if (rootNode.getModificationType() == DELETE) {
            LOG.info("onDataTreeChanged - Toaster config with path {} was deleted: old Toaster: {}",
                    change.getRootPath().getRootIdentifier(), rootNode.getDataBefore());
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:25,代码来源:OpendaylightToaster.java

示例4: onPodInterfacesChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void onPodInterfacesChanged(final DataObjectModification<Interface> dataObjectModification,
                                   final InstanceIdentifier<Pods> rootIdentifier,
                                   DataObjectModification<Pods> rootNode) {
    Pods pods = rootNode.getDataAfter();
    Pods podsBefore = rootNode.getDataBefore();
    Interface podInterfaceBefore = dataObjectModification.getDataBefore();
    Interface podInterfaceAfter = dataObjectModification.getDataAfter();
    switch (dataObjectModification.getModificationType()) {
        case DELETE:
            remove(podsBefore, podInterfaceBefore);
            break;
        case SUBTREE_MODIFIED:
            update(pods, podsBefore, podInterfaceBefore, podInterfaceAfter);
            break;
        case WRITE:
            if (podInterfaceBefore == null) {
                add(pods, podInterfaceAfter);
            } else {
                update(pods, podsBefore, podInterfaceBefore, podInterfaceAfter);
            }
            break;
        default:
            LOG.error("Unhandled Modificiation Type{} for {}", dataObjectModification.getModificationType(),
                    rootIdentifier);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:27,代码来源:PodListener.java

示例5: getUpdated

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public static Node getUpdated(DataObjectModification<Node> mod) {
    Node node = null;
    switch (mod.getModificationType()) {
        case SUBTREE_MODIFIED:
            node = mod.getDataAfter();
            break;
        case WRITE:
            if (mod.getDataAfter() !=  null) {
                node = mod.getDataAfter();
            }
            break;
        default:
            break;
    }
    return node;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:HwvtepHAUtil.java

示例6: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<ElanInterface>> changes) {
    for (DataTreeModification<ElanInterface> change : changes) {
        DataObjectModification<ElanInterface> mod = change.getRootNode();
        switch (mod.getModificationType()) {
            case DELETE:
                ElanUtils.removeElanInterfaceFromCache(mod.getDataBefore().getName());
                ElanUtils.removeElanInterfaceToElanInstanceCache(mod.getDataBefore().getElanInstanceName(),
                        mod.getDataBefore().getName());
                break;
            case SUBTREE_MODIFIED:
            case WRITE:
                ElanInterface elanInterface = mod.getDataAfter();
                ElanUtils.addElanInterfaceIntoCache(elanInterface.getName(), elanInterface);
                ElanUtils.addElanInterfaceToElanInstanceCache(elanInterface.getElanInstanceName(),
                        elanInterface.getName());
                break;
            default:
                throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
        }
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:CacheElanInterfaceListener.java

示例7: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<ElanInstance>> changes) {
    for (DataTreeModification<ElanInstance> change : changes) {
        DataObjectModification<ElanInstance> mod = change.getRootNode();
        switch (mod.getModificationType()) {
            case DELETE:
                ElanUtils.removeElanInstanceFromCache(mod.getDataBefore().getElanInstanceName());
                break;
            case SUBTREE_MODIFIED:
            case WRITE:
                ElanInstance elanInstance = mod.getDataAfter();
                ElanUtils.addElanInstanceIntoCache(elanInstance.getElanInstanceName(), elanInstance);
                break;
            default:
                throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
        }
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:CacheElanInstanceListener.java

示例8: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<LogicalRouter>> changes) {
    for (DataTreeModification<LogicalRouter> change: changes) {
        DataObjectModification<LogicalRouter> rootNode = change.getRootNode();
        final LogicalRouter originalRouter = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final LogicalRouter updatedRouter = rootNode.getDataAfter();
                if (originalRouter == null) {
                    LOG.debug("FABMGR: Create Logical Router event: {}", updatedRouter.getUuid().getValue());
                    ulnMappingEngine.handleLrCreateEvent(updatedRouter);
                } else {
                    LOG.debug("FABMGR: Logical Router Switch event: {}", updatedRouter.getUuid().getValue());
                    ulnMappingEngine.handleLrUpdateEvent(updatedRouter);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove Logical Router event: {}", originalRouter.getUuid().getValue());
                ulnMappingEngine.handleLrRemoveEvent(originalRouter);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:RouterListener.java

示例9: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<LogicalSwitch>> changes) {
    for (DataTreeModification<LogicalSwitch> change: changes) {
        DataObjectModification<LogicalSwitch> rootNode = change.getRootNode();
        final LogicalSwitch originalSwitch = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final LogicalSwitch updatedSwitch = rootNode.getDataAfter();
                if (originalSwitch == null) {
                    LOG.debug("FABMGR: Create Switch event: {}", updatedSwitch.getUuid().getValue());
                    ulnMappingEngine.handleLswCreateEvent(updatedSwitch);
                } else {
                    LOG.debug("FABMGR: Update Switch event: {}", updatedSwitch.getUuid().getValue());
                    ulnMappingEngine.handleLswUpdateEvent(updatedSwitch);
                }
                break;
            case DELETE:
                final LogicalSwitch deletedSwitch = rootNode.getDataBefore();
                LOG.debug("FABMGR: Remove Switch event: {}", deletedSwitch.getUuid().getValue());
                ulnMappingEngine.handleLswRemoveEvent(deletedSwitch);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:27,代码来源:SwitchListener.java

示例10: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<Subnet>> changes) {
    for (DataTreeModification<Subnet> change: changes) {
        DataObjectModification<Subnet> rootNode = change.getRootNode();
        final Subnet originalSubnet = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final Subnet updatedSubnet = rootNode.getDataAfter();
                if (originalSubnet == null) {
                    LOG.debug("FABMGR: Create Subnet event: {}", updatedSubnet.getUuid().getValue());
                    ulnMappingEngine.handleSubnetCreateEvent(updatedSubnet);
                } else {
                    LOG.debug("FABMGR: Update Subnet event: {}", updatedSubnet.getUuid().getValue());
                    ulnMappingEngine.handleSubnetUpdateEvent(updatedSubnet);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove Subnet event: {}", originalSubnet.getUuid().getValue());
                ulnMappingEngine.handleSubnetRemoveEvent(originalSubnet);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:SubnetListener.java

示例11: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<EndpointLocation>> changes) {
    for (DataTreeModification<EndpointLocation> change: changes) {
        DataObjectModification<EndpointLocation> rootNode = change.getRootNode();
        final EndpointLocation originalEPL = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final EndpointLocation updatedEPL = rootNode.getDataAfter();
                if (originalEPL == null) {
                    LOG.debug("FABMGR: Create EndpointLocation event: {}", updatedEPL.getUuid().getValue());
                    ulnMappingEngine.handleEndpointLocationCreateEvent(updatedEPL);
                } else {
                    LOG.debug("FABMGR: Update EndpointLocation event: {}", updatedEPL.getUuid().getValue());
                    ulnMappingEngine.handleEndpointLocationUpdateEvent(updatedEPL);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove EndpointLocation event: {}", originalEPL.getUuid().getValue());
                ulnMappingEngine.handleEndpointLocationRemoveEvent(originalEPL);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:EndpointLocationListener.java

示例12: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<Port>> changes) {
    for (DataTreeModification<Port> change: changes) {
        DataObjectModification<Port> rootNode = change.getRootNode();
        final Port originalPort = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final Port updatedPort = rootNode.getDataAfter();
                if (originalPort == null) {
                    LOG.debug("FABMGR: Create Port event: {}", updatedPort.getUuid().getValue());
                    ulnMappingEngine.handlePortCreateEvent(updatedPort);
                } else {
                    LOG.debug("FABMGR: Update Port event: {}", updatedPort.getUuid().getValue());
                    ulnMappingEngine.handlePortUpdateEvent(updatedPort);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove Port event: {}", originalPort.getUuid().getValue());
                ulnMappingEngine.handlePortRemoveEvent(originalPort);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:PortListener.java

示例13: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<Edge>> changes) {
    for (DataTreeModification<Edge> change: changes) {
        DataObjectModification<Edge> rootNode = change.getRootNode();
        final Edge originalEdge = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final Edge updatedEdge = rootNode.getDataAfter();
                if (originalEdge == null) {
                    LOG.debug("FABMGR: Create Edge event: {}", updatedEdge.getUuid().getValue());
                    ulnMappingEngine.handleEdgeCreateEvent(updatedEdge);
                } else {
                    LOG.debug("FABMGR: Update Edge event: {}", updatedEdge.getUuid().getValue());
                    ulnMappingEngine.handleEdgeUpdateEvent(updatedEdge);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove Edge event: {}", originalEdge.getUuid().getValue());
                ulnMappingEngine.handleEdgeRemoveEvent(originalEdge);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:EdgeListener.java

示例14: executeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
public void executeEvent(Collection<DataTreeModification<SecurityRuleGroups>> changes) {
    for (DataTreeModification<SecurityRuleGroups> change: changes) {
        DataObjectModification<SecurityRuleGroups> rootNode = change.getRootNode();
        final SecurityRuleGroups originalGroups = rootNode.getDataBefore();
        switch (rootNode.getModificationType()) {
            case WRITE:
            case SUBTREE_MODIFIED:
                final SecurityRuleGroups updatedGroups = rootNode.getDataAfter();
                if (rootNode.getDataBefore() == null) {
                    LOG.debug("FABMGR: Create SecurityRuleGroups event: {}", updatedGroups.getUuid().getValue());
                    ulnMappingEngine.handleSecurityRuleGroupsCreateEvent(updatedGroups);
                } else {
                    LOG.debug("FABMGR: Update SecurityRuleGroups event: {}", updatedGroups.getUuid().getValue());
                    updateRules(updatedGroups, originalGroups);
                }
                break;
            case DELETE:
                LOG.debug("FABMGR: Remove SecurityRuleGroups event: {}", originalGroups.getUuid().getValue());
                ulnMappingEngine.handleSecurityRuleGroupsRemoveEvent(originalGroups);
                break;
            default:
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:SecurityRuleGroupsListener.java

示例15: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; //导入方法依赖的package包/类
@Override
public synchronized void onDataTreeChanged(@Nonnull final Collection<DataTreeModification<DataChangeCounterConfig>> changes) {
    for (final DataTreeModification<DataChangeCounterConfig> dataTreeModification : changes) {
        final DataObjectModification<DataChangeCounterConfig> rootNode = dataTreeModification.getRootNode();
        switch (dataTreeModification.getRootNode().getModificationType()) {
            case DELETE:
                deleteCounterChange(rootNode.getDataBefore().getCounterId());
                break;
            case SUBTREE_MODIFIED:
            case WRITE:
                final DataChangeCounterConfig change = rootNode.getDataAfter();
                chandleCounterChange(change.getCounterId(), change.getTopologyName());
                break;
        }
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:TopologyDataChangeCounterDeployer.java


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