4dac6f557ebda436b29d2e1aaea9df86682fb90a
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / TransactionChainListener.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 java.util.EventListener;
11
12 /**
13  * Listener for transaction chain events.
14  */
15 public interface TransactionChainListener extends EventListener {
16     /**
17      * Invoked if when a transaction in the chain fails. All other transactions are automatically cancelled by the time
18      * this notification is invoked. Implementations should invoke chain.close() to close the chain.
19      *
20      * @param chain Transaction chain which failed
21      * @param transaction Transaction which caused the chain to fail
22      * @param cause The cause of transaction failure
23      */
24     void onTransactionChainFailed(TransactionChain<?, ?> chain, DataModification<?, ?> transaction, Throwable cause);
25
26     /**
27      * Invoked when a transaction chain is completed. A transaction chain is considered completed when it has been
28      * closed and all its instructions have completed successfully.
29      *
30      * @param chain Transaction chain which completed
31      */
32     void onTransactionChainSuccessful(TransactionChain<?, ?> chain);
33 }
34

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.