use of com.opentext.ia.sdk.client.api.AuthenticationStrategyFactory in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class PropertiesBasedConfigurer method initRestClient.
private void initRestClient() throws IOException {
if (restClient == null) {
HttpClient httpClient = NewInstance.fromConfiguration(configuration, HTTP_CLIENT_CLASSNAME, ApacheHttpClient.class.getName()).as(HttpClient.class);
AuthenticationStrategy authentication = new AuthenticationStrategyFactory(getServerConfiguration()).getAuthenticationStrategy(() -> httpClient, () -> clock);
restClient = new RestClient(httpClient);
restClient.init(authentication);
}
cache.setServices(restClient.get(configured(SERVER_URI), Services.class));
}
use of com.opentext.ia.sdk.client.api.AuthenticationStrategyFactory in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class ArchiveClients method createRestClient.
private static RestClient createRestClient(ServerConfiguration configuration, Clock clock) {
HttpClient httpClient = NewInstance.of(configuration.getHttpClientClassName(), ApacheHttpClient.class.getName()).as(HttpClient.class);
AuthenticationStrategy authentication = new AuthenticationStrategyFactory(configuration).getAuthenticationStrategy(() -> httpClient, () -> clock);
RestClient result = new RestClient(httpClient);
result.init(authentication);
return result;
}
Aggregations