Search in sources :

Example 1 with SnomedRf2ImportConfiguration

use of com.b2international.snowowl.snomed.core.rest.domain.SnomedRf2ImportConfiguration in project snow-owl by b2ihealthcare.

the class SnomedRf2ImportRestService method toRf2ImportConfiguration.

private SnomedRf2ImportConfiguration toRf2ImportConfiguration(RemoteJobEntry job) {
    ApiError error = null;
    ImportResponse response = null;
    ObjectMapper mapper = ApplicationContext.getServiceForClass(ObjectMapper.class);
    if (RemoteJobState.FAILED == job.getState()) {
        error = job.getResultAs(mapper, ApiError.class);
    } else if (job.isSuccessful()) {
        response = job.getResultAs(mapper, ImportResponse.class);
    }
    return new SnomedRf2ImportConfiguration(IDs.sha1(job.getId()), job.getState(), error, response);
}
Also used : ImportResponse(com.b2international.snowowl.core.request.io.ImportResponse) SnomedRf2ImportConfiguration(com.b2international.snowowl.snomed.core.rest.domain.SnomedRf2ImportConfiguration) ApiError(com.b2international.commons.exceptions.ApiError) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ApiError (com.b2international.commons.exceptions.ApiError)1 ImportResponse (com.b2international.snowowl.core.request.io.ImportResponse)1 SnomedRf2ImportConfiguration (com.b2international.snowowl.snomed.core.rest.domain.SnomedRf2ImportConfiguration)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1