Search in sources :

Example 1 with ExportJobHasErrors

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;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Example 2 with ExportJobHasErrors

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;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Example 3 with ExportJobHasErrors

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;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Example 4 with ExportJobHasErrors

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);
    }
}
Also used : HttpError(net.geoprism.registry.etl.export.HttpError) GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors) FhirExternalSystem(net.geoprism.registry.graph.FhirExternalSystem) Date(java.util.Date) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException)

Aggregations

ExportJobHasErrors (net.geoprism.registry.etl.ExportJobHasErrors)4 QueryFactory (com.runwaysdk.query.QueryFactory)3 ExportErrorQuery (net.geoprism.registry.etl.export.ExportErrorQuery)3 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)1 Date (java.util.Date)1 HttpError (net.geoprism.registry.etl.export.HttpError)1 FhirExternalSystem (net.geoprism.registry.graph.FhirExternalSystem)1 GlobalNotificationMessage (net.geoprism.registry.ws.GlobalNotificationMessage)1