Bump to odlparent-9.0.0/yangtools-7.0.1-SNAPSHOT
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / store / DOMStoreWriteTransaction.java
1 /*
2  * Copyright (c) 2014 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.mdsal.dom.spi.store;
9
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12
13 public interface DOMStoreWriteTransaction extends DOMStoreTransaction {
14
15     /**
16      * Store a provided data at specified path. This acts as a add / replace operation, which is to
17      * say that whole subtree will be replaced by specified path.
18      *
19      * <p>
20      * If you need add or merge of current object with specified use
21      * {@link #merge(YangInstanceIdentifier, NormalizedNode)}
22      *
23      * @param path YangInstanceIdentifier object to be written
24      * @param data Data object to be written
25      * @throws IllegalStateException if the client code already sealed transaction and invoked
26      *         {@link #ready()}
27      */
28     void write(YangInstanceIdentifier path, NormalizedNode data);
29
30     /**
31      * Store a provided data at specified path. This acts as a add / replace operation, which is to
32      * say that whole subtree will be replaced by specified path.
33      *
34      * <p>
35      * If you need add or merge of current object with specified use
36      * {@link #merge(YangInstanceIdentifier, NormalizedNode)}
37      *
38      * @param path YangInstanceIdentifier object to be merged
39      * @param data Data object to be written
40      * @throws IllegalStateException if the client code already sealed transaction and invoked
41      *         {@link #ready()}
42      */
43     void merge(YangInstanceIdentifier path, NormalizedNode data);
44
45     /**
46      * Deletes data and whole subtree located at provided path.
47      *
48      * @param path
49      *            Path to delete
50      * @throws IllegalStateException
51      *             if the client code already sealed transaction and invoked
52      *             {@link #ready()}
53      */
54     void delete(YangInstanceIdentifier path);
55
56     /**
57      * Seals transaction, and returns three-phase commit cohort associated
58      * with this transaction and DOM Store to be coordinated by coordinator.
59      *
60      * @return Three Phase Commit Cohort instance for this transaction.
61      */
62     DOMStoreThreePhaseCommitCohort ready();
63
64 }