Search in sources :

Example 1 with ServerConfiguration

use of com.opentext.ia.sdk.client.api.ServerConfiguration in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class PropertiesBasedConfigurer method getServerConfiguration.

@Override
public ServerConfiguration getServerConfiguration() {
    ServerConfiguration result = new ServerConfiguration();
    result.setApplicationName(configuration.get(APPLICATION_NAME));
    result.setAuthenticationGateway(configuration.get(SERVER_AUTHENTICATION_GATEWAY));
    result.setAuthenticationPassword(configuration.get(SERVER_AUTHENTICATION_PASSWORD));
    result.setAuthenticationToken(configuration.get(SERVER_AUTENTICATON_TOKEN));
    result.setAuthenticationUser(configuration.get(SERVER_AUTHENTICATION_USER));
    result.setBillboardUri(configuration.get(SERVER_URI));
    result.setClientId(configuration.get(SERVER_CLIENT_ID));
    result.setClientSecret(configuration.get(SERVER_CLIENT_SECRET));
    result.setHttpClientClassName(configuration.get(HTTP_CLIENT_CLASSNAME));
    result.setProxyHost(configuration.get(PROXY_HOST));
    result.setProxyPort(configuration.get(PROXY_PORT));
    return result;
}
Also used : ServerConfiguration(com.opentext.ia.sdk.client.api.ServerConfiguration)

Example 2 with ServerConfiguration

use of com.opentext.ia.sdk.client.api.ServerConfiguration 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);
}
Also used : DefaultClock(com.opentext.ia.sdk.support.datetime.DefaultClock) ServerConfiguration(com.opentext.ia.sdk.client.api.ServerConfiguration) InfoArchiveRestClient(com.opentext.ia.sdk.client.impl.InfoArchiveRestClient) RestClient(com.opentext.ia.sdk.support.http.rest.RestClient) Clock(com.opentext.ia.sdk.support.datetime.Clock) DefaultClock(com.opentext.ia.sdk.support.datetime.DefaultClock)

Aggregations

ServerConfiguration (com.opentext.ia.sdk.client.api.ServerConfiguration)2 InfoArchiveRestClient (com.opentext.ia.sdk.client.impl.InfoArchiveRestClient)1 Clock (com.opentext.ia.sdk.support.datetime.Clock)1 DefaultClock (com.opentext.ia.sdk.support.datetime.DefaultClock)1 RestClient (com.opentext.ia.sdk.support.http.rest.RestClient)1