use of com.opentext.ia.sdk.support.datetime.DefaultClock in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class ArchiveClients method configuringServerUsing.
/**
* Returns an ArchiveClient instance and configures the InfoArchive server that it communicates with.
* @param configurer How to configure InfoArchive
* @param optionalClient The REST client to use for communication with the server
* @param optionalClock The clock to use
* @return An ArchiveClient
*/
public static ArchiveClient configuringServerUsing(InfoArchiveConfigurer configurer, RestClient optionalClient, Clock optionalClock) {
ServerConfiguration serverConfiguration = configurer.getServerConfiguration();
Clock clock = Optional.ofNullable(optionalClock).orElseGet(DefaultClock::new);
RestClient client = Optional.ofNullable(optionalClient).orElseGet(() -> createRestClient(serverConfiguration, clock));
configurer.configure();
return usingAlreadyConfiguredServer(serverConfiguration, client, clock);
}
use of com.opentext.ia.sdk.support.datetime.DefaultClock in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class ArchiveClients method usingAlreadyConfiguredServer.
/**
* Creates a new ArchiveClient instance without installing any artifacts in the archive using the default RestClient.
* @param serverConfiguration How to communicate with the server
* @return An ArchiveClient
*/
public static ArchiveClient usingAlreadyConfiguredServer(ServerConfiguration serverConfiguration) {
Clock clock = new DefaultClock();
RestClient restClient = createRestClient(serverConfiguration, clock);
return usingAlreadyConfiguredServer(serverConfiguration, restClient, clock);
}
Aggregations