Binding2 runtime - API #2
[mdsal.git] / binding2 / mdsal-binding2-api / src / main / java / org / opendaylight / mdsal / binding / javav2 / api / DataTreeWriteCursor.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.mdsal.binding.javav2.api;
10
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeArgument;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.BackendFailedException;
15
16 /**
17  * {@inheritDoc}
18  *
19  * <p>
20  * In addition this cursor also provides write operations(delete, merge, write).
21  */
22 @Beta
23 public interface DataTreeWriteCursor extends DataTreeCursor {
24
25     /**
26      * Delete the specified child.
27      *
28      * @param child Child identifier
29      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
30      *         request.
31      */
32     void delete(TreeArgument<?> child);
33
34     /**
35      * Merge the specified data with the currently-present data at specified path.
36      *
37      * @param child Child identifier
38      * @param data Data to be merged
39      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
40      *         request.
41      */
42     <T extends TreeNode> void merge(TreeArgument<T> child, T data);
43
44     /**
45      * Replace the data at specified path with supplied data.
46      *
47      * @param child Child identifier
48      * @param data New node data
49      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
50      *         request.
51      */
52     <T extends TreeNode> void write(TreeArgument<T> child, T data);
53 }