• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ModificationType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ModificationType类属于org.opendaylight.controller.md.sal.binding.api.DataObjectModification包,在下文中一共展示了ModificationType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Descriptors>> changes) {
    for (DataTreeModification<Descriptors> descModification : changes) {
        LOG.info("Descriptor Change has occured for Tenant-Id {} / Descriptor-Id {}",tenantId,
                descModification.getRootPath().toString());
        if (descModification.getRootNode().getModificationType() == ModificationType.DELETE) {
            removeDescriptor(descModification.getRootNode().getDataBefore());
        } else {
            try {
               addDescriptor(descModification.getRootNode().getDataAfter());
           } catch (Exception e) {
               ErrorLog.logError("DescriptorChangeManager - Error occured during Descriptor Create/Write - " + e.getLocalizedMessage(), e.getStackTrace());
           }
        }

    }
}
 
开发者ID:opendaylight,项目名称:fpc,代码行数:18,代码来源:PolicyManager.java


示例2: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Contexts>> changes) {
    for (DataTreeModification<Contexts> cntxModification : changes) {
        LOG.info("Descriptor Change has occured for Tenant-Id {} / Descriptor-Id {}",tenantId,
                cntxModification.getRootPath().toString());
        if (cntxModification.getRootNode().getModificationType() == ModificationType.DELETE) {
            removeContext(cntxModification.getRootNode().getDataBefore());
        } else {
            try {
               addContext(cntxModification.getRootNode().getDataAfter());
           } catch (Exception e) {
               ErrorLog.logError("DescriptorChangeManager - Error occured during Descriptor Create/Write - " + e.getLocalizedMessage(), e.getStackTrace());
           }
        }

    }
}
 
开发者ID:opendaylight,项目名称:fpc,代码行数:18,代码来源:PortManager.java


示例3: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<DpnGroups>> changes) {
    for (DataTreeModification<DpnGroups> dpnGroupModification : changes) {
        LOG.info("Dpn Groups Change has occured for " + dpnGroupModification.getRootPath().toString());
        if (dpnGroupModification.getRootNode().getModificationType() == ModificationType.DELETE) {
            removeDpnGroup(dpnGroupModification.getRootNode().getDataBefore());
        } else {
            try {
                loadDpnGroup(dpnGroupModification.getRootNode().getDataAfter());
           } catch (Exception e) {
               ErrorLog.logError("DpnChangeManager - Error occured during DPN Create/Write - " + e.getLocalizedMessage(), e.getStackTrace());
           }
        }

    }
}
 
开发者ID:opendaylight,项目名称:fpc,代码行数:17,代码来源:DpnAssignmentMgr.java


