use of org.icgc.dcc.song.core.exceptions.ServerErrors.UNPUBLISHED_FILE_IDS in project SONG by overture-stack.
the class AnalysisService method publish.
public ResponseEntity<String> publish(@NonNull String accessToken, @NonNull String id) {
val files = readFiles(id);
val missingFileIds = files.stream().filter(f -> !confirmUploaded(accessToken, f.getObjectId())).collect(toImmutableList());
val isMissingFiles = missingFileIds.size() > 0;
checkServer(!isMissingFiles, getClass(), UNPUBLISHED_FILE_IDS, "The following file ids must be published before analysisId %s can be published: %s", id, COMMA.join(missingFileIds));
checkedUpdateState(id, PUBLISHED);
sender.send(String.format("{\"analysis_id\": %s, \"state\": \"PUBLISHED\"}", id));
return ok("AnalysisId %s successfully published", id);
}
Aggregations