use of javax.inject.Singleton in project verify-hub by alphagov.
the class SamlSoapProxyModule method getPrometheusClientService.
@Provides
@Singleton
private PrometheusClient getPrometheusClientService(Environment environment, SamlSoapProxyConfiguration configConfiguration, MatchingServiceConfigProxy matchingServiceConfigProxy, MatchingServiceHealthChecker matchingServiceHealthChecker) {
PrometheusClient prometheusClientService = new PrometheusClient(environment, configConfiguration, matchingServiceConfigProxy, matchingServiceHealthChecker);
prometheusClientService.createMatchingServiceHealthCheckMetrics();
return prometheusClientService;
}
use of javax.inject.Singleton in project verify-hub by alphagov.
the class SamlSoapProxyModule method jsonClient.
@Provides
@Singleton
public JsonClient jsonClient(JsonResponseProcessor jsonResponseProcessor, Environment environment, SamlSoapProxyConfiguration configuration) {
Client client = new ClientProvider(environment, configuration.getJerseyClientConfiguration(), configuration.getEnableRetryTimeOutConnections(), "samlSoapProxyClient").get();
ErrorHandlingClient errorHandlingClient = new ErrorHandlingClient(client);
return new JsonClient(errorHandlingClient, jsonResponseProcessor);
}
use of javax.inject.Singleton in project verify-hub by alphagov.
the class SamlEngineModule method jsonClient.
@Provides
@Singleton
private JsonClient jsonClient(JsonResponseProcessor jsonResponseProcessor, Environment environment, SamlEngineConfiguration configuration) {
Client client = new ClientProvider(environment, configuration.getJerseyClientConfiguration(), configuration.getEnableRetryTimeOutConnections(), "samlEngineClient").get();
ErrorHandlingClient errorHandlingClient = new ErrorHandlingClient(client);
return new JsonClient(errorHandlingClient, jsonResponseProcessor);
}
use of javax.inject.Singleton in project verify-hub by alphagov.
the class SamlEngineModule method registerMetadataRefreshTask.
@Provides
@Named("VERIFY_METADATA_REFRESH_TASK")
@Singleton
private Task registerMetadataRefreshTask(Environment environment, @Named(VERIFY_METADATA_RESOLVER) MetadataResolver metadataResolver) {
Task task = new Task("metadata-refresh") {
@Override
public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {
((AbstractReloadingMetadataResolver) metadataResolver).refresh();
}
};
environment.admin().addTask(task);
return task;
}
use of javax.inject.Singleton in project verify-hub by alphagov.
the class ConfigModule method getPrometheusClientService.
@Provides
@Singleton
@SuppressWarnings("unused")
private PrometheusClientService getPrometheusClientService(Environment environment, ConfigConfiguration configConfiguration, CertificateService certificateService, OCSPCertificateChainValidityChecker ocspCertificateChainValidityChecker) {
PrometheusClientService prometheusClientService = new PrometheusClientService(environment, configConfiguration, certificateService, ocspCertificateChainValidityChecker);
prometheusClientService.createCertificateExpiryDateCheckMetrics();
prometheusClientService.createCertificateOcspRevocationStatusCheckMetrics();
return prometheusClientService;
}
Aggregations