Merge "Re-added config.version to config-module-archetype."
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / DataModification.java
1 /*
2  * Copyright (c) 2013 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.md.sal.common.api.data;
9
10 import java.util.concurrent.Future;
11
12 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
13 import org.opendaylight.yangtools.concepts.Path;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
15 /**
16  *
17  * @deprecated Replaced by {@link AsyncWriteTransaction}
18  */
19 @Deprecated
20 public interface DataModification<P extends Path<P>, D> extends DataChange<P, D>, DataReader<P, D> {
21     /**
22      * Returns transaction identifier
23      *
24      * @return Transaction identifier
25      */
26     Object getIdentifier();
27
28     TransactionStatus getStatus();
29
30     /**
31      * Store a piece of data at specified path. This acts as a merge operation,
32      * which is to say that any pre-existing data which is not explicitly
33      * overwritten will be preserved. This means that if you store a container,
34      * its child lists will be merged. Performing the following put operations:
35      *
36      * 1) container { list [ a ] }
37      * 2) container { list [ b ] }
38      *
39      * will result in the following data being present:
40      *
41      * container { list [ a, b ] }
42      *
43      * This also means that storing the container will preserve any augmentations
44      * which have been attached to it.
45      *
46      * If you require an explicit replace operation, perform
47      * {@link removeOperationalData} first.
48      */
49     void putOperationalData(P path, D data);
50
51     /**
52      * Store a piece of data at specified path. This acts as a merge operation,
53      * which is to say that any pre-existing data which is not explicitly
54      * overwritten will be preserved. This means that if you store a container,
55      * its child lists will be merged. Performing the following put operations:
56      *
57      * 1) container { list [ a ] }
58      * 2) container { list [ b ] }
59      *
60      * will result in the following data being present:
61      *
62      * container { list [ a, b ] }
63      *
64      * This also means that storing the container will preserve any augmentations
65      * which have been attached to it.
66      *
67      * If you require an explicit replace operation, perform
68      * {@link removeConfigurationData} first.
69      */
70     void putConfigurationData(P path, D data);
71
72     void removeOperationalData(P path);
73
74     void removeConfigurationData(P path);
75
76     /**
77      * Initiates a two-phase commit of modification.
78      *
79      * <p>
80      * The successful commit changes the state of the system and may affect
81      * several components.
82      *
83      * <p>
84      * The effects of successful commit of data are described in the
85      * specifications and YANG models describing the Provider components of
86      * controller. It is assumed that Consumer has an understanding of this
87      * changes.
88      *
89      *
90      * @see DataCommitHandler for further information how two-phase commit is
91      *      processed.
92      * @param store
93      *            Identifier of the store, where commit should occur.
94      * @return Result of the Commit, containing success information or list of
95      *         encountered errors, if commit was not successful. The Future
96      *         blocks until {@link TransactionStatus#COMMITED} or
97      *         {@link TransactionStatus#FAILED} is reached.
98      */
99     Future<RpcResult<TransactionStatus>> commit();
100 }