BUG 6057: Rewrite ShardedDOMProducer to use new cursor api
[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  * In addition this cursor also provides write operations(delete, merge, write).
19  */
20 public interface DataTreeWriteCursor extends DataTreeCursor {
21
22     /**
23      * Delete the specified child.
24      *
25      * @param child Child identifier
26      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
27      *         request.
28      */
29     void delete(PathArgument child);
30
31     /**
32      * Merge the specified data with the currently-present data at specified path.
33      *
34      * @param child Child identifier
35      * @param data Data to be merged
36      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
37      *         request.
38      */
39     <T extends DataObject> void merge(PathArgument child, T data);
40
41     /**
42      * Replace the data at specified path with supplied data.
43      *
44      * @param child Child identifier
45      * @param data New node data
46      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
47      *         request.
48      */
49     <T extends DataObject> void write(PathArgument child, T data);
50 }