示例4: logDataTreeChangeEvent

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private static synchronized void logDataTreeChangeEvent(final int eventNum,
        final Collection<DataTreeModification<TestExec>> changes) {
    LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);

    for (DataTreeModification<TestExec> change : changes) {
        final DataObjectModification<TestExec> rootNode = change.getRootNode();
        final ModificationType modType = rootNode.getModificationType();
        final PathArgument changeId = rootNode.getIdentifier();
        final Collection<DataObjectModification<? extends DataObject>> modifications =
                rootNode.getModifiedChildren();

        LOG.debug("    changeId {}, modType {}, mods: {}", changeId, modType, modifications.size());

        for (DataObjectModification<? extends DataObject> mod : modifications) {
            LOG.debug("      mod-getDataAfter: {}", mod.getDataAfter());
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:DsbenchmarkListener.java


示例5: testTopLevelListener

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Test
public void testTopLevelListener() throws Exception {
    final EventCapturingListener<Top> listener = new EventCapturingListener<>();
    dataBrokerImpl.registerDataTreeChangeListener(TOP_IDENTIFIER, listener);

    createAndVerifyTop(listener);

    putTx(BAR_PATH, BAR_DATA).submit().checkedGet();
    final DataObjectModification<Top> afterBarPutEvent = Iterables.getOnlyElement(listener.nextEvent()).getRootNode();
    verifyModification(afterBarPutEvent, TOP_ARGUMENT, ModificationType.SUBTREE_MODIFIED);
    final DataObjectModification<TopLevelList> barPutMod = afterBarPutEvent.getModifiedChildListItem(TopLevelList.class, TOP_BAR_KEY);
    assertNotNull(barPutMod);
    verifyModification(barPutMod, BAR_ARGUMENT, ModificationType.WRITE);

    deleteTx(BAR_PATH).submit().checkedGet();
    final DataObjectModification<Top> afterBarDeleteEvent = Iterables.getOnlyElement(listener.nextEvent()).getRootNode();
    verifyModification(afterBarDeleteEvent, TOP_ARGUMENT, ModificationType.SUBTREE_MODIFIED);
    final DataObjectModification<TopLevelList> barDeleteMod = afterBarDeleteEvent.getModifiedChildListItem(TopLevelList.class, TOP_BAR_KEY);
    verifyModification(barDeleteMod, BAR_ARGUMENT, ModificationType.DELETE);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:DataTreeChangeListenerTest.java


示例6: testWildcardedListListener

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Test
public void testWildcardedListListener() throws Exception {
    final EventCapturingListener<TopLevelList> listener = new EventCapturingListener<>();
    final DataTreeIdentifier<TopLevelList> wildcard = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, TOP_PATH.child(TopLevelList.class));
    dataBrokerImpl.registerDataTreeChangeListener(wildcard, listener);

    putTx(TOP_PATH, TOP_INITIAL_DATA).submit().checkedGet();

    final DataTreeModification<TopLevelList> fooWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
    assertEquals(FOO_PATH, fooWriteEvent.getRootPath().getRootIdentifier());
    verifyModification(fooWriteEvent.getRootNode(), FOO_ARGUMENT, ModificationType.WRITE);

    putTx(BAR_PATH, BAR_DATA).submit().checkedGet();
    final DataTreeModification<TopLevelList> barWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
    assertEquals(BAR_PATH, barWriteEvent.getRootPath().getRootIdentifier());
    verifyModification(barWriteEvent.getRootNode(), BAR_ARGUMENT, ModificationType.WRITE);

    deleteTx(BAR_PATH).submit().checkedGet();
    final DataTreeModification<TopLevelList> barDeleteEvent = Iterables.getOnlyElement(listener.nextEvent());
    assertEquals(BAR_PATH, barDeleteEvent.getRootPath().getRootIdentifier());
    verifyModification(barDeleteEvent.getRootNode(), BAR_ARGUMENT, ModificationType.DELETE);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:DataTreeChangeListenerTest.java


示例7: ouputChanges

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的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


示例8: testIpv4RouteAdd

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
/**
 * Tests adding a IPv4 route entry.
 */
@Test
public void testIpv4RouteAdd() {
	String nextHopIp = "192.168.10.1";
	String prefix = "1.1.1.0/24";

	AtriumIpPrefix ipv4Prefix = AtriumIpPrefix.valueOf(prefix);
	AtriumIpAddress ipv4Address = AtriumIpAddress.valueOf(nextHopIp);
	RouteEntry routeEntry = new RouteEntry(ipv4Prefix, ipv4Address);

	DataTreeModification routeUpdate = getRouteUpdate(prefix, nextHopIp, ModificationType.WRITE);

	ribManager.processRouteUpdates(routeUpdate);

	assertEquals(1, ribManager.getRoutes4().size());
	assertTrue(ribManager.getRoutes4().contains(routeEntry));
	verify(fibListener, times(1)).update(anyObject(), anyObject());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:21,代码来源:RibManagerTest.java


示例9: testIpv4RouteUpdate

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
/**
 * Tests updating a IPv4 route entry.
 */
@Test
public void testIpv4RouteUpdate() {
	// Firstly add a route
	testIpv4RouteAdd();

	String nextHopIp = "192.168.20.1";
	String prefix = "1.1.1.0/24";

	AtriumIpPrefix ipv4Prefix = AtriumIpPrefix.valueOf(prefix);
	AtriumIpAddress ipv4Address = AtriumIpAddress.valueOf(nextHopIp);
	RouteEntry routeEntry = new RouteEntry(ipv4Prefix, ipv4Address);

	DataTreeModification routeUpdate = getRouteUpdate(prefix, nextHopIp, ModificationType.SUBTREE_MODIFIED);

	ribManager.processRouteUpdates(routeUpdate);

	assertEquals(1, ribManager.getRoutes4().size());
	assertTrue(ribManager.getRoutes4().contains(routeEntry));
	verify(fibListener, atLeast(1)).update(anyObject(), anyObject());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:24,代码来源:RibManagerTest.java


示例10: testIpv4RouteDelete

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
/**
 * Tests deleting a IPv4 route entry.
 */
@Test
public void testIpv4RouteDelete() {
	testIpv4RouteAdd();
	testIpv4RouteUpdate();

	String nextHopIp = "192.168.10.1";
	String prefix = "1.1.1.0/24";

	AtriumIpPrefix ipv4Prefix = AtriumIpPrefix.valueOf(prefix);
	AtriumIpAddress ipv4Address = AtriumIpAddress.valueOf(nextHopIp);
	RouteEntry routeEntry = new RouteEntry(ipv4Prefix, ipv4Address);

	DataTreeModification routeUpdate = getRouteUpdate(prefix, nextHopIp, ModificationType.DELETE);

	ribManager.processRouteUpdates(routeUpdate);

	assertFalse(ribManager.getRoutes4().contains(routeEntry));
	verify(fibListener, atLeast(1)).update(anyObject(), anyObject());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:23,代码来源:RibManagerTest.java


示例11: testIpv4LocalRouteAdd

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
/**
 * Tests adding a IPv4 route whose next hop is the local BGP speaker.
 */
@Test
public void testIpv4LocalRouteAdd() {
	String nextHopIp = "192.168.30.1";
	String prefix = "1.1.1.0/24";

	AtriumIpPrefix ipv4Prefix = AtriumIpPrefix.valueOf(prefix);
	AtriumIpAddress ipv4Address = AtriumIpAddress.valueOf(nextHopIp);
	RouteEntry routeEntry = new RouteEntry(ipv4Prefix, ipv4Address);

	DataTreeModification routeUpdate = getRouteUpdate(prefix, nextHopIp, ModificationType.WRITE);
	
	ribManager.processRouteUpdates(routeUpdate);

	assertEquals(1, ribManager.getRoutes4().size());
	assertTrue(ribManager.getRoutes4().contains(routeEntry));
	verify(fibListener, never()).update(anyObject(), anyObject());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:21,代码来源:RibManagerTest.java


示例12: onDataTreeChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Hostconfig>> hostConfigDtm) {
    for (DataTreeModification<Hostconfig> dtm : hostConfigDtm) {
        ModificationType mod = dtm.getRootNode().getModificationType();
        switch (mod) {
            case WRITE: {
                sf.set(1);
                break;
            }
            case DELETE: {
                sf.set(2);
                break;
            }
            default:
        }
    }
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:18,代码来源:NeutronHostconfigVppListenerTest.java


示例13: updateDeviceOpData

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private void updateDeviceOpData(InstanceIdentifier<Node> key, DataObjectModification<? extends DataObject> mod) {
    ModificationType type = getModificationType(mod);
    if (type == null) {
        return;
    }
    Class<? extends Identifiable> childClass = (Class<? extends Identifiable>) mod.getDataType();
    InstanceIdentifier instanceIdentifier = getKey(key, mod, mod.getDataAfter());
    switch(type) {
        case WRITE:
            connectionInstance.getDeviceInfo().updateDeviceOperData(childClass, instanceIdentifier,
                    new UUID("uuid"), mod.getDataAfter());
            break;
        case DELETE:
            connectionInstance.getDeviceInfo().clearDeviceOperData(childClass, instanceIdentifier);
            break;
        case SUBTREE_MODIFIED:
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:HwvtepOperationalDataChangeListener.java


示例14: onAppConfigChanged

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private void onAppConfigChanged(final Collection<DataTreeModification<DataObject>> changes) {
    for (DataTreeModification<DataObject> change: changes) {
        DataObjectModification<DataObject> changeRoot = change.getRootNode();
        ModificationType type = changeRoot.getModificationType();

        LOG.debug("{}: onAppConfigChanged: {}, {}", logName(), type, change.getRootPath());

        if (type == ModificationType.SUBTREE_MODIFIED || type == ModificationType.WRITE) {
            DataObject newAppConfig = changeRoot.getDataAfter();

            LOG.debug("New app config instance: {}, previous: {}", newAppConfig, currentAppConfig);

            if (!setInitialAppConfig(Optional.of(newAppConfig))
                    && !Objects.equals(currentAppConfig, newAppConfig)) {
                LOG.debug("App config was updated");

                if (appConfigUpdateStrategy == UpdateStrategy.RELOAD) {
                    restartContainer();
                }
            }
        } else if (type == ModificationType.DELETE) {
            LOG.debug("App config was deleted");

            if (appConfigUpdateStrategy == UpdateStrategy.RELOAD) {
                restartContainer();
            }
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:30,代码来源:DataStoreAppConfigMetadata.java


示例15: createAndVerifyTop

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private void createAndVerifyTop(final EventCapturingListener<Top> listener) throws Exception {
    putTx(TOP_PATH,TOP_INITIAL_DATA).submit().checkedGet();
    final Collection<DataTreeModification<Top>> events = listener.nextEvent();

    assertFalse("Non empty collection should be received.",events.isEmpty());
    final DataTreeModification<Top> initialWrite = Iterables.getOnlyElement(events);
    final DataObjectModification<? extends DataObject> initialNode = initialWrite.getRootNode();
    verifyModification(initialNode,TOP_PATH.getPathArguments().iterator().next(),ModificationType.WRITE);
    assertEquals(TOP_INITIAL_DATA, initialNode.getDataAfter());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:DataTreeChangeListenerTest.java


示例16: getRouteUpdate

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
public DataTreeModification getRouteUpdate(String prefix, String nextHopIp, ModificationType operation) {
	DataTreeModification routeUpdate = mock(DataTreeModification.class);
	
	Ipv4Prefix ipv4Prefix = new Ipv4Prefix(prefix);
	Ipv4Address ipv4Address = new Ipv4Address(nextHopIp);
	
	DataObjectModification root = mock(DataObjectModification.class);
	InstanceIdentifier instanceIdentifier = mock(InstanceIdentifier.class);
	DataTreeIdentifier treeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.CONFIGURATION,
			instanceIdentifier);

	DataObject dataObject = mock(DataObject.class);
	Ipv4Route route = mock(Ipv4Route.class);
	Attributes attributes = mock(Attributes.class);
	Ipv4NextHopCase nhc = mock(Ipv4NextHopCase.class);
	Ipv4NextHop ipv4NextHop = mock(Ipv4NextHop.class);

	when(routeUpdate.getRootNode()).thenReturn(root);
	when(root.getModificationType()).thenReturn(operation);
	when(root.getDataAfter()).thenReturn(route);
	when(route.getAttributes()).thenReturn(attributes);
	when(attributes.getCNextHop()).thenReturn(nhc);
	when(nhc.getIpv4NextHop()).thenReturn(ipv4NextHop);
	when(ipv4NextHop.getGlobal()).thenReturn(ipv4Address);
	when(route.getPrefix()).thenReturn(ipv4Prefix);
	when(routeUpdate.getRootPath()).thenReturn(treeIdentifier);
	
	return routeUpdate;
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:30,代码来源:RibManagerTest.java


示例17: handleModification

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private synchronized void handleModification(final DataObjectModification<BmpMonitorConfig> config) {
    final ModificationType modificationType = config.getModificationType();
    LOG.trace("Bmp Monitor configuration has changed: {}, type modification {}", config, modificationType);
    switch (modificationType) {
        case DELETE:
            removeBmpMonitor(config.getDataBefore().getMonitorId());
            break;
        case SUBTREE_MODIFIED:
        case WRITE:
            updateBmpMonitor(config.getDataAfter());
            break;
        default:
            break;
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:16,代码来源:BmpDeployerImpl.java


示例18: getCreated

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
private Node getCreated(DataObjectModification<Node> mod) {
    if((mod.getModificationType() == ModificationType.WRITE)
                    && (mod.getDataBefore() == null)){
        return mod.getDataAfter();
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:HwvtepReconciliationManager.java


示例19: getCreated

import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType; //导入依赖的package包/类
public static Node getCreated(DataObjectModification<Node> mod) {
    if((mod.getModificationType() == ModificationType.WRITE)
                    && (mod.getDataBefore() == null)){
        return mod.getDataAfter();
    }
    return null;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:TransactUtils.java


示例20: getModificationType

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Point类代码示例发布时间:2022-05-23
下一篇:
Java Target类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap