use of com.opentext.ia.sdk.dto.Services in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class ArchiveConnection method getServerVersion.
public String getServerVersion() throws IOException {
if (serverVersion != null) {
return serverVersion;
}
Services services = getServices();
ProductInfo productInfo = getRestClient().follow(services, InfoArchiveLinkRelations.LINK_PRODUCT_INFO, ProductInfo.class);
if (productInfo == null) {
throw new IllegalStateException("Cannot determine server version");
}
serverVersion = productInfo.getBuildProperties().getServerVersion();
return serverVersion;
}
use of com.opentext.ia.sdk.dto.Services in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class ArchiveClients method appResourceCache.
private static ApplicationIngestionResourcesCache appResourceCache(String applicationName, ArchiveConnection connection, RestClient restClient) throws IOException {
ApplicationIngestionResourcesCache resourceCache = new ApplicationIngestionResourcesCache(applicationName);
Services services = connection.getServices();
ProductInfo productInfo = getProductInfo(restClient, services);
Tenant tenant = getTenant(restClient, services);
Application application = getApplication(restClient, tenant, applicationName);
cacheResourceUris(restClient, services, productInfo, application, resourceCache);
return resourceCache;
}
use of com.opentext.ia.sdk.dto.Services in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class WhenConfiguringServerUsingYaml method shouldConfigureFromClientWhenServerDoesntSupportsYamlConfiguration.
@Test
void shouldConfigureFromClientWhenServerDoesntSupportsYamlConfiguration() throws IOException {
Services services = new Services();
when(httpClient.get(any(), any(), eq(Services.class))).thenReturn(services);
configurer.configure(connection);
verify(clientSideConfigurer).configure(any());
verify(httpClient, never()).put(anyString(), any(), any(), anyString());
}
use of com.opentext.ia.sdk.dto.Services in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class WhenConfiguringServerUsingYaml method shouldDeferToServerWhenItSupportsYamlConfiguration.
@Test
void shouldDeferToServerWhenItSupportsYamlConfiguration() throws IOException {
String configurationUri = randomUri();
Services services = new Services();
services.getLinks().put(LINK_CONFIGURATION, new Link(configurationUri));
when(httpClient.get(any(), any(), eq(Services.class))).thenReturn(services);
configurer.configure(connection);
verify(httpClient).put(eq(configurationUri), any(), eq(String.class), anyString());
verify(clientSideConfigurer, never()).configure(any());
}
use of com.opentext.ia.sdk.dto.Services in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class InfoArchiveRestClient method search.
@Override
public JobInstance search(String jobName, String applicationName, String tenantName) throws IOException {
Services services = restClient.get(resourceCache.getServicesUri(), Services.class);
JobDefinitions jobDefinitions = restClient.followNonPaged(services, InfoArchiveLinkRelations.LINK_JOB_DEFINITIONS, JobDefinitions.class);
JobDefinition jobDefinition = jobDefinitions.byName(jobName);
String runLink = jobDefinition.getUri(InfoArchiveLinkRelations.LINK_JOB_INSTANCES);
JobInstanceFilter jobSettings = new JobInstanceFilter();
jobSettings.setNow(true);
if (applicationName != null) {
jobSettings.setApplication(applicationName);
}
if (tenantName != null) {
jobSettings.setTenant(applicationName);
}
return restClient.post(runLink, JobInstance.class, jobSettings);
}
Aggregations