class MetadataSyncPostProcessor {

    public boolean handleSyncNotificationsAndAbortStatus( MetadataSyncSummary metadataSyncSummary, 
        MetadataRetryContext retryContext, MetadataVersion dataVersion )
    {
        ImportReport importReport = metadataSyncSummary.getImportReport();

        if ( importReport == null )
        {
            handleImportFailedContext( null, retryContext, dataVersion );

            return true;
        }

        Status syncStatus = importReport.getStatus();
        log.info( "Import completed. Import Status: " + syncStatus );

        if ( Status.OK.equals( syncStatus ) || ( Status.WARNING.equals( syncStatus ) && VersionType.BEST_EFFORT.equals( dataVersion.getType() ) ) )
        {
            sendSuccessMailToAdmin( metadataSyncSummary );
            return false;
        }

        if ( Status.ERROR.equals( syncStatus ) )
        {
            handleImportFailedContext( metadataSyncSummary, retryContext, dataVersion );
            return true;
        }

        return false;
    }

}