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