use of net.geoprism.registry.etl.ExportJobHasErrors in project geoprism-registry by terraframe.
the class DHIS2SynchronizationManager method handleExportErrors.
private void handleExportErrors() {
ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
query.WHERE(query.getHistory().EQ(history));
Boolean hasErrors = query.getCount() > 0;
if (hasErrors) {
ExportJobHasErrors ex = new ExportJobHasErrors();
throw ex;
}
}
use of net.geoprism.registry.etl.ExportJobHasErrors in project geoprism-registry by terraframe.
the class FhirExportSynchronizationManager method handleExportErrors.
private void handleExportErrors() {
ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
query.WHERE(query.getHistory().EQ(history));
Boolean hasErrors = query.getCount() > 0;
if (hasErrors) {
ExportJobHasErrors ex = new ExportJobHasErrors();
throw ex;
}
}
use of net.geoprism.registry.etl.ExportJobHasErrors in project geoprism-registry by terraframe.
the class FhirImportSynchronizationManager method handleExportErrors.
private void handleExportErrors() {
ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
query.WHERE(query.getHistory().EQ(history));
Boolean hasErrors = query.getCount() > 0;
if (hasErrors) {
ExportJobHasErrors ex = new ExportJobHasErrors();
throw ex;
}
}
use of net.geoprism.registry.etl.ExportJobHasErrors in project geoprism-registry by terraframe.
the class FhirImportSynchronizationManager method synchronize.
public void synchronize() {
final FhirExternalSystem system = (FhirExternalSystem) this.details.getSystem();
try (FhirConnection connection = FhirConnectionFactory.get(system)) {
FhirResourceProcessor processor = FhirFactory.getProcessor(this.details.getImplementation());
FhirResourceImporter importer = new FhirResourceImporter(connection, processor, this.history, this.config.getLastSynchDate());
importer.synchronize();
history.appLock();
history.clearStage();
history.addStage(ExportStage.COMPLETE);
history.apply();
config.appLock();
config.setLastSynchDate(new Date());
config.apply();
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.DATA_EXPORT_JOB_CHANGE, null));
handleExportErrors();
} catch (ExportJobHasErrors e) {
throw e;
} catch (Exception e) {
throw new HttpError(e);
}
}
Aggregations