diff options
author | 2016-04-11 08:56:06 +0200 | |
---|---|---|
committer | 2016-04-12 11:04:11 +0200 | |
commit | 69b1d68a74561f786805809ad44052ba6cfe8eb7 (patch) | |
tree | fc081044e3711274c0cc56ed2a4f84de99d04c6f /v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb | |
parent | 077fec893ed63f17bb4c9b2952d27075fa50f737 (diff) |
HONEYCOMB-34: Config tree initialization using ModifiableDataTree dependency
Change-Id: I9fa6119a92cc1979ed6f3364bb74e856a7a712c5
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb')
-rw-r--r-- | v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModule.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModule.java b/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModule.java index ecfbaa6d4..8b6f589c4 100644 --- a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModule.java +++ b/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModule.java @@ -1,15 +1,30 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407; +import io.fd.honeycomb.v3po.data.ModifiableDataTree; import io.fd.honeycomb.v3po.translate.read.ReaderRegistry; +import io.fd.honeycomb.v3po.vpp.data.init.DataTreeInitializer; import io.fd.honeycomb.v3po.vpp.data.init.InitializerRegistry; import io.fd.honeycomb.v3po.vpp.data.init.InitializerRegistryImpl; +import io.fd.honeycomb.v3po.vpp.data.init.VppInitializer; +import java.util.Collections; +import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -public class VppConfigurationInitializerModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.AbstractVppConfigurationInitializerModule { - public VppConfigurationInitializerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { +public class VppConfigurationInitializerModule extends + org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.AbstractVppConfigurationInitializerModule { + + private static final Logger LOG = LoggerFactory.getLogger(VppConfigurationInitializerModule.class); + + public VppConfigurationInitializerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public VppConfigurationInitializerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.VppConfigurationInitializerModule oldModule, java.lang.AutoCloseable oldInstance) { + public VppConfigurationInitializerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, + org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.VppConfigurationInitializerModule oldModule, + java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } @@ -20,11 +35,23 @@ public class VppConfigurationInitializerModule extends org.opendaylight.yang.gen @Override public java.lang.AutoCloseable createInstance() { + LOG.info("VppConfigurationInitializerModule.createInstance()"); final ReaderRegistry readerRegistry = getReaderRegistryDependency(); + final ModifiableDataTree configDataTree = getConfigDataTreeDependency(); + final BindingNormalizedNodeSerializer serializer = getSerializerDependency(); + + // TODO make configurable + final VppInitializer vppInitializer = + new VppInitializer(readerRegistry, configDataTree, serializer); - InitializerRegistry initializer = new InitializerRegistryImpl(readerRegistry); + final InitializerRegistry initializer = + new InitializerRegistryImpl(Collections.<DataTreeInitializer>singletonList(vppInitializer)); - initializer.initialize(); + try { + initializer.initialize(); + } catch (Exception e) { + LOG.warn("Failed to initialize config", e); + } return initializer; } |