2 * Copyright (c) 2015 Brocade Communications 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 org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier;
12 import org.opendaylight.controller.cluster.datastore.messages.DeleteData;
13 import org.opendaylight.controller.cluster.datastore.messages.MergeData;
14 import org.opendaylight.controller.cluster.datastore.messages.WriteData;
15 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
21 * Implementation of TransactionContextImpl used when talking to a pre-Lithium controller that doesn't
22 * support the BatchedModifications message.
24 * @author Thomas Pantelis
26 class LegacyTransactionContextImpl extends TransactionContextImpl {
28 LegacyTransactionContextImpl(String transactionPath, ActorSelection actor, TransactionIdentifier identifier,
29 ActorContext actorContext, SchemaContext schemaContext, boolean isTxActorLocal,
30 short remoteTransactionVersion, OperationCompleter operationCompleter) {
31 super(transactionPath, actor, identifier, actorContext, schemaContext, isTxActorLocal,
32 remoteTransactionVersion, operationCompleter);
36 public void deleteData(YangInstanceIdentifier path) {
37 recordedOperationFutures.add(executeOperationAsync(
38 new DeleteData(path, getRemoteTransactionVersion())));
42 public void mergeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
43 recordedOperationFutures.add(executeOperationAsync(
44 new MergeData(path, data, getRemoteTransactionVersion())));
48 public void writeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
49 recordedOperationFutures.add(executeOperationAsync(
50 new WriteData(path, data, getRemoteTransactionVersion())));