Split out yang-data-tree-{api,spi}
[yangtools.git] / data / yang-data-tree-api / src / main / java / org / opendaylight / yangtools / yang / data / tree / api / DataTreeModificationCursor.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.tree.api;
9
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13
14 /**
15  * Extension to the {@link DataTreeSnapshotCursor} which allows modifying the data tree. An instance of this interface
16  * can be obtained from {@link CursorAwareDataTreeModification} and modifications made through this interface are staged
17  * in the parent modification.
18  */
19 @Beta
20 public interface DataTreeModificationCursor extends DataTreeSnapshotCursor {
21     /**
22      * Delete the specified child.
23      *
24      * @param child Child identifier
25      * @throws BackendFailedException when implementation-specific errors occurs while servicing the request.
26      */
27     void delete(PathArgument child);
28
29     /**
30      * Merge the specified data with the currently-present data
31      * at specified path.
32      *
33      * @param child Child identifier
34      * @param data Data to be merged
35      * @throws BackendFailedException when implementation-specific errors occurs while servicing the request.
36      */
37     void merge(PathArgument child, NormalizedNode data);
38
39     /**
40      * Replace the data at specified path with supplied data.
41      *
42      * @param child Child identifier
43      * @param data New node data
44      * @throws BackendFailedException when implementation-specific errors occurs while servicing the request.
45      */
46     void write(PathArgument child, NormalizedNode data);
47 }