2 * Copyright (c) 2015 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.cluster.datastore;
10 import akka.actor.ActorSelection;
11 import com.google.common.base.Optional;
12 import com.google.common.util.concurrent.CheckedFuture;
13 import java.util.List;
14 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 import scala.concurrent.Future;
20 * FIXME: why do we need this interface? It should be possible to integrate it with
21 * AbstractTransactionContext, which is the only implementation anyway.
23 interface TransactionContext {
24 void closeTransaction();
26 Future<ActorSelection> readyTransaction();
28 void writeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
30 void deleteData(YangInstanceIdentifier path);
32 void mergeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
34 CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> readData(
35 final YangInstanceIdentifier path);
37 CheckedFuture<Boolean, ReadFailedException> dataExists(YangInstanceIdentifier path);
39 List<Future<Object>> getRecordedOperationFutures();