本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}