Reduce ObjectRegistration use
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / DataTreeCommitCohortRegistry.java
1 /*
2  * Copyright (c) 2016 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.mdsal.binding.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.Registration;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13
14 /**
15  * Commit Cohort registry. See {@link DataTreeCommitCohort} for more details.
16  */
17 public interface DataTreeCommitCohortRegistry {
18     /**
19      * Register commit cohort which will participate in three-phase commit protocols of write transaction in data broker
20      * associated with this instance of extension.
21      *
22      * @param subtree Subtree path on which commit cohort operates.
23      * @param cohort Commit cohort
24      * @return Registration object for DOM Data Three Commit cohort.
25      */
26     <D extends DataObject> @NonNull Registration registerCommitCohort(@NonNull DataTreeIdentifier<D> subtree,
27         @NonNull DataTreeCommitCohort<D> cohort);
28 }