package io.fd.honeycomb.vppnsh.impl;
import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriterFactory;
-import io.fd.honeycomb.vppnsh.impl.cfgattrs.VppNshConfiguration;
import io.fd.honeycomb.vppnsh.impl.config.VppNshWriterFactory;
import io.fd.honeycomb.vppnsh.impl.init.VppNshInitializer;
import io.fd.honeycomb.vppnsh.impl.oper.VppNshReaderFactory;
import io.fd.honeycomb.vppnsh.impl.util.JVppNshProvider;
-import net.jmob.guice.conf.core.ConfigurationModule;
import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Override
protected void configure() {
- // TODO HONEYCOMB-207 workaround:
- if (!isEnabled()) {
- LOG.info("VppNshModule is disabled. Skipping module configuration.");
- return;
- }
LOG.info("Configuring VppNsh module");
// Naming contexts
Multibinder.newSetBinder(binder(), DataTreeInitializer.class).addBinding().to(VppNshInitializer.class);
LOG.info("NSH module successfully configured");
}
-
- private static boolean isEnabled() {
- final Injector injector = Guice.createInjector(new AbstractModule() {
- @Override
- protected void configure() {
- // These are plugin specific config attributes
- install(ConfigurationModule.create());
- requestInjection(VppNshConfiguration.class);
- }
- });
-
- final VppNshConfiguration cfgAttributes = injector.getInstance(VppNshConfiguration.class);
- LOG.debug("Configuration for VppNsh module: {}", cfgAttributes);
- return cfgAttributes.isNshEnabled();
- }
}
+++ /dev/null
-/*
- * Copyright (c) 2016 Intel 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.vppnsh.impl.cfgattrs;
-
-import com.google.common.base.MoreObjects;
-
-import net.jmob.guice.conf.core.BindConfig;
-import net.jmob.guice.conf.core.InjectConfig;
-import net.jmob.guice.conf.core.Syntax;
-
-@BindConfig(value = "vppnsh", syntax = Syntax.JSON)
-public class VppNshConfiguration {
-
- public boolean isNshEnabled() {
- return Boolean.valueOf(nshEnable);
- }
-
- @InjectConfig("nsh-enabled")
- public String nshEnable;
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("nshEnable", nshEnable)
- .toString();
- }
-}
+++ /dev/null
-{
- "nsh-enabled": "false"
-}
\ No newline at end of file
<properties>
<exec.parameters>-Xms128m -Xmx128m</exec.parameters>
- <main.class>io.fd.honeycomb.samples.distro.Main</main.class>
+ <main.class>io.fd.honeycomb.infra.distro.Main</main.class>
<interfaces.mapping.version>1.16.12-SNAPSHOT</interfaces.mapping.version>
<honeycomb.min.distro.version>1.16.12-SNAPSHOT</honeycomb.min.distro.version>
<sonar.skip>true</sonar.skip>
+ <distribution.modules>
+ io.fd.honeycomb.samples.interfaces.mapping.SampleInterfaceModule
+ </distribution.modules>
</properties>
<build>
+++ /dev/null
-/*
- * 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.samples.distro;
-
-import com.google.common.collect.Lists;
-import com.google.inject.Module;
-import io.fd.honeycomb.samples.interfaces.mapping.SampleInterfaceModule;
-import java.util.List;
-
-public class Main {
-
- public static void main(String[] args) {
- final List<Module> sampleModules = Lists.newArrayList(io.fd.honeycomb.infra.distro.Main.BASE_MODULES);
-
- sampleModules.add(new SampleInterfaceModule());
-
- io.fd.honeycomb.infra.distro.Main.init(sampleModules);
- }
-}
+++ /dev/null
-= minimal-distribution
-
-Overview of minimal-distribution
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2015 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <parent>
- <groupId>io.fd.honeycomb.common</groupId>
- <artifactId>minimal-distribution-parent</artifactId>
- <version>1.16.12-SNAPSHOT</version>
- <relativePath>../../common/minimal-distribution-parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>minimal-distribution</artifactId>
- <version>1.16.12-SNAPSHOT</version>
-
- <properties>
- <main.class>io.fd.honeycomb.vpp.distro.Main</main.class>
- <honeycomb.min.distro.version>1.16.12-SNAPSHOT</honeycomb.min.distro.version>
- <jvpp.version>16.12-SNAPSHOT</jvpp.version>
- <hamcrest.version>1.3</hamcrest.version>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>io.fd.honeycomb</groupId>
- <artifactId>minimal-distribution</artifactId>
- <version>${honeycomb.min.distro.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>naming-context-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>naming-context-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.vpp</groupId>
- <artifactId>jvpp-registry</artifactId>
- <version>${jvpp.version}</version>
- </dependency>
- <dependency>
- <groupId>io.fd.vpp</groupId>
- <artifactId>jvpp-core</artifactId>
- <version>${jvpp.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>vpp-translate-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-testlib</artifactId>
- <version>${guice.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <version>${hamcrest.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-/*
- * 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.vpp.distro;
-
-import com.google.common.collect.Lists;
-import com.google.inject.Module;
-import java.util.List;
-
-public class Main {
-
- public static void main(String[] args) {
- final List<Module> sampleModules = Lists.newArrayList(io.fd.honeycomb.infra.distro.Main.BASE_MODULES);
-
- sampleModules.add(new VppCommonModule());
-
- io.fd.honeycomb.infra.distro.Main.init(sampleModules);
- }
-}
<module>vpp-translate-utils</module>
<module>naming-context-api</module>
<module>naming-context-impl</module>
- <module>minimal-distribution</module>
+ <module>vpp-common-integration</module>
<module>vpp-impl-parent</module>
<module>vpp-translate-test</module>
</modules>
--- /dev/null
+= vpp-common-integration
+
+Overview of vpp-common-integration
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>impl-parent</artifactId>
+ <version>1.16.12-SNAPSHOT</version>
+ <relativePath>../../common/impl-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>io.fd.honeycomb.vpp</groupId>
+ <artifactId>vpp-common-integration</artifactId>
+ <version>1.16.12-SNAPSHOT</version>
+
+ <properties>
+ <honeycomb.min.distro.version>1.16.12-SNAPSHOT</honeycomb.min.distro.version>
+ <jvpp.version>16.12-SNAPSHOT</jvpp.version>
+ <hamcrest.version>1.3</hamcrest.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb</groupId>
+ <artifactId>minimal-distribution</artifactId>
+ <version>${honeycomb.min.distro.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>naming-context-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>naming-context-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.vpp</groupId>
+ <artifactId>jvpp-registry</artifactId>
+ <version>${jvpp.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.vpp</groupId>
+ <artifactId>jvpp-core</artifactId>
+ <version>${jvpp.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-translate-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-testlib</artifactId>
+ <version>${guice.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>${hamcrest.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import com.google.inject.Inject;
import com.google.inject.name.Named;
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import com.google.inject.Inject;
import io.fd.honeycomb.infra.distro.ProviderTrait;
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import com.google.inject.Inject;
import io.fd.honeycomb.infra.distro.ProviderTrait;
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import net.jmob.guice.conf.core.BindConfig;
import net.jmob.guice.conf.core.InjectConfig;
* limitations under the License.
*/
-package io.fd.honeycomb.vpp.distro;
+package io.fd.honeycomb.vpp.common.integration;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
<version>1.16.12-SNAPSHOT</version>
<properties>
- <main.class>io.fd.honeycomb.vpp.integration.distro.Main</main.class>
+ <main.class>io.fd.honeycomb.infra.distro.Main</main.class>
<v3po.version>1.16.12-SNAPSHOT</v3po.version>
<lisp.version>1.16.12-SNAPSHOT</lisp.version>
- <vpp.common.min.distro.version>1.16.12-SNAPSHOT</vpp.common.min.distro.version>
+ <vpp.common.integration.version>1.16.12-SNAPSHOT</vpp.common.integration.version>
<vppnsh.version>1.16.12-SNAPSHOT</vppnsh.version>
+
+ <distribution.modules>
+ io.fd.honeycomb.vpp.common.integration.VppCommonModule,
+ io.fd.honeycomb.lisp.LispModule,
+ io.fd.honeycomb.translate.v3po.V3poModule,
+ // io.fd.honeycomb.vppnsh.impl.VppNshModule
+ <!-- Nsh module by default disabled, because it needs vpp-nsh plugin, which is not part of vpp codebase.-->
+ </distribution.modules>
</properties>
<build>
<dependencies>
<dependency>
<groupId>io.fd.honeycomb.vpp</groupId>
- <artifactId>minimal-distribution</artifactId>
- <version>${vpp.common.min.distro.version}</version>
+ <artifactId>vpp-common-integration</artifactId>
+ <version>${vpp.common.integration.version}</version>
</dependency>
<dependency>
<groupId>io.fd.honeycomb.v3po</groupId>
+++ /dev/null
-/*
- * 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.vpp.integration.distro;
-
-import com.google.common.collect.Lists;
-import com.google.inject.Module;
-import io.fd.honeycomb.lisp.LispModule;
-import io.fd.honeycomb.translate.v3po.V3poModule;
-import io.fd.honeycomb.vpp.distro.VppCommonModule;
-import io.fd.honeycomb.vppnsh.impl.VppNshModule;
-import java.util.List;
-
-public class Main {
-
- public static void main(String[] args) {
- final List<Module> sampleModules = Lists.newArrayList(io.fd.honeycomb.infra.distro.Main.BASE_MODULES);
-
- // All the plugins should be listed here
- sampleModules.add(new VppCommonModule());
- sampleModules.add(new V3poModule());
- sampleModules.add(new LispModule());
- sampleModules.add(new VppNshModule());
-
- io.fd.honeycomb.infra.distro.Main.init(sampleModules);
- }
-}