@Override public void initialize(Bootstrap<?> bootstrap) { final InjectableValues injectableValues = new InjectableValues() { @Override public Object findInjectableValue(Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance) { return null; } }; final ConfigurationFactoryFactory<? extends Configuration> configurationFactoryFactory = bootstrap.getConfigurationFactoryFactory(); ConfigurationFactoryFactory factoryFactory = new ConfigurationFactoryFactory() { @Override public ConfigurationFactory create(Class klass, Validator validator, ObjectMapper objectMapper, String propertyPrefix) { objectMapper.setInjectableValues(injectableValues); //noinspection unchecked return configurationFactoryFactory.create(klass, validator, objectMapper, propertyPrefix); } }; //noinspection unchecked bootstrap.setConfigurationFactoryFactory(factoryFactory); }
@Inject public SupportedMsaVersionsLoader( final ConfigurationFactoryFactory<SupportedMsaVersions> supportedMsaVersionsFactoryFactory, final ObjectMapper objectMapper, final UrlConfigurationSourceProvider configurationSourceProvider) { this.supportedMsaVersionsFactoryFactory = supportedMsaVersionsFactoryFactory; this.objectMapper = objectMapper; this.configurationSourceProvider = configurationSourceProvider; }
@Inject public FileBackedTransactionConfigDataSource(ConfigConfiguration configuration, ConfigurationFactoryFactory<TransactionConfigEntityData> configurationFactoryFactory, ObjectMapper objectMapper) { super( configuration, configurationFactoryFactory.create(TransactionConfigEntityData.class, Validation.buildDefaultValidatorFactory().getValidator(), objectMapper, "hub"), TRANSACTIONS_DATA_DIRECTORY ); }
@Inject public FileBackedCountriesConfigDataSource( ConfigConfiguration configuration, ConfigurationFactoryFactory<CountriesConfigEntityData> configurationFactoryFactory, ObjectMapper objectMapper) { super( configuration, configurationFactoryFactory.create(CountriesConfigEntityData.class, Validation.buildDefaultValidatorFactory().getValidator(), objectMapper, "hub"), COUNTRIES_DATA_DIRECTORY ); }
@Inject public FileBackedMatchingServiceConfigDataSource( ConfigConfiguration configuration, ConfigurationFactoryFactory<MatchingServiceConfigEntityData> configurationFactoryFactory, ObjectMapper objectMapper) { super( configuration, configurationFactoryFactory.create(MatchingServiceConfigEntityData.class, Validation.buildDefaultValidatorFactory().getValidator(), objectMapper, "hub"), MATCHING_SERVICE_DATA_DIRECTORY ); }
@Inject public FileBackedIdentityProviderConfigDataSource( ConfigConfiguration configuration, ConfigurationFactoryFactory<IdentityProviderConfigEntityData> configurationFactoryFactory, ObjectMapper objectMapper) { super( configuration, configurationFactoryFactory.create(IdentityProviderConfigEntityData.class, Validation.buildDefaultValidatorFactory().getValidator(), objectMapper, "hub"), IDENTITY_PROVIDER_DATA_DIRECTORY ); }
@Override protected void configure() { bind(ConfigHealthCheck.class).asEagerSingleton(); bind(ConfigDataBootstrap.class).asEagerSingleton(); bind(TrustStoreConfiguration.class).to(ConfigConfiguration.class); bind(new TypeLiteral<ConfigurationFactoryFactory<IdentityProviderConfigEntityData>>() {}).toInstance(new DefaultConfigurationFactoryFactory<IdentityProviderConfigEntityData>()); bind(new TypeLiteral<ConfigurationFactoryFactory<TransactionConfigEntityData>>(){}).toInstance(new DefaultConfigurationFactoryFactory<TransactionConfigEntityData>()); bind(new TypeLiteral<ConfigurationFactoryFactory<MatchingServiceConfigEntityData>>(){}).toInstance(new DefaultConfigurationFactoryFactory<MatchingServiceConfigEntityData>()); bind(new TypeLiteral<ConfigurationFactoryFactory<CountriesConfigEntityData>>(){}).toInstance(new DefaultConfigurationFactoryFactory<CountriesConfigEntityData>()); bind(new TypeLiteral<ConfigDataSource<TransactionConfigEntityData>>() {}).to(FileBackedTransactionConfigDataSource.class).asEagerSingleton(); bind(new TypeLiteral<ConfigDataSource<MatchingServiceConfigEntityData>>() {}).to(FileBackedMatchingServiceConfigDataSource.class).asEagerSingleton(); bind(new TypeLiteral<ConfigDataSource<IdentityProviderConfigEntityData>>() {}).to(FileBackedIdentityProviderConfigDataSource.class).asEagerSingleton(); bind(new TypeLiteral<ConfigDataSource<CountriesConfigEntityData>>() {}).to(FileBackedCountriesConfigDataSource.class).asEagerSingleton(); bind(new TypeLiteral<ConfigEntityDataRepository<TransactionConfigEntityData>>(){}).asEagerSingleton(); bind(new TypeLiteral<ConfigEntityDataRepository<CountriesConfigEntityData>>(){}).asEagerSingleton(); bind(new TypeLiteral<ConfigEntityDataRepository<MatchingServiceConfigEntityData>>(){}).asEagerSingleton(); bind(new TypeLiteral<ConfigEntityDataRepository<IdentityProviderConfigEntityData>>(){}).asEagerSingleton(); bind(ObjectMapper.class).toInstance(new ObjectMapper().registerModule(new GuavaModule())); bind(LevelsOfAssuranceConfigValidator.class).toInstance(new LevelsOfAssuranceConfigValidator()); bind(CertificateChainConfigValidator.class); bind(CertificateChainValidator.class); bind(TrustStoreForCertificateProvider.class); bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory()); bind(KeyStoreCache.class); bind(ExceptionFactory.class); bind(OCSPCertificateChainValidityChecker.class); bind(EntityConfigDataToCertificateDtoTransformer.class); bind(OCSPCertificateChainValidator.class); bind(IdpPredicateFactory.class); bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader()); bind(OCSPPKIXParametersProvider.class).toInstance(new OCSPPKIXParametersProvider()); bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider()); }
public AdminConsoleAppBuilder<T> withConfigurationClass(final Class<T> configurationClass) { factoryFactory = new ConfigurationFactoryFactory<T>() { @Override public ConfigurationFactory<T> create(Class<T> klass, Validator validator, ObjectMapper objectMapper, String propertyPrefix) { return new YamlConfigurationFactory<>(configurationClass, validator, objectMapper, propertyPrefix); } }; return this; }
@Override protected void configure() { bind(TrustStoreConfiguration.class).to(SamlSoapProxyConfiguration.class); bind(EventSinkProxy.class).to(EventSinkHttpProxy.class); bind(PublicKeyInputStreamFactory.class).toInstance(new PublicKeyFileInputStreamFactory()); bind(InternalPublicKeyStore.class).to(HubMetadataPublicKeyStore.class); bind(RestfulClientConfiguration.class).to(SamlSoapProxyConfiguration.class); bind(Client.class).toProvider(DefaultClientProvider.class).asEagerSingleton(); bind(new TypeLiteral<ConfigurationFactoryFactory<SupportedMsaVersions>>() {}).toInstance(new DefaultConfigurationFactoryFactory<SupportedMsaVersions>() {}); bind(new TypeLiteral<SupportedMsaVersionsRepository>() {}).asEagerSingleton(); bind(SupportedMsaVersionsBootstrap.class).asEagerSingleton(); bind(SupportedMsaVersionsLoader.class).asEagerSingleton(); bind(MetadataRefreshTask.class).asEagerSingleton(); bind(ConfigServiceKeyStore.class).asEagerSingleton(); bind(ExpiredCertificateMetadataFilter.class).toInstance(new ExpiredCertificateMetadataFilter()); bind(UrlConfigurationSourceProvider.class).toInstance(new UrlConfigurationSourceProvider()); bind(TrustStoreForCertificateProvider.class); bind(JsonResponseProcessor.class); bind(ObjectMapper.class).toInstance(new ObjectMapper()); bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory()); bind(CertificateChainValidator.class); bind(CertificatesConfigProxy.class); bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider()); bind(KeyStoreCache.class); bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader()); bind(MatchingServiceHealthCheckHandler.class); bind(MatchingServiceHealthChecker.class); bind(MatchingServiceConfigProxy.class); bind(MatchingServiceHealthCheckClient.class); bind(HealthCheckEventLogger.class); bind(SamlEngineProxy.class); bind(HealthCheckSoapRequestClient.class); bind(AttributeQueryRequestRunnableFactory.class); bind(ExecuteAttributeQueryRequest.class); bind(AttributeQueryRequestClient.class); bind(ProtectiveMonitoringLogger.class).toInstance(new ProtectiveMonitoringLogger()); bind(SoapRequestClient.class); bind(HubMatchingServiceResponseReceiverProxy.class); bind(ExternalCommunicationEventLogger.class); bind(SoapMessageManager.class).toInstance(new SoapMessageManager()); bind(IpAddressResolver.class).toInstance(new IpAddressResolver()); bind(TimeoutEvaluator.class).toInstance(new TimeoutEvaluator()); bind(MetadataHealthCheckRegistry.class).asEagerSingleton(); }
public AdminConsoleAppBuilder<T> withConfigurationClassFactory(ConfigurationFactoryFactory<T> factoryFactory) { this.factoryFactory = Preconditions.checkNotNull(factoryFactory, "factoryFactory cannot be null"); return this; }
ConfigurationFactoryFactory<T> getFactoryFactory() { return factoryFactory; }