X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FTransactionChainProxy.java;h=76bbef713c350ad975c9dbb256bdef83bd1e4915;hp=1ee0d89e6116837a1733848aae5f85e1cf02cd34;hb=1b41def30b66456bdf9ccbcb295f258ef3129707;hpb=c2fd5f62f3b80a7e7b4b7e167349ede433e785d6;ds=sidebyside 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 1ee0d89e61..76bbef713c 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 @@ -8,32 +8,46 @@ 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; import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** * TransactionChainProxy acts as a proxy for a DOMStoreTransactionChain created on a remote shard */ public class TransactionChainProxy implements DOMStoreTransactionChain{ + private final ActorContext actorContext; + private final SchemaContext schemaContext; + + public TransactionChainProxy(ActorContext actorContext, SchemaContext schemaContext) { + this.actorContext = actorContext; + this.schemaContext = schemaContext; + } + @Override public DOMStoreReadTransaction newReadOnlyTransaction() { - throw new UnsupportedOperationException("newReadOnlyTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.READ_ONLY, schemaContext); } @Override public DOMStoreReadWriteTransaction newReadWriteTransaction() { - throw new UnsupportedOperationException("newReadWriteTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.READ_WRITE, schemaContext); } @Override public DOMStoreWriteTransaction newWriteOnlyTransaction() { - throw new UnsupportedOperationException("newWriteOnlyTransaction"); + return new TransactionProxy(actorContext, + TransactionProxy.TransactionType.WRITE_ONLY, schemaContext); } @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?"); } }