Adding some more traces for better debuggability
[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 public interface DataModification<P extends Path<P>, D> extends DataChange<P, D>, DataReader<P, D> {
17
18     /**
19      * Returns transaction identifier
20      *
21      * @return Transaction identifier
22      */
23     Object getIdentifier();
24
25     TransactionStatus getStatus();
26
27     /**
28      *
29      * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
30      *
31      * @param path
32      * @param data
33      */
34     @Deprecated
35     void putRuntimeData(P path, D data);
36
37     /**
38      * Store a piece of data at specified path. This acts as a merge operation,
39      * which is to say that any pre-existing data which is not explicitly
40      * overwritten will be preserved. This means that if you store a container,
41      * its child lists will be merged. Performing the following put operations:
42      *
43      * 1) container { list [ a ] }
44      * 2) container { list [ b ] }
45      *
46      * will result in the following data being present:
47      *
48      * container { list [ a, b ] }
49      *
50      * This also means that storing the container will preserve any augmentations
51      * which have been attached to it.
52      *
53      * If you require an explicit replace operation, perform
54      * {@link removeOperationalData} first.
55      */
56     void putOperationalData(P path, D data);
57
58     /**
59      * Store a piece of data at specified path. This acts as a merge operation,
60      * which is to say that any pre-existing data which is not explicitly
61      * overwritten will be preserved. This means that if you store a container,
62      * its child lists will be merged. Performing the following put operations:
63      *
64      * 1) container { list [ a ] }
65      * 2) container { list [ b ] }
66      *
67      * will result in the following data being present:
68      *
69      * container { list [ a, b ] }
70      *
71      * This also means that storing the container will preserve any augmentations
72      * which have been attached to it.
73      *
74      * If you require an explicit replace operation, perform
75      * {@link removeConfigurationData} first.
76      */
77     void putConfigurationData(P path, D data);
78
79     /**
80      * @deprecated Use {@link #removeOperationalData(Object)}
81      *
82      * @param path
83      */
84     @Deprecated
85     void removeRuntimeData(P path);
86
87     void removeOperationalData(P path);
88
89     void removeConfigurationData(P path);
90
91     /**
92      * Initiates a two-phase commit of modification.
93      *
94      * <p>
95      * The successful commit changes the state of the system and may affect
96      * several components.
97      *
98      * <p>
99      * The effects of successful commit of data are described in the
100      * specifications and YANG models describing the Provider components of
101      * controller. It is assumed that Consumer has an understanding of this
102      * changes.
103      *
104      *
105      * @see DataCommitHandler for further information how two-phase commit is
106      *      processed.
107      * @param store
108      *            Identifier of the store, where commit should occur.
109      * @return Result of the Commit, containing success information or list of
110      *         encountered errors, if commit was not successful. The Future
111      *         blocks until {@link TransactionStatus#COMMITED} or
112      *         {@link TransactionStatus#FAILED} is reached.
113      */
114     Future<RpcResult<TransactionStatus>> commit();
115
116 }