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