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);
}