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%2Fdatabroker%2Factors%2Fdds%2FAbstractProxyHistory.java;h=d9f3b5f557c09f5786c103cd2bf4c553ed74e60f;hp=f21be06f40f754a0e39a3a94eeb818c53a247411;hb=cc1ec4a8e2ec99ad7711d0e5e649b34d37d87da0;hpb=78efa22e4e7b70a468fcbaf120f8613598c36b5b diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java index f21be06f40..d9f3b5f557 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyHistory.java @@ -16,7 +16,7 @@ import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree; /** - * Per-connection representation of a local history. + * Per-connection representation of a local history. This class handles state replication across a single connection. * * @author Robert Varga */ @@ -30,11 +30,18 @@ abstract class AbstractProxyHistory implements Identifiable backendInfo, final LocalHistoryIdentifier identifier) { final Optional dataTree = backendInfo.flatMap(ShardBackendInfo::getDataTree); - return dataTree.isPresent() ? new LocalProxyHistory(client, identifier, dataTree.get()) - : new RemoteProxyHistory(client, identifier); + return dataTree.isPresent() ? new ClientLocalProxyHistory(client, identifier, dataTree.get()) + : new RemoteProxyHistory(client, identifier); + } + + static AbstractProxyHistory createSingle(final DistributedDataStoreClientBehavior client, + final Optional backendInfo, final LocalHistoryIdentifier identifier) { + final Optional dataTree = backendInfo.flatMap(ShardBackendInfo::getDataTree); + return dataTree.isPresent() ? new SingleLocalProxyHistory(client, identifier, dataTree.get()) + : new RemoteProxyHistory(client, identifier); } @Override