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.SettableFuture;
13 import java.util.List;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 import scala.concurrent.Future;
19 * FIXME: why do we need this interface? It should be possible to integrate it with
20 * AbstractTransactionContext, which is the only implementation anyway.
22 interface TransactionContext {
23 void closeTransaction();
25 Future<ActorSelection> readyTransaction();
27 void writeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
29 void deleteData(YangInstanceIdentifier path);
31 void mergeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
33 void readData(final YangInstanceIdentifier path, SettableFuture<Optional<NormalizedNode<?, ?>>> proxyFuture);
35 void dataExists(YangInstanceIdentifier path, SettableFuture<Boolean> proxyFuture);
37 List<Future<Object>> getRecordedOperationFutures();