2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.md.sal.common.api.data;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.yangtools.concepts.Path;
14 * Three phase Commit Cohort for subtree, which is uniquely associated with user submitted transaction.
17 * Type of path (subtree identifier), which represents location in
20 * Type of data (payload), which represents data payload
22 public interface AsyncConfigurationCommitCohort<P extends Path<P>, D> {
25 * Initiates a pre-commit of associated request
28 * Implementation MUST NOT do any blocking calls during this callback, all
29 * pre-commit preparation SHOULD happen asynchronously and MUST result in
30 * completing returned future object.
32 * @param rebasedTransaction
33 * Read-only view of transaction as if happened on top of actual
35 * @return Future which is completed once pre-commit phase for this request
38 ListenableFuture<Void> preCommit(AsyncReadTransaction<P, D> rebasedTransaction);
41 * Initiates a commit phase of associated request
44 * Implementation MUST NOT do any blocking calls during this callback, all
45 * commit finalization SHOULD happen asynchronously and MUST result in
46 * completing returned future object.
48 * @return Future which is completed once commit phase for associated
49 * request is finished.
51 ListenableFuture<Void> commit();
54 * Initiates abort phase of associated request
57 * Implementation MUST NOT do any blocking calls during this callback, all
58 * commit finalization SHOULD happen asynchronously and MUST result in
59 * completing returned future object.
61 * @return Future which is completed once commit phase for associated
62 * request is finished.
64 ListenableFuture<Void> abort();