Search in sources :

Example 1 with JobDefinition

use of com.opentext.ia.sdk.dto.JobDefinition 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);
}
Also used : Services(com.opentext.ia.sdk.dto.Services) JobDefinitions(com.opentext.ia.sdk.dto.JobDefinitions) JobDefinition(com.opentext.ia.sdk.dto.JobDefinition) JobInstanceFilter(com.opentext.ia.sdk.dto.JobInstanceFilter)

Aggregations

JobDefinition (com.opentext.ia.sdk.dto.JobDefinition)1 JobDefinitions (com.opentext.ia.sdk.dto.JobDefinitions)1 JobInstanceFilter (com.opentext.ia.sdk.dto.JobInstanceFilter)1 Services (com.opentext.ia.sdk.dto.Services)1