summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/impl/src')
-rw-r--r--v3po/impl/src/main/config/default-config.xml122
-rw-r--r--v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java159
-rw-r--r--v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java104
-rw-r--r--v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java13
-rw-r--r--v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java2
-rw-r--r--v3po/impl/src/main/yang/v3po-impl.yang33
6 files changed, 208 insertions, 225 deletions
diff --git a/v3po/impl/src/main/config/default-config.xml b/v3po/impl/src/main/config/default-config.xml
index e35c3a421..328d00204 100644
--- a/v3po/impl/src/main/config/default-config.xml
+++ b/v3po/impl/src/main/config/default-config.xml
@@ -28,54 +28,6 @@
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <!--<module>-->
- <!--<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-inmemory-data-broker</type>-->
- <!--<name>netconf-inmemory-data-broker</name>-->
-
- <!--<schema-service>-->
- <!--<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>-->
- <!--<name>yang-schema-service</name>-->
- <!--</schema-service>-->
-
- <!--<config-data-store>-->
- <!--<type xmlns:config-dom-store-spi="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:config-dom-store">config-dom-store-spi:config-dom-datastore</type>-->
- <!--<name>netconf-config-store-service</name>-->
- <!--</config-data-store>-->
-
- <!--<operational-data-store>-->
- <!--<type xmlns:operational-dom-store-spi="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:operational-dom-store">operational-dom-store-spi:operational-dom-datastore</type>-->
- <!--<name>netconf-operational-store-service</name>-->
- <!--</operational-data-store>-->
- <!--</module>-->
-
- <!--<module>-->
- <!--<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-forwarded-data-broker</type>-->
- <!--<name>honeycomb-binding-data-broker</name>-->
- <!--<binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">-->
-
- <!--&lt;!&ndash;TODO &ndash;&gt;-->
- <!--&lt;!&ndash;<dom-async-broker>&ndash;&gt;-->
- <!--&lt;!&ndash;<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>&ndash;&gt;-->
- <!--&lt;!&ndash;<name>honeycomb-dom-data-broker</name>&ndash;&gt;-->
- <!--&lt;!&ndash;</dom-async-broker>&ndash;&gt;-->
-
- <!--<dom-async-broker>-->
- <!--<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>-->
- <!--<name>netconf-inmemory-data-broker</name>-->
- <!--</dom-async-broker>-->
-
- <!--<schema-service>-->
- <!--<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>-->
- <!--<name>yang-schema-service</name>-->
- <!--</schema-service>-->
- <!--<binding-mapping-service>-->
- <!--<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>-->
- <!--<name>runtime-mapping-singleton</name>-->
- <!--</binding-mapping-service>-->
- <!--</binding-forwarded-data-broker>-->
- <!--</module>-->
-
-
<module>
<type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:translate:utils">prefix:delegating-reader-registry</type>
<name>read-registry</name>
@@ -120,6 +72,39 @@
</module>
<module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:v3po:impl">prefix:honeycomb-dom-data-broker</type>
+ <name>honeycomb-dom-data-broker</name>
+ <config-data-tree>
+ <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:data:api">prefix:honeycomb-modifiable-data-tree</type>
+ <name>config-data-tree</name>
+ </config-data-tree>
+ <operational-data-tree>
+ <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:data:api">prefix:honeycomb-readable-data-tree</type>
+ <name>operational-data-tree</name>
+ </operational-data-tree>
+ </module>
+
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-forwarded-data-broker</type>
+ <name>honeycomb-binding-data-broker</name>
+ <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+
+ <dom-async-broker>
+ <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+ <name>honeycomb-dom-data-broker</name>
+ </dom-async-broker>
+ <schema-service>
+ <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+ <name>yang-schema-service</name>
+ </schema-service>
+ <binding-mapping-service>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
+ <name>runtime-mapping-singleton</name>
+ </binding-mapping-service>
+ </binding-forwarded-data-broker>
+ </module>
+
+ <module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:v3po:impl">prefix:v3po</type>
<name>v3po-default</name>
<broker>
@@ -142,10 +127,10 @@
<type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:translate:api">prefix:honeycomb-writer-registry</type>
<name>write-registry</name>
</writer-registry>
- <binding-normalized-node-serializer>
+ <serializer>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-dom-mapping-service</type>
<name>runtime-mapping-singleton</name>
- </binding-normalized-node-serializer>
+ </serializer>
<config-data-tree>
<type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:data:api">prefix:honeycomb-modifiable-data-tree</type>
<name>config-data-tree</name>
@@ -163,28 +148,35 @@
<type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:translate:api">prefix:honeycomb-reader-registry</type>
<name>read-registry</name>
</reader-registry>
+ <config-data-tree>
+ <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:data:api">prefix:honeycomb-modifiable-data-tree</type>
+ <name>config-data-tree</name>
+ </config-data-tree>
+ <serializer>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
+ <name>runtime-mapping-singleton</name>
+ </serializer>
</module>
</modules>
<services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <!--<service>-->
- <!--<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>-->
- <!--<instance>-->
- <!--<name>netconf-inmemory-data-broker</name>-->
- <!--<provider>/modules/module[type='dom-inmemory-data-broker'][name='netconf-inmemory-data-broker']</provider>-->
- <!--</instance>-->
- <!--</service>-->
-
- <!--<service>-->
- <!--<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>-->
- <!--<instance>-->
- <!--<name>honeycomb-binding-data-broker</name>-->
- <!--<provider>/modules/module[type='binding-forwarded-data-broker'][name='honeycomb-binding-data-broker']</provider>-->
- <!--</instance>-->
- <!--</service>-->
+ <service>
+ <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+ <instance>
+ <name>honeycomb-dom-data-broker</name>
+ <provider>/modules/module[type='honeycomb-dom-data-broker'][name='honeycomb-dom-data-broker']</provider>
+ </instance>
+ </service>
+ <service>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+ <instance>
+ <name>honeycomb-binding-data-broker</name>
+ <provider>/modules/module[type='binding-forwarded-data-broker'][name='honeycomb-binding-data-broker']</provider>
+ </instance>
+ </service>
<service>
<type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:translate:api">prefix:honeycomb-reader-registry</type>
diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
index 84301b711..bbb004b73 100644
--- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
+++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppDataBrokerInitializationProvider.java
@@ -20,22 +20,13 @@ import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.AsyncFunction;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
import io.fd.honeycomb.v3po.data.ModifiableDataTree;
import io.fd.honeycomb.v3po.data.ReadableDataTree;
import io.fd.honeycomb.v3po.data.impl.DataBroker;
-import io.fd.honeycomb.v3po.translate.Context;
-import io.fd.honeycomb.v3po.translate.TranslationException;
-import io.fd.honeycomb.v3po.translate.read.ReadContext;
import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.List;
-import java.util.Map;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -43,19 +34,11 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
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.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
import org.opendaylight.controller.sal.core.api.Broker;
import org.opendaylight.controller.sal.core.api.Provider;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Vpp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomainKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomains;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
@@ -66,13 +49,9 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -136,7 +115,7 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
final DOMMountPointService.DOMMountPointBuilder mountPointBuilder = mountPointService.createMountPoint(path);
mountPointBuilder.addInitialSchemaContext(globalContext);
- broker = initVppDataBroker(operationalDataTree, serializer, configDataTree);
+ broker = new DataBroker(operationalDataTree, configDataTree);
mountPointBuilder.addService(DOMDataBroker.class, broker);
mountPointRegistration = mountPointBuilder.register();
@@ -145,9 +124,6 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
mountPoint.getSchemaContext());
createMountPointPlaceholder();
-
- // TODO initial sync has to go out of here
-// initialVppConfigSynchronization(broker);
}
@Override
@@ -168,98 +144,6 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
}
}
- private DOMDataBroker initVppDataBroker(final ReadableDataTree operationalDataTree,
- final BindingNormalizedNodeSerializer serializer,
- final ModifiableDataTree configDataTree) {
- // init operational data tree before data broker is initialized
-
- try {
- initConfig(serializer, configDataTree);
- } catch (Exception e) {
- LOG.warn("Failed to initialize config", e);
- }
-
- return new DataBroker(operationalDataTree, configDataTree);
- }
-
- // FIXME move to initializer after wiring is finished
- private void initConfig(final BindingNormalizedNodeSerializer serializer, final ModifiableDataTree configDataTree)
- throws TranslationException, DataValidationFailedException {
- LOG.info("Config initialization");
-
- final Optional<? extends DataObject> data = readerRegistry.read(InstanceIdentifier.create(VppState.class), new ReadContextImpl());
- LOG.info("Config initialization data={}", data);
-
- if (data.isPresent()) {
- // conversion
- VppState vppOperationalData = (VppState) data.get();
- final Vpp vppConfigData = convert(vppOperationalData);
-
- final Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> normalizedData =
- serializer.toNormalizedNode(InstanceIdentifier.create(Vpp.class), vppConfigData);
-
- final DataTreeModification modification = configDataTree.takeSnapshot().newModification();
- final YangInstanceIdentifier biPath = normalizedData.getKey();
- final NormalizedNode<?, ?> biData = normalizedData.getValue();
- LOG.info("Config initialization biPath={}, biData={}", biPath, biData);
- modification.write(biPath, biData);
- modification.ready();
-
- LOG.info("Config writing modification ...");
- configDataTree.modify(modification); // TODO do not write to VPP
- LOG.info("Config writing modification written successfully.");
- } else {
- LOG.info("Data is not present");
- }
- }
-
- private Vpp convert(final VppState vppState) {
- final BridgeDomains bridgeDomains = vppState.getBridgeDomains();
- final List<BridgeDomain> bridgeDomainList = bridgeDomains.getBridgeDomain();
-
- VppBuilder vppBuilder = new VppBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.BridgeDomainsBuilder bdsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.BridgeDomainsBuilder();
- final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain>
- listOfBDs = new ArrayList<>();
-
- // TODO use reflexion
- for (BridgeDomain bd : bridgeDomainList) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomainBuilder bdBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomainBuilder();
- bdBuilder.setLearn(bd.isLearn());
- bdBuilder.setUnknownUnicastFlood(bd.isUnknownUnicastFlood());
- bdBuilder.setArpTermination(bd.isArpTermination());
- bdBuilder.setFlood(bd.isFlood());
- bdBuilder.setForward(bd.isForward());
- bdBuilder.setKey(new BridgeDomainKey(bd.getKey().getName()));
- // TODO bdBuilder.setL2Fib(bd.getL2Fib());
- bdBuilder.setName(bd.getName());
- listOfBDs.add(bdBuilder.build());
- }
-
- bdsBuilder.setBridgeDomain(listOfBDs);
- vppBuilder.setBridgeDomains(bdsBuilder.build());
- return vppBuilder.build();
- }
-
-
- // TODO move to utility module
- private static final class ReadContextImpl implements ReadContext {
- public final Context ctx = new Context();
-
- @Nonnull
- @Override
- public Context getContext() {
- return ctx;
- }
-
- @Override
- public void close() {
- // Make sure to clear the storage in case some customizer stored it to prevent memory leaks
- ctx.close();
- }
- }
-
-
/**
* Writes placeholder data into MD-SAL's global datastore to indicate the presence of VPP mountpoint.
*/
@@ -279,47 +163,6 @@ public final class VppDataBrokerInitializationProvider implements Provider, Auto
}
}
- // TODO operational and config models are not 1-1
- // decide what part of operational data should be written to config during initialization
- private void initialVppConfigSynchronization(final DOMDataBroker broker) {
- // read from operational
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
-
- final YangInstanceIdentifier
- id = YangInstanceIdentifier.builder().node(VppState.QNAME).node(BridgeDomains.QNAME).build();
-
- LOG.trace("initialVppStateSynchronization id: {}", id);
-
- final ListenableFuture<Void> writeFuture = Futures.transform(
- readTx.read(LogicalDatastoreType.OPERATIONAL, id),
- new AsyncFunction<Optional<NormalizedNode<?, ?>>, Void>() {
- @Override
- public ListenableFuture<Void> apply(final Optional<NormalizedNode<?, ?>> readResult)
- throws Exception {
- if (readResult.isPresent()) {
- final DOMDataWriteTransaction writeTx = broker.newWriteOnlyTransaction();
- final NormalizedNode<?, ?> node = readResult.get();
- LOG.trace("Read result: {}", node);
-
- // FIXME
- // this will fail because we are reading OPERATIONAL data and writing to CONFIGURATION
- // we need to provide extensible way to register initializer that would
- // translate between models
-
- // writeTx.put(LogicalDatastoreType.CONFIGURATION, id, node);
- return writeTx.submit();
- } else {
- return Futures
- .immediateFailedFuture(
- new IllegalStateException("Failed to read data from VPP."));
- }
- }
- });
-
- Futures.addCallback(writeFuture,
- new LoggingFuturesCallBack<Void>("Initializing VPP config DataTree failed", LOG));
- }
-
public Optional<DOMDataBroker> getBroker() {
return Optional.fromNullable(broker);
}
diff --git a/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java
new file mode 100644
index 000000000..76f014456
--- /dev/null
+++ b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModule.java
@@ -0,0 +1,104 @@
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210;
+
+import io.fd.honeycomb.v3po.data.impl.DataBroker;
+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.TransactionChainListener;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataChangeListener;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DataBrokerModule extends
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractDataBrokerModule {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DataBrokerModule.class);
+
+ public DataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public DataBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.DataBrokerModule oldModule,
+ java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void customValidation() {
+ // add custom validation form module attributes here.
+ }
+
+ @Override
+ public java.lang.AutoCloseable createInstance() {
+ LOG.info("DataBrokerModule.createInstance()");
+ return new CloseableDataBroker(
+ new DataBroker(getOperationalDataTreeDependency(), getConfigDataTreeDependency()));
+ }
+
+ private static final class CloseableDataBroker implements AutoCloseable, DOMDataBroker {
+
+ private final DataBroker delegate;
+
+ CloseableDataBroker(final DataBroker delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void close() throws Exception {
+ LOG.info("CloseableDataBroker.close()");
+ // NOP
+ }
+
+ @Override
+ public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
+ LOG.trace("CloseableDataBroker.newReadOnlyTransaction()");
+ return delegate.newReadOnlyTransaction();
+ }
+
+ @Override
+ public DOMDataReadWriteTransaction newReadWriteTransaction() {
+ LOG.trace("CloseableDataBroker.newReadWriteTransaction()");
+ return delegate.newReadWriteTransaction();
+ }
+
+ @Override
+ public DOMDataWriteTransaction newWriteOnlyTransaction() {
+ LOG.trace("CloseableDataBroker.newWriteOnlyTransaction()");
+ return delegate.newWriteOnlyTransaction();
+ }
+
+ @Override
+ public ListenerRegistration<DOMDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
+ final YangInstanceIdentifier path,
+ final DOMDataChangeListener listener,
+ final DataChangeScope triggeringScope) {
+ LOG.trace("CloseableDataBroker.createTransactionChain store={}, path={}, listener={}, triggeringScope={}",
+ store, path, listener, triggeringScope);
+ return delegate.registerDataChangeListener(store, path, listener, triggeringScope);
+ }
+
+ @Override
+ public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
+ LOG.trace("CloseableDataBroker.createTransactionChain listener={}", listener);
+ return delegate.createTransactionChain(listener);
+ }
+
+ @Nonnull
+ @Override
+ public Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> getSupportedExtensions() {
+ LOG.trace("CloseableDataBroker.getSupportedExtensions()");
+ return delegate.getSupportedExtensions();
+ }
+ }
+}
diff --git a/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java
new file mode 100644
index 000000000..cc30beacf
--- /dev/null
+++ b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/DataBrokerModuleFactory.java
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: v3po-impl yang module local name: honeycomb-dom-data-broker
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Mon Apr 11 07:53:38 CEST 2016
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210;
+public class DataBrokerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.impl.rev141210.AbstractDataBrokerModuleFactory {
+
+}
diff --git a/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java
index bae4a29d3..959780496 100644
--- a/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java
+++ b/v3po/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModule.java
@@ -58,7 +58,7 @@ public class V3poModule extends
domBroker.registerProvider(new InitializationProvider());
final V3poProvider provider = new V3poProvider(domBroker, getVppJapiDependency(), getReaderRegistryDependency(),
- getWriterRegistryDependency(), getBindingNormalizedNodeSerializerDependency(),
+ getWriterRegistryDependency(), getSerializerDependency(),
getConfigDataTreeDependency(), getOperationalDataTreeDependency());
getBrokerDependency().registerProvider(provider);
return provider;
diff --git a/v3po/impl/src/main/yang/v3po-impl.yang b/v3po/impl/src/main/yang/v3po-impl.yang
index b9868c450..c0240cde3 100644
--- a/v3po/impl/src/main/yang/v3po-impl.yang
+++ b/v3po/impl/src/main/yang/v3po-impl.yang
@@ -72,7 +72,7 @@ module v3po-impl {
}
}
- container binding-normalized-node-serializer {
+ container serializer {
uses config:service-ref {
refine type {
mandatory true;
@@ -123,4 +123,35 @@ module v3po-impl {
}
}
+
+ identity honeycomb-dom-data-broker {
+ base config:module-type;
+ config:provided-service dom:dom-async-data-broker;
+ config:java-name-prefix DataBroker;
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case honeycomb-dom-data-broker {
+ when "/config:modules/config:module/config:type = 'honeycomb-dom-data-broker'";
+
+ container config-data-tree {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity dapi:honeycomb-modifiable-data-tree;
+ }
+ }
+ }
+
+ container operational-data-tree {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity dapi:honeycomb-readable-data-tree;
+ }
+ }
+ }
+
+ }
+ }
}