BUG-272: fix sal-dom-spi
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / sal / core / spi / data / 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.controller.sal.core.spi.data;
9
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
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
17      * operation, which is to say that whole subtree will be replaced by
18      * specified path.
19      *
20      * If you need add or merge of current object with specified use
21      * {@link #merge(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, org.opendaylight.yangtools.concepts.Path, Object)}
22      *
23      *
24      * @param path
25      * @param data
26      *            Data object to be written
27      *
28      * @throws IllegalStateException
29      *             if the client code already sealed transaction and invoked
30      *             {@link #ready()}
31      */
32     void write(InstanceIdentifier path, NormalizedNode<?, ?> data);
33
34     /**
35      * Store a provided data at specified path. This acts as a add / replace
36      * operation, which is to say that whole subtree will be replaced by
37      * specified path.
38      *
39      * If you need add or merge of current object with specified use
40      * {@link #merge(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, org.opendaylight.yangtools.concepts.Path, Object)}
41      *
42      *
43      * @param path
44      * @param data
45      *            Data object to be written
46      *
47      * @throws IllegalStateException
48      *             if the client code already sealed transaction and invoked
49      *             {@link #ready()}
50      */
51     void merge(InstanceIdentifier path, NormalizedNode<?, ?> data);
52
53     /**
54      *
55      * Deletes data and whole subtree located at provided path.
56      *
57      * @param path
58      *            Path to delete
59      * @throws IllegalStateException
60      *             if the client code already sealed transaction and invoked
61      *             {@link #ready()}
62      */
63     void delete(InstanceIdentifier path);
64
65     /**
66      *
67      * Seals transaction, and returns three-phase commit cohort associated
68      * with this transaction and DOM Store to be coordinated by coordinator.
69      *
70      * @return Three Phase Commit Cohort instance for this transaction.
71      */
72     DOMStoreThreePhaseCommitCohort ready();
73
74 }