Search in sources :

Example 1 with ClusteredDataTreeChangeListener

use of org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener in project controller by opendaylight.

the class BindingDOMDataTreeChangeServiceAdapter method registerDataTreeChangeListener.

@Override
public <T extends DataObject, L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener(final DataTreeIdentifier<T> treeId, final L listener) {
    final DOMDataTreeIdentifier domIdentifier = toDomTreeIdentifier(treeId);
    @SuppressWarnings({ "rawtypes", "unchecked" }) final BindingDOMDataTreeChangeListenerAdapter<T> domListener = listener instanceof ClusteredDataTreeChangeListener ? new BindingClusteredDOMDataTreeChangeListenerAdapter<>(codec, (ClusteredDataTreeChangeListener) listener, treeId.getDatastoreType()) : new BindingDOMDataTreeChangeListenerAdapter<>(codec, listener, treeId.getDatastoreType());
    final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter<T>> domReg = dataTreeChangeService.registerDataTreeChangeListener(domIdentifier, domListener);
    return new BindingDataTreeChangeListenerRegistration<>(listener, domReg);
}
Also used : ClusteredDataTreeChangeListener(org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener) DOMDataTreeIdentifier(org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier)

Aggregations

ClusteredDataTreeChangeListener (org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener)1 DOMDataTreeIdentifier (org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier)1