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