@Controller @RequestMapping(value="/plugin/gavin-app") @EnableScheduling public class GavinController extends AbstractStaticContentController
| Modifier and Type | Field and Description |
|---|---|
static String |
GAVIN_APP |
static String |
GZ |
static String |
TSV |
static String |
TSV_GZ |
PLUGIN_URI_PREFIX| Constructor and Description |
|---|
GavinController(ExecutorService executorService,
GavinJobFactory gavinJobFactory,
GavinJobExecutionFactory gavinJobExecutionFactory,
FileStore fileStore,
UserAccountService userAccountService,
MenuReaderService menuReaderService,
IdGenerator idGenerator) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<String> |
annotateFile(org.springframework.web.multipart.MultipartFile inputFile,
String entityName)
Starts a job to annotate a VCF file
|
void |
cleanUp()
Removes old files in the gavin working directory from the file store.
|
org.springframework.core.io.FileSystemResource |
download(javax.servlet.http.HttpServletResponse response,
String jobIdentifier)
Downloads the result of a gavin annotation job.
|
org.springframework.core.io.Resource |
downloadErrorReport(javax.servlet.http.HttpServletResponse response,
String jobIdentifier)
Downloads the error report of a gavin annotation job.
|
GavinJobExecution |
getGavinJobExecution(String jobIdentifier)
Retrieves
GavinJobExecution job. |
void |
handleFileNotFound(FileNotFoundException ex,
javax.servlet.http.HttpServletResponse res) |
void |
handleJobNotFound(JobNotFoundException ex,
javax.servlet.http.HttpServletResponse res) |
ErrorMessageResponse |
handleRuntimeException(RuntimeException e) |
String |
init(org.springframework.ui.Model model)
Shows the gavin page.
|
String |
result(String jobIdentifier,
org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request)
Shows result page for a job.
|
initEditView, submitContentgetId, getPluginSettings, getUripublic static final String GAVIN_APP
public static final String TSV_GZ
public static final String TSV
public static final String GZ
@Autowired
public GavinController(@Qualifier(value="gavinExecutors")
ExecutorService executorService,
GavinJobFactory gavinJobFactory,
GavinJobExecutionFactory gavinJobExecutionFactory,
FileStore fileStore,
UserAccountService userAccountService,
MenuReaderService menuReaderService,
IdGenerator idGenerator)
@RequestMapping(method=GET) public String init(org.springframework.ui.Model model)
init in class AbstractStaticContentController@RequestMapping(value="/annotate-file",
method=POST)
public org.springframework.http.ResponseEntity<String> annotateFile(@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile inputFile,
@RequestParam
String entityName)
throws IOException
inputFile - the uploaded input fileentityName - the name of the fileGavinJobExecutionIOException - if interaction with the file store fails@RequestMapping(value="/job/{jobIdentifier}",
method=GET,
produces="application/json")
@ResponseBody
public GavinJobExecution getGavinJobExecution(@PathVariable(value="jobIdentifier")
String jobIdentifier)
throws JobNotFoundException
GavinJobExecution job.
May be called by anyone who has the identifier.jobIdentifier - identifier of the annotation jobJobNotFoundException@RequestMapping(value="/result/{jobIdentifier}",
method=GET)
public String result(@PathVariable(value="jobIdentifier")
String jobIdentifier,
org.springframework.ui.Model model,
javax.servlet.http.HttpServletRequest request)
throws JobNotFoundException
jobIdentifier - identifier of the annotation jobFileSystemResource with the annotated fileJobNotFoundException@RequestMapping(value="/download/{jobIdentifier}",
method=GET,
produces="application/octet-stream")
@ResponseBody
public org.springframework.core.io.FileSystemResource download(javax.servlet.http.HttpServletResponse response,
@PathVariable(value="jobIdentifier")
String jobIdentifier)
throws FileNotFoundException,
JobNotFoundException
response - HttpServletResponse to write the Content-Disposition header to with the filenamejobIdentifier - GAVIN_APP of the annotation jobFileSystemResource with the annotated fileFileNotFoundExceptionJobNotFoundException@RequestMapping(value="/error/{jobIdentifier}",
method=GET,
produces="application/octet-stream")
@ResponseBody
public org.springframework.core.io.Resource downloadErrorReport(javax.servlet.http.HttpServletResponse response,
@PathVariable(value="jobIdentifier")
String jobIdentifier)
throws FileNotFoundException,
JobNotFoundException
response - HttpServletResponse to write the Content-Disposition header to with the filenamejobIdentifier - GAVIN_APP of the annotation jobFileSystemResource with the annotated fileFileNotFoundExceptionJobNotFoundException@ExceptionHandler(value=java.io.FileNotFoundException.class) public void handleFileNotFound(FileNotFoundException ex, javax.servlet.http.HttpServletResponse res) throws IOException
IOException@ExceptionHandler(value=JobNotFoundException.class) public void handleJobNotFound(JobNotFoundException ex, javax.servlet.http.HttpServletResponse res) throws IOException
IOException@ExceptionHandler(value=java.lang.RuntimeException.class) @ResponseBody @ResponseStatus(value=BAD_REQUEST) public ErrorMessageResponse handleRuntimeException(RuntimeException e)
@Scheduled(cron="0 0 * * * *") public void cleanUp()
Copyright © 2017. All Rights Reserved.