use of uk.gov.ida.restclient.ClientProvider 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 uk.gov.ida.restclient.ClientProvider 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 uk.gov.ida.restclient.ClientProvider in project verify-hub by alphagov.
the class PolicyModule method jsonClient.
@Provides
@Singleton
public JsonClient jsonClient(JsonResponseProcessor jsonResponseProcessor, Environment environment, PolicyConfiguration configuration) {
Client client = new ClientProvider(environment, configuration.getJerseyClientConfiguration(), configuration.getEnableRetryTimeOutConnections(), "policyClient").get();
ErrorHandlingClient errorHandlingClient = new ErrorHandlingClient(client);
return new JsonClient(errorHandlingClient, jsonResponseProcessor);
}
use of uk.gov.ida.restclient.ClientProvider in project verify-hub by alphagov.
the class PolicyModule method forSamlSoapProxy.
@Provides
@Singleton
@Named("samlSoapProxyClient")
public JsonClient forSamlSoapProxy(JsonResponseProcessor responseProcessor, PolicyConfiguration configuration, Environment environment) {
Client client = new ClientProvider(environment, configuration.getSamlSoapProxyClient(), configuration.getEnableRetryTimeOutConnections(), "SamlSoapProxyClient").get();
ErrorHandlingClient errorHandlingClient = new ErrorHandlingClient(client);
return new JsonClient(errorHandlingClient, responseProcessor);
}
use of uk.gov.ida.restclient.ClientProvider in project verify-hub by alphagov.
the class MatchingServiceRequestSenderTest method setBackOffClient.
private static void setBackOffClient() {
final List<String> exceptionsToCatch = List.of(ConnectTimeoutException.class.getName(), SocketException.class.getName(), SocketTimeoutException.class.getName(), NoHttpResponseException.class.getName());
JerseyClientWithRetryBackoffConfiguration jerseyClientConfiguration = aJerseyClientWithRetryBackoffHandlerConfiguration().withTimeout(Duration.seconds(1)).withRetryBackoffPeriod(Duration.seconds(1)).withRetryExceptionList(exceptionsToCatch).withChunkedEncodingEnabled(false).withNumRetries(2).build();
ClientProvider provider = new ClientProvider(samlSoapProxyApp.getEnvironment(), jerseyClientConfiguration, true, MatchingServiceRequestSenderTest.class.getSimpleName());
backOffClient = provider.get();
}
Aggregations