Search in sources :

Example 1 with ImportStatus

use of org.hisp.dhis.dxf2.importsummary.ImportStatus in project dhis2-core by dhis2.

the class MetadataSyncPreProcessor method handleAggregateImportSummary.

//----------------------------------------------------------------------------------------
// Private Methods
//----------------------------------------------------------------------------------------
private void handleAggregateImportSummary(ImportSummary importSummary, MetadataRetryContext context) {
    if (importSummary != null) {
        ImportStatus status = importSummary.getStatus();
        if (ImportStatus.ERROR.equals(status) || ImportStatus.WARNING.equals(status)) {
            log.error("Import Summary description: " + importSummary.getDescription());
            context.updateRetryContext(MetadataSyncTask.DATA_PUSH_SUMMARY, importSummary.getDescription(), null, null);
            throw new MetadataSyncServiceException("The Data Push was not successful. ");
        }
    }
}
Also used : MetadataSyncServiceException(org.hisp.dhis.dxf2.metadata.sync.exception.MetadataSyncServiceException) ImportStatus(org.hisp.dhis.dxf2.importsummary.ImportStatus)

Aggregations

ImportStatus (org.hisp.dhis.dxf2.importsummary.ImportStatus)1 MetadataSyncServiceException (org.hisp.dhis.dxf2.metadata.sync.exception.MetadataSyncServiceException)1