use of com.odysseusinc.arachne.portal.service.impl.antivirus.events.AntivirusJobResponse in project ArachneCentralAPI by OHDSI.
the class BaseAnalysisServiceImpl method processAntivirusResponse.
@EventListener
@Transactional
@Override
public void processAntivirusResponse(AntivirusJobAnalysisFileResponseEvent event) {
final AntivirusJobResponse antivirusJobResponse = event.getAntivirusJobResponse();
final AnalysisFile analysisFile = analysisFileRepository.findOne(antivirusJobResponse.getFileId());
if (analysisFile != null) {
analysisFile.setAntivirusStatus(antivirusJobResponse.getStatus());
analysisFile.setAntivirusDescription(antivirusJobResponse.getDescription());
analysisFileRepository.save(analysisFile);
}
}
use of com.odysseusinc.arachne.portal.service.impl.antivirus.events.AntivirusJobResponse in project ArachneCentralAPI by OHDSI.
the class BaseStudyServiceImpl method processAntivirusResponse.
@EventListener
@Transactional
@Override
public void processAntivirusResponse(AntivirusJobStudyFileResponseEvent event) {
final AntivirusJobResponse antivirusJobResponse = event.getAntivirusJobResponse();
final StudyFile studyFile = studyFileRepository.findOne(antivirusJobResponse.getFileId());
if (studyFile != null) {
studyFile.setAntivirusStatus(antivirusJobResponse.getStatus());
studyFile.setAntivirusDescription(antivirusJobResponse.getDescription());
studyFileRepository.save(studyFile);
}
}
use of com.odysseusinc.arachne.portal.service.impl.antivirus.events.AntivirusJobResponse in project ArachneCentralAPI by OHDSI.
the class BasePaperServiceImpl method update.
private void update(AntivirusJobResponseEventBase event, JpaRepository repository) {
final AntivirusJobResponse antivirusJobResponse = event.getAntivirusJobResponse();
final AntivirusFile file = (AntivirusFile) repository.findOne(antivirusJobResponse.getFileId());
if (file != null) {
file.setAntivirusStatus(antivirusJobResponse.getStatus());
file.setAntivirusDescription(antivirusJobResponse.getDescription());
repository.save(file);
}
}
use of com.odysseusinc.arachne.portal.service.impl.antivirus.events.AntivirusJobResponse in project ArachneCentralAPI by OHDSI.
the class AntivirusServiceImpl method publishResponse.
private void publishResponse(final AntivirusJobFileType fileType, final Long fileId, final AntivirusStatus status, final String description) {
AntivirusJobResponse antivirusJobResponse = new AntivirusJobResponse(fileId, status, description);
AntivirusJobResponseEventBase antivirusJobResponseEventBase;
switch(fileType) {
case STUDY_FILE:
antivirusJobResponseEventBase = new AntivirusJobStudyFileResponseEvent(this, antivirusJobResponse);
break;
case PAPER_PAPER_FILE:
antivirusJobResponseEventBase = new AntivirusJobPaperPaperFileResponseEvent(this, antivirusJobResponse);
break;
case PAPER_PROTOCOL_FILE:
antivirusJobResponseEventBase = new AntivirusJobPaperProtocolFileResponseEvent(this, antivirusJobResponse);
break;
case ANALYSIS_FILE:
antivirusJobResponseEventBase = new AntivirusJobAnalysisFileResponseEvent(this, antivirusJobResponse);
break;
default:
throw new IllegalArgumentException();
}
eventPublisher.publishEvent(antivirusJobResponseEventBase);
}
Aggregations