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.yangtools.yang.data.api.schema.tree;
10 import java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
18 * Read-only snapshot of a {@link DataTree}. The snapshot is stable and isolated, e.g. data tree changes occurring after
19 * the snapshot has been taken are not visible through the snapshot.
21 public interface DataTreeSnapshot extends SchemaContextProvider {
23 * Read a particular node from the snapshot.
25 * @param path Path of the node
26 * @return Optional result encapsulating the presence and value of the node
28 Optional<NormalizedNode<?, ?>> readNode(YangInstanceIdentifier path);
31 * Create a new data tree modification based on this snapshot, using the
32 * specified data application strategy.
34 * @return A new data tree modification
36 DataTreeModification newModification();
39 @NonNull SchemaContext getSchemaContext();