use of uk.gov.ida.hub.config.domain.TranslationData in project verify-hub by alphagov.
the class ConfigValidCommand method run.
@Override
public void run(Bootstrap<ConfigConfiguration> bootstrap, Namespace namespace, ConfigConfiguration configuration) {
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<ConfigurationFactoryFactory<IdentityProviderConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<MatchingServiceConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TransactionConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TranslationData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigDataSource<TransactionConfig>>() {
}).to(FileBackedTransactionConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<TranslationData>>() {
}).to(FileBackedTranslationsDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<MatchingServiceConfig>>() {
}).to(FileBackedMatchingServiceConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<IdentityProviderConfig>>() {
}).to(FileBackedIdentityProviderConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<TransactionConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<TranslationData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<MatchingServiceConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<IdentityProviderConfig>>() {
}).asEagerSingleton();
bind(ConfigConfiguration.class).toInstance(configuration);
bind(LevelsOfAssuranceConfigValidator.class).toInstance(new LevelsOfAssuranceConfigValidator());
bind(TrustStoreConfiguration.class).to(ConfigConfiguration.class);
bind(TrustStoreForCertificateProvider.class);
bind(CertificateChainConfigValidator.class);
}
});
ConfigDataBootstrap checkConfigValid = injector.getInstance(ConfigDataBootstrap.class);
try {
checkConfigValid.start();
} catch (ConfigValidationException e) {
LOG.info(e.getMessage());
throw e;
}
}
Aggregations