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

Java DataChangeListener类代码示例

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

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



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

示例1: testDataChangeListener

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testDataChangeListener() throws Exception {
    DataChangeListener listener = mock(DataChangeListener.class);
    InstanceIdentifier<ListItem> wildCard = InstanceIdentifier.builder(ListenerTest.class)
            .child(ListItem.class).build();
    ListenerRegistration<DataChangeListener> reg = getDataBroker().registerDataChangeListener(
            LogicalDatastoreType.OPERATIONAL, wildCard, listener, AsyncDataBroker.DataChangeScope.SUBTREE);

    final ListItem item = writeListItem();

    ArgumentCaptor<AsyncDataChangeEvent> captor = ArgumentCaptor.forClass(AsyncDataChangeEvent.class);

    verify(listener, timeout(100)).onDataChanged(captor.capture());

    AsyncDataChangeEvent event = captor.getValue();
    assertEquals("createdData", 1, event.getCreatedData().size());
    assertEquals("ListItem", item, event.getCreatedData().values().iterator().next());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:Bug4513Test.java


示例2: registerDataChangeListeners

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
private List<Registration> registerDataChangeListeners() {
    Preconditions.checkNotNull(dataBroker);
    List<Registration> registrations = Lists.newArrayList();
    try {
        //Register listener for config updates and topology
        InstanceIdentifier<AclSpec> aclSpecIID = InstanceIdentifier.builder(AclSpec.class)
                .build();
        ListenerRegistration<DataChangeListener> registration = dataBroker.registerDataChangeListener(
                LogicalDatastoreType.CONFIGURATION,
                aclSpecIID, this, AsyncDataBroker.DataChangeScope.SUBTREE);
        LOG.debug("DataChangeListener registered with MD-SAL for path {}", aclSpecIID);
        registrations.add(registration);

    } catch (Exception e) {
        LOG.error("Exception reached {}", e);
    }
    return registrations;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:19,代码来源:TutorialACL.java


示例3: registerDataChangeListeners

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
private List<Registration> registerDataChangeListeners() {
    Preconditions.checkNotNull(dataBroker);
    List<Registration> registrations = Lists.newArrayList();
    try {
        //Register listener for config updates and topology
        InstanceIdentifier<TapSpec> tapSpecIID = InstanceIdentifier.builder(TapSpec.class)
                .build();
        ListenerRegistration<DataChangeListener> registration = dataBroker.registerDataChangeListener(
                LogicalDatastoreType.CONFIGURATION,
                tapSpecIID, this, AsyncDataBroker.DataChangeScope.SUBTREE);
        LOG.debug("DataChangeListener registered with MD-SAL for path {}", tapSpecIID);
        registrations.add(registration);

    } catch (Exception e) {
        LOG.error("Exception reached {}", e);
    }
    return registrations;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:19,代码来源:TutorialTapProvider.java


示例4: registerDataChangeListener

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
public ListenerRegistration<DataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
        final InstanceIdentifier<?> path, final DataChangeListener listener, final DataChangeScope triggeringScope) {
    final DOMDataChangeListener domDataChangeListener;

    if(listener instanceof ClusteredDataChangeListener) {
        domDataChangeListener = new TranslatingClusteredDataChangeInvoker(store, path, listener, triggeringScope);
    } else {
        domDataChangeListener = new TranslatingDataChangeInvoker(store, path, listener,
            triggeringScope);
    }
    final YangInstanceIdentifier domPath = codec.toYangInstanceIdentifierBlocking(path);
    final ListenerRegistration<DOMDataChangeListener> domRegistration = domDataBroker.registerDataChangeListener(store,
            domPath, domDataChangeListener, triggeringScope);
    return new ListenerRegistrationImpl(listener, domRegistration);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:AbstractForwardedDataBroker.java


示例5: TranslatingDataChangeInvoker

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
public TranslatingDataChangeInvoker(final LogicalDatastoreType store, final InstanceIdentifier<?> path,
        final DataChangeListener bindingDataChangeListener, final DataChangeScope triggeringScope) {
    this.store = store;
    this.path = path;
    this.bindingDataChangeListener = bindingDataChangeListener;
    this.triggeringScope = triggeringScope;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:AbstractForwardedDataBroker.java


示例6: TranslatingClusteredDataChangeInvoker

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
public TranslatingClusteredDataChangeInvoker(final LogicalDatastoreType store, final InstanceIdentifier<?> path,
                                             final DataChangeListener bindingDataChangeListener,
                                             final DataChangeScope triggeringScope) {
    super(store, path, bindingDataChangeListener, triggeringScope);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:AbstractForwardedDataBroker.java


示例7: ListenerRegistrationImpl

import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; //导入依赖的package包/类
public ListenerRegistrationImpl(final DataChangeListener listener,
        final ListenerRegistration<DOMDataChangeListener> registration) {
    super(listener);
    this.registration = registration;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:AbstractForwardedDataBroker.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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