6d669ab9dfa481809214f8fe1b07cc9f4472e7a4
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / AsyncConfigurationCommitCoordinator.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 org.opendaylight.yangtools.concepts.ObjectRegistration;
11 import org.opendaylight.yangtools.concepts.Path;
12
13 /**
14  * Three Phase Commit Coordinator with support of user-supplied commit cohorts
15  * which participates in three-phase commit protocols
16  *
17  * @param <P>
18  *            Type of path (subtree identifier), which represents location in
19  *            tree
20  * @param <D>
21  *            Type of data (payload), which represents data payload
22  */
23 public interface AsyncConfigurationCommitCoordinator<P extends Path<P>, D> {
24
25     /**
26      * Register configuration commit handler for particular subtree
27      *
28      * Configuration commit handler is invoked for all write transactions
29      * which modifies <code>subtree</code>
30      *
31      * @param subtree Subtree which configuration commit handler is interested it
32      * @param commitHandler Instance of user-provided commit handler
33      * @return Registration object representing this registration. Invoking {@link ObjectRegistration#close()}
34      *   will unregister configuration commit handler.
35      */
36     <C extends AsyncConfigurationCommitCohort<P, D>> ObjectRegistration<C> registerConfigurationCommitHandler(
37             P subtree, C commitHandler);
38 }