Move FIXMEs out to 6.0.0
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMTransactionChainListener.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.dom.api;
9
10 import java.util.EventListener;
11
12 /**
13  * Listener for transaction chain events.
14  */
15 // FIXME: 6.0.0: remove this in favor of a TransactionChain destiny, available as a FluentFuture from
16 //               DOMTransactionChain
17 public interface DOMTransactionChainListener extends EventListener {
18     /**
19      * Invoked if when a transaction in the chain fails. All transactions submitted after the failed transaction, in the
20      * chain, are automatically cancelled by the time this notification is invoked. Open transactions need to be closed
21      * or cancelled.
22      * Implementations should invoke chain.close() to close the chain.
23      *
24      * @param chain Transaction chain which failed
25      * @param transaction Transaction which caused the chain to fail
26      * @param cause The cause of transaction failure
27      */
28     void onTransactionChainFailed(DOMTransactionChain chain, DOMDataTreeTransaction transaction, Throwable cause);
29
30     /**
31      * Invoked when a transaction chain is completed. A transaction chain is considered completed when it has been
32      * closed and all its instructions have completed successfully.
33      *
34      * @param chain Transaction chain which completed
35      */
36     void onTransactionChainSuccessful(DOMTransactionChain chain);
37 }
38