summaryrefslogtreecommitdiffstats
path: root/infra/minimal-distribution-core/src
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-10-04 09:55:39 +0200
committerJan Srnicek <jsrnicek@cisco.com>2017-10-04 09:56:12 +0200
commit88f40ecade3b99675982be81a1774690a0977765 (patch)
treedbc7f0e46113cb10b9fc6244f2a6f4c068266118 /infra/minimal-distribution-core/src
parentb288fb83f0ebc74ed33a2aabfb68d0e24c1a322c (diff)
HONEYCOMB-401 - Fix compilation issues for benchmark
Change-Id: I93df9e6b65273c82da308a194f4fe6488c6ce5e1 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'infra/minimal-distribution-core/src')
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActivationConfig.java7
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModules.java5
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/YangModulesProvider.java25
3 files changed, 14 insertions, 23 deletions
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActivationConfig.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActivationConfig.java
index a17f5d632..ecda4ae72 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActivationConfig.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActivationConfig.java
@@ -16,19 +16,20 @@
package io.fd.honeycomb.infra.distro.activation;
-import java.util.Optional;
import net.jmob.guice.conf.core.BindConfig;
import net.jmob.guice.conf.core.InjectConfig;
import net.jmob.guice.conf.core.Syntax;
+import java.util.Optional;
+
@BindConfig(value = "activation", syntax = Syntax.JSON)
public class ActivationConfig {
@InjectConfig("modules-resource-path")
- private String modulesResourcePath;
+ public String modulesResourcePath;
@InjectConfig("yang-modules-index-path")
- private String yangModulesIndexPath;
+ public String yangModulesIndexPath;
public String getModulesResourcePath() {
return Optional.ofNullable(modulesResourcePath).orElse("../modules/");
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModules.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModules.java
index f729f00b9..601e9b686 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModules.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/activation/ActiveModules.java
@@ -16,12 +16,13 @@
package io.fd.honeycomb.infra.distro.activation;
-import static java.lang.String.format;
-
import com.google.inject.Module;
+
import java.util.Set;
import java.util.stream.Collectors;
+import static java.lang.String.format;
+
/**
* Provides static set of active activeModulesClasses
*/
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/YangModulesProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/YangModulesProvider.java
index f6d8ea0c1..b60df1ad6 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/YangModulesProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/YangModulesProvider.java
@@ -17,21 +17,18 @@
package io.fd.honeycomb.infra.distro.schema;
-import static java.lang.String.format;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Resources;
import com.google.inject.Inject;
import com.google.inject.Provider;
import io.fd.honeycomb.infra.distro.activation.ActivationConfig;
import io.fd.honeycomb.infra.distro.activation.ActiveModules;
-import java.io.IOException;
-import java.net.URL;
+import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
+
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;
-import javax.annotation.Nonnull;
-import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
+
+import static java.lang.String.format;
/**
* Loads active yang modules
@@ -59,10 +56,10 @@ public class YangModulesProvider implements Provider<YangModulesProvider.YangMod
.collect(Collectors.toSet()));
}
- static class YangModules {
+ public static class YangModules {
private final Set<Class<? extends YangModelBindingProvider>> yangBindings;
- YangModules(final Set<Class<? extends YangModelBindingProvider>> yangBindings) {
+ public YangModules(final Set<Class<? extends YangModelBindingProvider>> yangBindings) {
this.yangBindings = yangBindings;
}
@@ -86,12 +83,4 @@ public class YangModulesProvider implements Provider<YangModulesProvider.YangMod
throw new IllegalArgumentException("Unable to load class: " + className, e);
}
}
-
- static String urlToString(@Nonnull final URL url) {
- try {
- return Resources.toString(url, Charsets.UTF_8);
- } catch (IOException e) {
- throw new IllegalArgumentException("Unable to read resource from: " + url, e);
- }
- }
}