2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.md.sal.dom.store.impl.tree;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
12 import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
15 * A walking context, pretty much equivalent to an iterator, but it
16 * exposes the underlying tree structure.
18 * @author Robert Varga
20 public class ListenerWalker implements AutoCloseable {
21 private final RegistrationTreeSnapshot<DataChangeListenerRegistration<?>> delegate;
23 ListenerWalker(final RegistrationTreeSnapshot<DataChangeListenerRegistration<?>> delegate) {
24 this.delegate = Preconditions.checkNotNull(delegate);
27 public ListenerNode getRootNode() {
28 return new ListenerNode(delegate.getRootNode());