Search in sources :

Example 6 with ValidationException

use of com.odysseusinc.arachne.portal.exception.ValidationException in project ArachneCentralAPI by OHDSI.

the class BaseAchillesController method receiveStats.

@ApiOperation("Store Achilles results for given datasource")
@RequestMapping(value = "datanode/datasource/{id}", method = RequestMethod.POST)
public void receiveStats(@PathVariable("id") Long datasourceId, @RequestParam(value = "file") MultipartFile data) throws NotExistException, IOException, ValidationException {
    DS dataSource = checkDataSource(datasourceId);
    final DataNode dataNode = dataSource.getDataNode();
    if (dataNode.getVirtual()) {
        throw new ValidationException("virtual datasource is not allowed for manual uploading");
    }
    LOGGER.info(ACHILLES_RESULT_LOADED_LOG, dataSource.getId(), dataSource.getName(), dataNode.getId(), dataNode.getName());
    achillesService.createCharacterization(dataSource, data);
}
Also used : ValidationException(com.odysseusinc.arachne.portal.exception.ValidationException) DataNode(com.odysseusinc.arachne.portal.model.DataNode) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ValidationException (com.odysseusinc.arachne.portal.exception.ValidationException)6 NotExistException (com.odysseusinc.arachne.portal.exception.NotExistException)4 ApiOperation (io.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)3 ResultFile (com.odysseusinc.arachne.portal.model.ResultFile)3 ArachneFileMeta (com.odysseusinc.arachne.storage.model.ArachneFileMeta)2 Date (java.util.Date)2 CommonAnalysisExecutionStatusDTO (com.odysseusinc.arachne.commons.api.v1.dto.CommonAnalysisExecutionStatusDTO)1 NO_ERROR (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult.ErrorCode.NO_ERROR)1 BaseController (com.odysseusinc.arachne.portal.api.v1.controller.BaseController)1 ApproveDTO (com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO)1 BaseSubmissionAndAnalysisTypeDTO (com.odysseusinc.arachne.portal.api.v1.dto.BaseSubmissionAndAnalysisTypeDTO)1 BaseSubmissionDTO (com.odysseusinc.arachne.portal.api.v1.dto.BaseSubmissionDTO)1 CreateSubmissionsDTO (com.odysseusinc.arachne.portal.api.v1.dto.CreateSubmissionsDTO)1 FileDTO (com.odysseusinc.arachne.portal.api.v1.dto.FileDTO)1 ResultFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.ResultFileDTO)1 SubmissionDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionDTO)1 SubmissionFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO)1 SubmissionStatusHistoryElementDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusHistoryElementDTO)1