From 3af5cb9926238ba0fa802e0e067451a8e19f1c6a Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 17 May 2016 08:41:24 +0200 Subject: HONEYCOMB-63: bump ODL dependencies to BE-SR2 + Remove dedicated reads to netconf-state in operational datatree. Use regular reader from now on Change-Id: I3d7245cd6cb5d9cf057aea600fddceb49cf18039 Signed-off-by: Marek Gradzki Signed-off-by: Maros Marsalek --- v3po/data-impl/pom.xml | 6 ++-- .../v3po/data/impl/ReadableDataTreeDelegator.java | 42 ++-------------------- .../impl/rev160411/OperationalDataTreeModule.java | 2 +- v3po/data-impl/src/main/yang/data-impl.yang | 10 ------ .../data/impl/ReadableDataTreeDelegatorTest.java | 2 +- 5 files changed, 7 insertions(+), 55 deletions(-) (limited to 'v3po/data-impl') diff --git a/v3po/data-impl/pom.xml b/v3po/data-impl/pom.xml index 1d716a6d9..d7a51b0b5 100644 --- a/v3po/data-impl/pom.xml +++ b/v3po/data-impl/pom.xml @@ -51,20 +51,20 @@ org.opendaylight.controller sal-core-api - 1.3.0-Beryllium + 1.3.2-Beryllium-SR2 org.opendaylight.netconf ietf-netconf-monitoring - 1.0.0-Beryllium + 1.0.2-Beryllium-SR2 org.opendaylight.netconf ietf-netconf-monitoring-extension - 1.0.0-Beryllium + 1.0.2-Beryllium-SR2 diff --git a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegator.java b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegator.java index e660ee429..46903a1f0 100644 --- a/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegator.java +++ b/v3po/data-impl/src/main/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegator.java @@ -36,11 +36,7 @@ import io.fd.honeycomb.v3po.translate.util.write.TransactionMappingContext; import java.util.Collection; import java.util.Map; import javax.annotation.Nonnull; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; -import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; -import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState; import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -70,24 +66,20 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { private final BindingNormalizedNodeSerializer serializer; private final ReaderRegistry readerRegistry; private final SchemaContext globalContext; - private final DOMDataBroker netconfMonitoringDomDataBrokerDependency; private final org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker; /** * Creates operational data tree instance. - * @param serializer service for serialization between Java Binding Data representation and NormalizedNode + * @param serializer service for serialization between Java Binding Data representation and NormalizedNode * representation. * @param globalContext service for obtaining top level context data from all yang modules. * @param readerRegistry service responsible for translation between DataObjects and data provider. - * @param netconfMonitoringDomDataBrokerDependency TODO remove * @param contextBroker BA broker for context data */ public ReadableDataTreeDelegator(@Nonnull BindingNormalizedNodeSerializer serializer, @Nonnull final SchemaContext globalContext, @Nonnull final ReaderRegistry readerRegistry, - @Nonnull final DOMDataBroker netconfMonitoringDomDataBrokerDependency, @Nonnull final org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker) { - this.netconfMonitoringDomDataBrokerDependency = netconfMonitoringDomDataBrokerDependency; this.contextBroker = checkNotNull(contextBroker, "contextBroker should not be null"); this.globalContext = checkNotNull(globalContext, "globalContext should not be null"); this.serializer = checkNotNull(serializer, "serializer should not be null"); @@ -133,15 +125,6 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { private Optional> readNode(final YangInstanceIdentifier yangInstanceIdentifier, final ReadContext ctx) throws ReadFailedException { - - // FIXME workaround for: https://git.opendaylight.org/gerrit/#/c/37499/ - // Just delete, dedicated reader from NetconfMonitoringReaderModule takes care of netconf state data - // TODO test connecting with netconf and issuing a get (netconf-state) data should be provided - if(yangInstanceIdentifier.getPathArguments().size() > 0 && - yangInstanceIdentifier.getPathArguments().get(0).getNodeType().equals(NetconfState.QNAME)) { - return readFromNetconfDs(yangInstanceIdentifier); - } - LOG.debug("OperationalDataTree.readNode(), yangInstanceIdentifier={}", yangInstanceIdentifier); final InstanceIdentifier path = serializer.fromYangInstanceIdentifier(yangInstanceIdentifier); checkNotNull(path, "Invalid instance identifier %s. Cannot create BA equivalent.", yangInstanceIdentifier); @@ -158,19 +141,6 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { } } - // FIXME workaround for: https://git.opendaylight.org/gerrit/#/c/37499/ - private Optional> readFromNetconfDs(final YangInstanceIdentifier yangInstanceIdentifier) - throws ReadFailedException { - try(final DOMDataReadOnlyTransaction domDataReadOnlyTransaction = - netconfMonitoringDomDataBrokerDependency.newReadOnlyTransaction()) { - try { - return domDataReadOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, yangInstanceIdentifier).checkedGet(); - } catch (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException e) { - throw new ReadFailedException(InstanceIdentifier.create(NetconfState.class), e); - } - } - } - private Optional> readRoot(final ReadContext ctx) throws ReadFailedException { LOG.debug("OperationalDataTree.readRoot()"); @@ -187,14 +157,6 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { wrapDataObjects(rootElementId, instanceIdentifier, dataObjects.get(instanceIdentifier)); dataNodeBuilder.withChild((DataContainerChild) node); } - - // FIXME workaround for: https://git.opendaylight.org/gerrit/#/c/37499/ - final Optional> normalizedNodeOptional = - readFromNetconfDs(YangInstanceIdentifier.builder().node(NetconfState.QNAME).build()); - if(normalizedNodeOptional.isPresent()) { - dataNodeBuilder.withChild((DataContainerChild) normalizedNodeOptional.get()); - } - return Optional.>of(dataNodeBuilder.build()); } @@ -252,7 +214,7 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { private static final class ReadContextImpl implements ReadContext { - public final ModificationCache ctx = new ModificationCache(); + private final ModificationCache ctx = new ModificationCache(); private final MappingContext mappingContext; private ReadContextImpl(final MappingContext mappingContext) { 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 286eaf664..2e49cb7ec 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 @@ -38,7 +38,7 @@ public class OperationalDataTreeModule extends LOG.debug("OperationalDataTreeModule.createInstance()"); return new CloseableOperationalDataTree( new ReadableDataTreeDelegator(getSerializerDependency(), getSchemaServiceDependency().getGlobalContext(), - getReaderRegistryDependency(), getNetconfMonitoringDomDataBrokerDependency(), getContextBindingBrokerDependency())); + getReaderRegistryDependency(), getContextBindingBrokerDependency())); } private static final class CloseableOperationalDataTree implements ReadableDataManager, AutoCloseable { diff --git a/v3po/data-impl/src/main/yang/data-impl.yang b/v3po/data-impl/src/main/yang/data-impl.yang index a6b217a84..ebca239a2 100644 --- a/v3po/data-impl/src/main/yang/data-impl.yang +++ b/v3po/data-impl/src/main/yang/data-impl.yang @@ -162,16 +162,6 @@ module data-impl { } } - // FIXME workaround for: https://git.opendaylight.org/gerrit/#/c/37499/ - container netconf-monitoring-dom-data-broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity dom:dom-async-data-broker; - } - } - } - container context-binding-broker { uses config:service-ref { refine type { diff --git a/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegatorTest.java b/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegatorTest.java index 4492c70a2..c8d4fe4e5 100644 --- a/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegatorTest.java +++ b/v3po/data-impl/src/test/java/io/fd/honeycomb/v3po/data/impl/ReadableDataTreeDelegatorTest.java @@ -88,7 +88,7 @@ public class ReadableDataTreeDelegatorTest { @Before public void setUp() { initMocks(this); - operationalData = new ReadableDataTreeDelegator(serializer, globalContext, reader, netconfMonitoringBroker, contextBroker); + operationalData = new ReadableDataTreeDelegator(serializer, globalContext, reader, contextBroker); doReturn(schemaNode).when(globalContext).getDataChildByName(any(QName.class)); doReturn(domDataReadOnlyTransaction).when(netconfMonitoringBroker).newReadOnlyTransaction(); -- cgit 1.2.3-korg