Package com.infoclinika.mssharing.model.internal.entity.search

Examples of com.infoclinika.mssharing.model.internal.entity.search.ExperimentSearch


                lockMasses);
    }

    @Override
    public ExperimentSearchItem readExperimentSearch(long actor, long experimentSearchId) {
        final ExperimentSearch search = experimentSearchRepository.findOne(experimentSearchId);
        if(search == null) throw new ObjectNotFoundException("Experiment search is not found");

        if(!ruleValidator.isUserCanReadExperimentSearch(actor, experimentSearchId)) throw new AccessDenied("Can't read experiment search");
        final ExperimentSearchParamsItem params = getExperimentSearchItemsParams(search);
        final List<RawFile> rawFiles = experimentSearchRepository.findRawFilesByExperimentSearch(experimentSearchId);
        final List<Long> filesId = transform(rawFiles, new Function<RawFile, Long>() {
            @Override
            public Long apply(RawFile rawFile) {
                return rawFile.fileMetaData.getId();
            }
        });
        return new ExperimentSearchItem(search.getData().getName(), search.getData().getDescription(), search.getId(), filesId, params);
    }
View Full Code Here


        return builder.build();
    }

    @Override
    public FileReference readExperimentSearchExport(long actor, long experimentSearchId, long fileId, ExportType exportType) {
        final ExperimentSearch search = experimentSearchRepository.findOne(experimentSearchId);
        if (!ruleValidator.isUserCanReadExperimentSearch(actor, experimentSearchId)){
            throw new AccessDenied("User doesn't have access to read experiment search");
        }
        for (SearchRun searchRun : search.getRuns()){
            if (searchRun.getFile().getFileMetaData().getId().equals(fileId)){
                switch (exportType){
                    case MS2:
                        final com.infoclinika.mssharing.model.internal.entity.FileReference ms2Ref = searchRun.getSearchRunResult().getMs2FileRef();
                        return new FileReference(ms2Ref.getBucket(), ms2Ref.getKey());
View Full Code Here

        return experiment.getCreator().getId().equals(actor);
    }

    @Override
    public boolean canRemoveExperimentSearch(long actor, long experimentRunId) {
        final ExperimentSearch run = checkPresence(experimentSearchRepository.findOne(experimentRunId));
        return run.getData().getExperiment().getCreator().getId().equals(actor);
    }
View Full Code Here

    }

    @Override
    public boolean isUserCanReadExperimentSearch(long actor, long experimentRunId) {
        final User user = checkPresence(userRepository.findOne(actor));
        final ExperimentSearch experimentRun = checkPresence(experimentSearchRepository.findOne(experimentRunId));
        return experimentRun.getData().getExperiment().getCreator().equals(user);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.model.internal.entity.search.ExperimentSearch

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.