import java.util.Map;
import java.util.Map.Entry;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.Builder;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
*/
final class ResolveDataChangeState {
private static final Logger LOG = LoggerFactory.getLogger(ResolveDataChangeState.class);
+
/**
- * Inherited from all parents
+ * Inherited from all parents.
*/
private final Iterable<Builder> inheritedSub;
+
/**
- * Inherited from immediate parent
+ * Inherited from immediate parent.
*/
private final Collection<Builder> inheritedOne;
private final YangInstanceIdentifier nodeId;
for (DataChangeListenerRegistration<?> l : n.getRegistrations()) {
final Builder b = DOMImmutableDataChangeEvent.builder(DataChangeScope.BASE);
switch (l.getScope()) {
- case BASE:
- base.put(l, b);
- break;
- case ONE:
- one.put(l, b);
- break;
- case SUBTREE:
- sub.put(l, b);
- break;
+ case BASE:
+ base.put(l, b);
+ break;
+ case ONE:
+ one.put(l, b);
+ break;
+ case SUBTREE:
+ sub.put(l, b);
+ break;
+ default:
+ break;
}
}
}
*
* @param rootId root instance identifier
* @param registrationTreeNode root node
- * @return
*/
- public static ResolveDataChangeState initial(final YangInstanceIdentifier rootId, final RegistrationTreeNode<DataChangeListenerRegistration<?>> registrationTreeNode) {
+ public static ResolveDataChangeState initial(final YangInstanceIdentifier rootId,
+ final RegistrationTreeNode<DataChangeListenerRegistration<?>> registrationTreeNode) {
return new ResolveDataChangeState(rootId, Collections.<Builder>emptyList(),
Collections.<Builder>emptyList(), Collections.singletonList(registrationTreeNode));
}
}
/**
- * Get the current path
+ * Get the current path.
*
* @return Current path.
*/
/**
* Add an event to all current listeners.
- *
- * @param event
*/
public void addEvent(final DOMImmutableDataChangeEvent event) {
// Subtree builders get always notified
LOG.trace("Collected events {}", map);
}
- private static Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> getListenerChildrenWildcarded(final Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> parentNodes,
+ private static Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> getListenerChildrenWildcarded(
+ final Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> parentNodes,
final PathArgument child) {
if (parentNodes.isEmpty()) {
return Collections.emptyList();
return result;
}
- private static void addChildNodes(final List<RegistrationTreeNode<DataChangeListenerRegistration<?>>> result, final Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> parentNodes, final PathArgument childIdentifier) {
+ private static void addChildNodes(final List<RegistrationTreeNode<DataChangeListenerRegistration<?>>> result,
+ final Collection<RegistrationTreeNode<DataChangeListenerRegistration<?>>> parentNodes,
+ final PathArgument childIdentifier) {
for (RegistrationTreeNode<DataChangeListenerRegistration<?>> node : parentNodes) {
RegistrationTreeNode<DataChangeListenerRegistration<?>> child = node.getExactChild(childIdentifier);
if (child != null) {