diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-05-17 09:10:39 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-05-23 09:24:12 +0000 |
commit | d54ea758da8dcf71d52727c4f01f87090c50bf2e (patch) | |
tree | bf86e49ad4899b50c97654ae144d4b2e8902d1b8 /v3po/data-impl/src/main/java/org | |
parent | 9e59a344c5a5b81fb7b7292184e849ad0fc9507c (diff) |
HONEYCOMB-61: Add BA broker for context data tree
With broker, context data can be accessed in a transactional
manner, same as config data
+ Renamed data-api concepts to not include DataTree
+ Renamed context related concepts to better distinguish between them
+ Now passing full ReadContext to read customizers
+ Naming context is backed by context data broker
Change-Id: I0b2876dd74a31a9ced7d9b5145672868e12f8b82
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/data-impl/src/main/java/org')
2 files changed, 27 insertions, 24 deletions
diff --git a/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/ConfigDataTreeModule.java b/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/ConfigDataTreeModule.java index 86a3f9db4..3e871e09a 100644 --- a/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/ConfigDataTreeModule.java +++ b/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/ConfigDataTreeModule.java @@ -1,11 +1,14 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411; -import io.fd.honeycomb.v3po.data.DataTreeSnapshot; -import io.fd.honeycomb.v3po.data.ModifiableDataTree; -import io.fd.honeycomb.v3po.data.impl.ConfigDataTree; -import io.fd.honeycomb.v3po.translate.TranslationException; -import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; -import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; +import com.google.common.base.Optional; +import com.google.common.util.concurrent.CheckedFuture; +import io.fd.honeycomb.v3po.data.DataModification; +import io.fd.honeycomb.v3po.data.ModifiableDataManager; +import io.fd.honeycomb.v3po.data.impl.ModifiableDataTreeDelegator; +import javax.annotation.Nonnull; +import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,14 +38,15 @@ public class ConfigDataTreeModule extends public java.lang.AutoCloseable createInstance() { LOG.debug("ConfigDataTreeModule.createInstance()"); return new CloseableConfigDataTree( - new ConfigDataTree(getSerializerDependency(), getDataTreeDependency(), getWriterRegistryDependency())); + new ModifiableDataTreeDelegator(getSerializerDependency(), getDataTreeDependency(), getWriterRegistryDependency(), + getContextBindingBrokerDependency())); } - private static final class CloseableConfigDataTree implements ModifiableDataTree, AutoCloseable { + private static final class CloseableConfigDataTree implements ModifiableDataManager, AutoCloseable { - private final ConfigDataTree delegate; + private final ModifiableDataTreeDelegator delegate; - CloseableConfigDataTree(final ConfigDataTree delegate) { + CloseableConfigDataTree(final ModifiableDataTreeDelegator delegate) { this.delegate = delegate; } @@ -53,16 +57,15 @@ public class ConfigDataTreeModule extends } @Override - public void modify(final DataTreeModification modification) - throws DataValidationFailedException, TranslationException { - LOG.trace("CloseableConfigDataTree.modify modification={}", modification); - delegate.modify(modification); + public DataModification newModification() { + LOG.trace("CloseableConfigDataTree.newModification"); + return delegate.newModification(); } @Override - public DataTreeSnapshot takeSnapshot() { - LOG.trace("CloseableConfigDataTree.takeSnapshot"); - return delegate.takeSnapshot(); + public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read( + @Nonnull final YangInstanceIdentifier path) { + return delegate.read(path); } } } diff --git a/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/OperationalDataTreeModule.java b/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/OperationalDataTreeModule.java index 2fbba75fa..286eaf664 100644 --- a/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/OperationalDataTreeModule.java +++ b/v3po/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/OperationalDataTreeModule.java @@ -2,8 +2,8 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl. import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; -import io.fd.honeycomb.v3po.data.ReadableDataTree; -import io.fd.honeycomb.v3po.data.impl.OperationalDataTree; +import io.fd.honeycomb.v3po.data.ReadableDataManager; +import io.fd.honeycomb.v3po.data.impl.ReadableDataTreeDelegator; import javax.annotation.Nonnull; import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -37,15 +37,15 @@ public class OperationalDataTreeModule extends public java.lang.AutoCloseable createInstance() { LOG.debug("OperationalDataTreeModule.createInstance()"); return new CloseableOperationalDataTree( - new OperationalDataTree(getSerializerDependency(), getSchemaServiceDependency().getGlobalContext(), - getReaderRegistryDependency(), getNetconfMonitoringDomDataBrokerDependency())); + new ReadableDataTreeDelegator(getSerializerDependency(), getSchemaServiceDependency().getGlobalContext(), + getReaderRegistryDependency(), getNetconfMonitoringDomDataBrokerDependency(), getContextBindingBrokerDependency())); } - private static final class CloseableOperationalDataTree implements ReadableDataTree, AutoCloseable { + private static final class CloseableOperationalDataTree implements ReadableDataManager, AutoCloseable { - private final OperationalDataTree delegate; + private final ReadableDataTreeDelegator delegate; - CloseableOperationalDataTree(final OperationalDataTree delegate) { + CloseableOperationalDataTree(final ReadableDataTreeDelegator delegate) { this.delegate = delegate; } |