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 org.opendaylight.yangtools.concepts.Path;
12 import com.google.common.util.concurrent.ListenableFuture;
16 * Three phase Commit Cohort for subtree, which is
17 * uniquely associated with user submitted transcation.
20 * Type of path (subtree identifier), which represents location in
23 * Type of data (payload), which represents data payload
25 public interface AsyncConfigurationCommitCohort<P extends Path<P>, D> {
28 * Initiates a pre-commit of associated request
30 * Implementation MUST NOT do any blocking calls during this callback, all
31 * pre-commit preparation SHOULD happen asynchronously and MUST result in
32 * completing returned future object.
34 * @param rebasedTransaction
35 * Read-only view of transaction as if happened on top of actual
37 * @return Future which is completed once pre-commit phase for this request
40 ListenableFuture<Void> preCommit(AsyncReadTransaction<P, D> rebasedTransaction);
44 * Initiates a commit phase of associated request
46 * Implementation MUST NOT do any blocking calls during this callback, all
47 * commit finalization SHOULD happen asynchronously and MUST result in
48 * completing returned future object.
50 * @return Future which is completed once commit phase for associated
51 * request is finished.
53 ListenableFuture<Void> commit();
57 * Initiates abort phase of associated request
59 * Implementation MUST NOT do any blocking calls during this callback, all
60 * commit finalization SHOULD happen asynchronously and MUST result in
61 * completing returned future object.
63 * @return Future which is completed once commit phase for associated
64 * request is finished.
66 ListenableFuture<Void> abort();