X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FTransactionChainProxy.java;h=91e903f9e8993bfb68b83e0d28514124b163b258;hb=8a31e147100aa64b6090d856b2efe7ef50021555;hp=20a74e30dab07258b4a4122d56d0b7f6c7630f1d;hpb=3813fb17592a2469c26b3874c4673a80fa3b9aee;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java index 20a74e30da..91e903f9e8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + package org.opendaylight.controller.cluster.datastore; +import org.opendaylight.controller.cluster.datastore.utils.ActorContext; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction; import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; @@ -9,23 +18,33 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction; * TransactionChainProxy acts as a proxy for a DOMStoreTransactionChain created on a remote shard */ public class TransactionChainProxy implements DOMStoreTransactionChain{ + private final ActorContext actorContext; + + public TransactionChainProxy(ActorContext actorContext) { + this.actorContext = actorContext; + } + @Override public DOMStoreReadTransaction newReadOnlyTransaction() { - throw new UnsupportedOperationException("newReadOnlyTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.READ_ONLY); } @Override public DOMStoreReadWriteTransaction newReadWriteTransaction() { - throw new UnsupportedOperationException("newReadWriteTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.WRITE_ONLY); } @Override public DOMStoreWriteTransaction newWriteOnlyTransaction() { - throw new UnsupportedOperationException("newWriteOnlyTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.READ_WRITE); } @Override public void close() { - throw new UnsupportedOperationException("close"); + // FIXME : The problem here is don't know which shard the transaction chain is to be created on ??? + throw new UnsupportedOperationException("close - not sure what to do here?"); } }