Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / AsyncConfigurationCommitCohort.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.md.sal.common.api.data;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.yangtools.concepts.Path;
12
13 /**
14  * Three phase Commit Cohort for subtree, which is uniquely associated with user submitted transaction.
15  *
16  * @param <P>
17  *            Type of path (subtree identifier), which represents location in
18  *            tree
19  * @param <D>
20  *            Type of data (payload), which represents data payload
21  */
22 @Deprecated(forRemoval = true)
23 public interface AsyncConfigurationCommitCohort<P extends Path<P>, D> {
24
25     /**
26      * Initiates a pre-commit of associated request
27      *
28      * <p>
29      * Implementation MUST NOT do any blocking calls during this callback, all
30      * pre-commit preparation SHOULD happen asynchronously and MUST result in
31      * completing returned future object.
32      *
33      * @param rebasedTransaction
34      *            Read-only view of transaction as if happened on top of actual
35      *            data store
36      * @return Future which is completed once pre-commit phase for this request
37      *         is finished.
38      */
39     ListenableFuture<Void> preCommit(AsyncReadTransaction<P, D> rebasedTransaction);
40
41     /**
42      * Initiates a commit phase of associated request
43      *
44      * <p>
45      * Implementation MUST NOT do any blocking calls during this callback, all
46      * commit finalization SHOULD happen asynchronously and MUST result in
47      * completing returned future object.
48      *
49      * @return Future which is completed once commit phase for associated
50      *         request is finished.
51      */
52     ListenableFuture<Void> commit();
53
54     /**
55      * Initiates abort phase of associated request
56      *
57      * <p>
58      * Implementation MUST NOT do any blocking calls during this callback, all
59      * commit finalization SHOULD happen asynchronously and MUST result in
60      * completing returned future object.
61      *
62      * @return Future which is completed once commit phase for associated
63      *         request is finished.
64      */
65     ListenableFuture<Void> abort();
66
67 }