diff options
Diffstat (limited to 'infra/minimal-distribution-core/src/main')
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); - } - } } |