Package com.infoclinika.web.dto.TranslationResult

Examples of com.infoclinika.web.dto.TranslationResult.TranslationError


                "\n Vendor type = " + vendorType + "." +
                "\n Target bucket = " + targetBucket + "." +
                "\n Target folder = " + targetKeyPrefix);

        TranslationResult translationResult = null;
        TranslationError translationError = null;
        try {
            AnalysisBounds bounds = experiment.getBounds();
            final List<Double> lockMasses = experiment.getLockMasses();
            final TranslationRequest request = new TranslationRequest(urls, names, conditions, avoidNullList(lockMasses), experimentWorkflowType, vendorType, targetBucket, targetKeyPrefix,
                    bounds.getMinRt(), bounds.getMaxRt(), bounds.getMinMz(), bounds.getMaxMz());
            translationResult = translationService.translateFiles(request);
            LOG.debug(" * Got result from translation service. Translated IDs = " + translationResult.getTranslatedIds() + ". Error message = " + translationResult.translationError);
            translationError = translationResult.translationError;
        } catch (Exception e) {
            LOG.error(" * Translation failed for the experiment with ID = " + experimentId, e);
            translationError = new TranslationError("Translation failed.");
        }
        experiment.setTranslationError((translationError == null) ? null : translationError.getMessage());

        if (translationResult != null) {
            final List<Long> translatedFileIds = translationResult.translatedIds;
            for (int i = 0; i < filesList.size(); i++) {
                RawFile rawFile = filesList.get(i);
                if (translationError == null) {
                    rawFile.setProcessedDataID(translatedFileIds.get(i).toString());
                }
            }
            rawFilesRepository.save(filesList);
            if (translationError == null) {
                preCacheCharts(translatedFileIds);
                LOG.debug(" *** Pre-caching completed for experiment with ID = " + experimentId);
            }
        }
        experimentRepository.save(experiment);
       
        if (translationResult!= null && translationError != null) {
            final String fileName = translationError.getFileName();
            final FileMetaData fileWithTranslationError = getFileMetaDataWithTranslationError(filesList, fileName);
            notifier.translationErrorOccured(experiment.getId(), (fileWithTranslationError == null) ? null : fileWithTranslationError.getId());
        }
        LOG.debug(" *** Translation finished for experiment with ID = " + experimentId);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.web.dto.TranslationResult.TranslationError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.