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;
11 * A chain of transactions. Transactions in a chain need to be committed in sequence and each
12 * transaction should see the effects of previous transactions as if they happened. A chain
13 * makes no guarantees of atomicity, in fact transactions are committed as soon as possible.
15 public interface TransactionChain<P/* extends Path<P> */, D> extends AutoCloseable {
17 * Create a new transaction which will continue the chain. The previous transaction
18 * has to be either COMMITTED or CANCELLED.
20 * @return New transaction in the chain.
21 * @throws IllegalStateException if the previous transaction was not COMMITTED or CANCELLED.
22 * @throws TransactionChainClosedException if the chain has been closed.
24 DataModification<P, D> newTransaction();