diff options
14 files changed, 111 insertions, 101 deletions
diff --git a/v3po/impl/src/main/config/initializer-config.xml b/v3po/impl/src/main/config/initializer-config.xml index c5ee10f91..cb98a2a89 100644 --- a/v3po/impl/src/main/config/initializer-config.xml +++ b/v3po/impl/src/main/config/initializer-config.xml @@ -93,7 +93,7 @@ </module> <!-- Config initializer for VPP subtree--> <module> - <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:vpp:data:init">prefix:vpp-cfg-initializer</type> + <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:v3po2vpp">prefix:vpp-cfg-initializer</type> <name>vpp-cfg-initializer</name> <binding-data-broker> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-async-data-broker</type> @@ -102,7 +102,7 @@ </module> <!-- Config initializer for Interfaces subtree--> <module> - <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:vpp:data:init">prefix:interfaces-cfg-initializer</type> + <type xmlns:prefix="urn:honeycomb:params:xml:ns:yang:v3po2vpp">prefix:interfaces-cfg-initializer</type> <name>interfaces-cfg-initializer</name> <binding-data-broker> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-async-data-broker</type> diff --git a/v3po/v3po2vpp/pom.xml b/v3po/v3po2vpp/pom.xml index 6eed27377..113511da1 100644 --- a/v3po/v3po2vpp/pom.xml +++ b/v3po/v3po2vpp/pom.xml @@ -60,6 +60,11 @@ <version>${project.version}</version> </dependency> <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>vpp-cfg-init</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> <groupId>io.fd.vpp</groupId> <artifactId>jvpp</artifactId> <version>16.09-SNAPSHOT</version> diff --git a/v3po/vpp-cfg-init/src/main/java/io/fd/honeycomb/v3po/vpp/data/init/InterfacesInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializer.java index 9ecbe0c13..0b5cef4d8 100644 --- a/v3po/vpp-cfg-init/src/main/java/io/fd/honeycomb/v3po/vpp/data/init/InterfacesInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializer.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.vpp.data.init; +package io.fd.honeycomb.v3po.translate.v3po.initializers; import com.google.common.base.Function; import com.google.common.collect.Lists; +import io.fd.honeycomb.v3po.vpp.data.init.AbstractDataTreeConverter; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -43,8 +44,6 @@ public class InterfacesInitializer extends AbstractDataTreeConverter<InterfacesS InstanceIdentifier.create(Interfaces.class)); } - // TODO move to v3po2vpp - @Override protected Interfaces convert(final InterfacesState operationalData) { LOG.debug("InterfacesInitializer.convert()"); diff --git a/v3po/vpp-cfg-init/src/main/java/io/fd/honeycomb/v3po/vpp/data/init/VppInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializer.java index d7a67870a..da943f530 100644 --- a/v3po/vpp-cfg-init/src/main/java/io/fd/honeycomb/v3po/vpp/data/init/VppInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializer.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.vpp.data.init; +package io.fd.honeycomb.v3po.translate.v3po.initializers; import com.google.common.base.Function; import com.google.common.collect.Lists; +import io.fd.honeycomb.v3po.vpp.data.init.AbstractDataTreeConverter; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.binding.api.DataBroker; 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/InterfacesConfigurationInitializerModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesConfigurationInitializerModule.java index 51a7c482a..0fa9f544a 100644 --- a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/InterfacesConfigurationInitializerModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesConfigurationInitializerModule.java @@ -1,13 +1,13 @@ -package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407; +package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; -import io.fd.honeycomb.v3po.vpp.data.init.InterfacesInitializer; +import io.fd.honeycomb.v3po.translate.v3po.initializers.InterfacesInitializer; -public class InterfacesConfigurationInitializerModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.AbstractInterfacesConfigurationInitializerModule { +public class InterfacesConfigurationInitializerModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesConfigurationInitializerModule { public InterfacesConfigurationInitializerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - public InterfacesConfigurationInitializerModule(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.InterfacesConfigurationInitializerModule oldModule, java.lang.AutoCloseable oldInstance) { + public InterfacesConfigurationInitializerModule(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.v3po2vpp.rev160406.InterfacesConfigurationInitializerModule oldModule, java.lang.AutoCloseable oldInstance) { super(identifier, dependencyResolver, oldModule, oldInstance); } 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/InterfacesConfigurationInitializerModuleFactory.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesConfigurationInitializerModuleFactory.java index b74947917..726ab0689 100644 --- a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/InterfacesConfigurationInitializerModuleFactory.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesConfigurationInitializerModuleFactory.java @@ -1,13 +1,13 @@ /* * Generated file * -* Generated from: yang module name: vpp-cfg-init yang module local name: interfaces-cfg-initializer +* Generated from: yang module name: v3po2vpp yang module local name: interfaces-cfg-initializer * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Wed May 18 14:43:49 CEST 2016 +* Generated at: Thu May 19 14:51:38 CEST 2016 * * Do not modify this file unless it is present under src/main directory */ -package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407; -public class InterfacesConfigurationInitializerModuleFactory extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.AbstractInterfacesConfigurationInitializerModuleFactory { +package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; +public class InterfacesConfigurationInitializerModuleFactory extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesConfigurationInitializerModuleFactory { } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppConfigurationInitializerModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppConfigurationInitializerModule.java new file mode 100644 index 000000000..48535ff64 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppConfigurationInitializerModule.java @@ -0,0 +1,24 @@ +package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; + +import io.fd.honeycomb.v3po.translate.v3po.initializers.VppInitializer; + +public class VppConfigurationInitializerModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppConfigurationInitializerModule { + 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.v3po2vpp.rev160406.VppConfigurationInitializerModule 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() { + return new VppInitializer(getBindingDataBrokerDependency()); + } + +} 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/VppConfigurationInitializerModuleFactory.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppConfigurationInitializerModuleFactory.java index 1e4609703..9ef01e843 100644 --- a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/VppConfigurationInitializerModuleFactory.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppConfigurationInitializerModuleFactory.java @@ -1,13 +1,13 @@ /* * Generated file * -* Generated from: yang module name: vpp-cfg-init yang module local name: vpp-cfg-initializer-impl +* Generated from: yang module name: v3po2vpp yang module local name: vpp-cfg-initializer * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Fri Apr 08 07:44:53 CEST 2016 +* Generated at: Thu May 19 14:51:38 CEST 2016 * * Do not modify this file unless it is present under src/main directory */ -package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407; -public class VppConfigurationInitializerModuleFactory extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407.AbstractVppConfigurationInitializerModuleFactory { +package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; +public class VppConfigurationInitializerModuleFactory extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppConfigurationInitializerModuleFactory { } diff --git a/v3po/v3po2vpp/src/main/yang/v3po2vpp.yang b/v3po/v3po2vpp/src/main/yang/v3po2vpp.yang index 268739451..f706ec60d 100644 --- a/v3po/v3po2vpp/src/main/yang/v3po2vpp.yang +++ b/v3po/v3po2vpp/src/main/yang/v3po2vpp.yang @@ -6,6 +6,8 @@ module v3po2vpp { import config { prefix config; revision-date 2013-04-05; } import translate-api { prefix tapi; revision-date 2016-04-06; } import vpp-jvpp-cfg { prefix vjvppc; revision-date 2016-04-06; } + import vpp-cfg-init { prefix init; revision-date "2016-04-07"; } + import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} import vpp-util { prefix vpp-u; revision-date 2016-04-06; } description @@ -171,4 +173,47 @@ module v3po2vpp { } } + identity vpp-cfg-initializer { + base config:module-type; + config:provided-service init:cfg-initializer; + config:java-name-prefix VppConfigurationInitializer; + } + + augment "/config:modules/config:module/config:configuration" { + case vpp-cfg-initializer { + when "/config:modules/config:module/config:type = 'vpp-cfg-initializer'"; + + container binding-data-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-async-data-broker; + } + } + } + } + } + + identity interfaces-cfg-initializer { + base config:module-type; + config:provided-service init:cfg-initializer; + config:java-name-prefix InterfacesConfigurationInitializer; + } + + augment "/config:modules/config:module/config:configuration" { + case interfaces-cfg-initializer { + when "/config:modules/config:module/config:type = 'interfaces-cfg-initializer'"; + + container binding-data-broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-async-data-broker; + } + } + } + } + } + + }
\ No newline at end of file diff --git a/v3po/vpp-cfg-init/src/test/java/io/fd/honeycomb/v3po/vpp/data/init/InterfacesInitializerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializerTest.java index 32f9163bb..c7f71b977 100644 --- a/v3po/vpp-cfg-init/src/test/java/io/fd/honeycomb/v3po/vpp/data/init/InterfacesInitializerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializerTest.java @@ -1,4 +1,20 @@ -package io.fd.honeycomb.v3po.vpp.data.init; +/* + * Copyright (c) 2016 Cisco and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.honeycomb.v3po.translate.v3po.initializers; import static org.junit.Assert.assertEquals; import static org.mockito.MockitoAnnotations.initMocks; diff --git a/v3po/vpp-cfg-init/src/test/java/io/fd/honeycomb/v3po/vpp/data/init/VppInitializerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializerTest.java index f3a762776..4669ac83b 100644 --- a/v3po/vpp-cfg-init/src/test/java/io/fd/honeycomb/v3po/vpp/data/init/VppInitializerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.vpp.data.init; +package io.fd.honeycomb.v3po.translate.v3po.initializers; import static org.junit.Assert.assertEquals; import static org.mockito.MockitoAnnotations.initMocks; 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/ConfigurationInitializerRegistryModule.java b/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/ConfigurationInitializerRegistryModule.java index d80b9ed30..3fff82e32 100644 --- a/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/ConfigurationInitializerRegistryModule.java +++ b/v3po/vpp-cfg-init/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/vpp/data/init/rev160407/ConfigurationInitializerRegistryModule.java @@ -40,8 +40,7 @@ public class ConfigurationInitializerRegistryModule extends org.opendaylight.yan initializer.initialize(); LOG.info("VPP configuration initialized successfully from VPP"); // Initialize stored configuration on top - // FIXME uncomment and test -// getPersistedConfigInitializerDependency().initialize(); + getPersistedConfigInitializerDependency().initialize(); LOG.info("Persisted configuration restored successfully"); } catch (Exception e) { LOG.warn("Failed to initialize config", e); 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 deleted file mode 100644 index cc4f183fc..000000000 --- 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 +++ /dev/null @@ -1,34 +0,0 @@ -package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.data.init.rev160407; - -import io.fd.honeycomb.v3po.vpp.data.init.VppInitializer; -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 { - - 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) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - return new VppInitializer(getBindingDataBrokerDependency()); - } - -} diff --git a/v3po/vpp-cfg-init/src/main/yang/vpp-cfg-init.yang b/v3po/vpp-cfg-init/src/main/yang/vpp-cfg-init.yang index 024c930b7..8d305685e 100644 --- a/v3po/vpp-cfg-init/src/main/yang/vpp-cfg-init.yang +++ b/v3po/vpp-cfg-init/src/main/yang/vpp-cfg-init.yang @@ -4,7 +4,6 @@ module vpp-cfg-init { prefix "init"; import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} import opendaylight-md-sal-dom {prefix dom;} import translate-api { prefix tapi; revision-date 2016-04-06; } import data-api { prefix dapi; revision-date 2016-04-11; } @@ -22,50 +21,6 @@ module vpp-cfg-init { config:java-class io.fd.honeycomb.v3po.vpp.data.init.DataTreeInitializer; } - // TODO move to v3po2vpp - identity vpp-cfg-initializer { - base config:module-type; - config:provided-service cfg-initializer; - config:java-name-prefix VppConfigurationInitializer; - } - - augment "/config:modules/config:module/config:configuration" { - case vpp-cfg-initializer { - when "/config:modules/config:module/config:type = 'vpp-cfg-initializer'"; - - container binding-data-broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-binding:binding-async-data-broker; - } - } - } - } - } - - // TODO move to v3po2vpp - identity interfaces-cfg-initializer { - base config:module-type; - config:provided-service cfg-initializer; - config:java-name-prefix InterfacesConfigurationInitializer; - } - - augment "/config:modules/config:module/config:configuration" { - case interfaces-cfg-initializer { - when "/config:modules/config:module/config:type = 'interfaces-cfg-initializer'"; - - container binding-data-broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-binding:binding-async-data-broker; - } - } - } - } - } - identity cfg-initializer-registry { base config:module-type; config:provided-service cfg-initializer; |