Class RESTAnalysisSubmissionController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.web.controller.api.RESTGenericController<AnalysisSubmission>
-
- ca.corefacility.bioinformatics.irida.web.controller.api.RESTAnalysisSubmissionController
-
@Controller @RequestMapping("/api/analysisSubmissions") public class RESTAnalysisSubmissionController extends RESTGenericController<AnalysisSubmission>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANALYSIS_REL
static java.util.Map<java.lang.String,AnalysisType>
ANALYSIS_TYPES
static java.lang.String
FILE_REL
static java.lang.String
INPUT_FILES_PAIRED_REL
static java.lang.String
INPUT_FILES_UNPAIRED_REL
static java.lang.String
SUBMISSIONS_REL
-
Fields inherited from class ca.corefacility.bioinformatics.irida.web.controller.api.RESTGenericController
crudService, REL_COLLECTION, REL_RELATIONSHIP, RELATED_RESOURCES_NAME, RESOURCE_NAME
-
-
Constructor Summary
Constructors Constructor Description RESTAnalysisSubmissionController(AnalysisSubmissionService analysisSubmissionService, SampleService sampleService, SequencingObjectService sequencingObjectService, IridaWorkflowsService iridaWorkflowsService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<org.springframework.hateoas.Link>
constructCollectionResourceLinks(ResourceCollection<AnalysisSubmission> list)
Get custom links to the ResourceCollection being called byRESTGenericController.listAllResources()
.protected java.util.Collection<org.springframework.hateoas.Link>
constructCustomResourceLinks(AnalysisSubmission resource)
Construct a collection ofLink
s for a specific resource.ResponseResource<AnalysisSubmission>
create(AnalysisSubmission resource, javax.servlet.http.HttpServletResponse response)
Create a new instance ofType
in the database, then respond to the client with the location of the resource.ResponseResource<RootResource>
delete(java.lang.Long identifier)
Delete the instance of the resource identified by a specific identifier.ResponseResource<Analysis>
getAnalysisForSubmission(java.lang.Long identifier)
Get theAnalysis
for anAnalysisSubmission
.ResponseResource<ResourceCollection<SequenceFilePair>>
getAnalysisInputFilePairs(java.lang.Long identifier)
Get theSequenceFilePair
s used for theAnalysisSubmission
ResponseResource<ResourceCollection<SequencingObject>>
getAnalysisInputUnpairedFiles(java.lang.Long identifier)
ResponseResource<AnalysisOutputFile>
getAnalysisOutputFile(java.lang.Long submissionId, java.lang.Long fileId)
Get an analysis output file for a given submissionorg.springframework.core.io.FileSystemResource
getAnalysisOutputFileContents(java.lang.Long submissionId, java.lang.Long fileId)
Get the actual file contents for an analysis output file.ResponseResource<AnalysisSubmission>
getResource(java.lang.Long identifier)
Retrieve and serialize an individual instance of a resource by identifier.ResponseResource<ResourceCollection<AnalysisSubmission>>
listAllResources()
Get all resources in the application.ResponseResource<ResourceCollection<AnalysisSubmission>>
listOfType(java.lang.String type)
Get all analyses of a given typeResponseResource<RootResource>
update(java.lang.Long identifier, java.util.Map<java.lang.String,java.lang.Object> representation)
Update some of the fields of an individual resource in the database.
-
-
-
Field Detail
-
ANALYSIS_REL
public static final java.lang.String ANALYSIS_REL
- See Also:
- Constant Field Values
-
FILE_REL
public static final java.lang.String FILE_REL
- See Also:
- Constant Field Values
-
SUBMISSIONS_REL
public static final java.lang.String SUBMISSIONS_REL
- See Also:
- Constant Field Values
-
INPUT_FILES_UNPAIRED_REL
public static final java.lang.String INPUT_FILES_UNPAIRED_REL
- See Also:
- Constant Field Values
-
INPUT_FILES_PAIRED_REL
public static final java.lang.String INPUT_FILES_PAIRED_REL
- See Also:
- Constant Field Values
-
ANALYSIS_TYPES
public static java.util.Map<java.lang.String,AnalysisType> ANALYSIS_TYPES
-
-
Constructor Detail
-
RESTAnalysisSubmissionController
@Autowired public RESTAnalysisSubmissionController(AnalysisSubmissionService analysisSubmissionService, SampleService sampleService, SequencingObjectService sequencingObjectService, IridaWorkflowsService iridaWorkflowsService)
-
-
Method Detail
-
listAllResources
public ResponseResource<ResourceCollection<AnalysisSubmission>> listAllResources()
Get all resources in the application.- Overrides:
listAllResources
in classRESTGenericController<AnalysisSubmission>
- Returns:
- a model containing all resources of the specified type in the application.
-
getResource
public ResponseResource<AnalysisSubmission> getResource(@PathVariable java.lang.Long identifier)
Retrieve and serialize an individual instance of a resource by identifier.- Overrides:
getResource
in classRESTGenericController<AnalysisSubmission>
- Parameters:
identifier
- the identifier of the resource to retrieve from the database.- Returns:
- the model and view for the individual resource.
-
create
public ResponseResource<AnalysisSubmission> create(@RequestBody AnalysisSubmission resource, javax.servlet.http.HttpServletResponse response)
Create a new instance ofType
in the database, then respond to the client with the location of the resource.- Overrides:
create
in classRESTGenericController<AnalysisSubmission>
- Parameters:
resource
- theType
that we should de-serialize to get an instance ofType
to persist.response
- a reference to the servlet response.- Returns:
- a response containing the location of the newly persisted resource.
-
delete
public ResponseResource<RootResource> delete(@PathVariable java.lang.Long identifier)
Delete the instance of the resource identified by a specific identifier.- Overrides:
delete
in classRESTGenericController<AnalysisSubmission>
- Parameters:
identifier
- the identifier that should be deleted from the database.- Returns:
- a response indicating that the resource was deleted.
-
update
public ResponseResource<RootResource> update(@PathVariable java.lang.Long identifier, @RequestBody java.util.Map<java.lang.String,java.lang.Object> representation)
Update some of the fields of an individual resource in the database. The client should only send the key-value pairs for the properties that are to be updated in the database.- Overrides:
update
in classRESTGenericController<AnalysisSubmission>
- Parameters:
identifier
- the identifier of the resource to be updated.representation
- the properties to be updated and their new values.- Returns:
- a response indicating that the resource was updated.
-
listOfType
@RequestMapping(value="/analysisType/{type}", method=GET) public ResponseResource<ResourceCollection<AnalysisSubmission>> listOfType(@PathVariable java.lang.String type)
Get all analyses of a given type- Parameters:
type
- The type to request- Returns:
- A list of
AnalysisSubmission
s
-
constructCollectionResourceLinks
protected java.util.Collection<org.springframework.hateoas.Link> constructCollectionResourceLinks(ResourceCollection<AnalysisSubmission> list)
Get custom links to the ResourceCollection being called byRESTGenericController.listAllResources()
. This method can be overridden by extending classes to add links to the returned list.- Overrides:
constructCollectionResourceLinks
in classRESTGenericController<AnalysisSubmission>
- Parameters:
list
-ResourceCollection
to add links to- Returns:
- Collection of links to add to the
ResourceCollection
-
getAnalysisInputFilePairs
@RequestMapping(value="/{identifier}/sequenceFiles/pairs", method=GET) public ResponseResource<ResourceCollection<SequenceFilePair>> getAnalysisInputFilePairs(@PathVariable java.lang.Long identifier)
Get theSequenceFilePair
s used for theAnalysisSubmission
- Parameters:
identifier
-AnalysisSubmission
id- Returns:
- list of
SequenceFilePair
s
-
getAnalysisInputUnpairedFiles
@RequestMapping(value="/{identifier}/sequenceFiles/unpaired", method=GET) public ResponseResource<ResourceCollection<SequencingObject>> getAnalysisInputUnpairedFiles(@PathVariable java.lang.Long identifier)
- Parameters:
identifier
- theAnalysisSubmission
id- Returns:
- list of
SequenceFile
s
-
getAnalysisForSubmission
@RequestMapping(value="/{identifier}/analysis", method=GET) public ResponseResource<Analysis> getAnalysisForSubmission(@PathVariable java.lang.Long identifier)
Get theAnalysis
for anAnalysisSubmission
.- Parameters:
identifier
-AnalysisSubmission
identifier to read- Returns:
- An
Analysis
-
getAnalysisOutputFile
@RequestMapping(value="/{submissionId}/analysis/file/{fileId}", method=GET) public ResponseResource<AnalysisOutputFile> getAnalysisOutputFile(@PathVariable java.lang.Long submissionId, @PathVariable java.lang.Long fileId)
Get an analysis output file for a given submission- Parameters:
submissionId
- TheAnalysisSubmission
idfileId
- TheAnalysisOutputFile
id- Returns:
- An
AnalysisOutputFile
-
getAnalysisOutputFileContents
@RequestMapping(value="/{submissionId}/analysis/file/{fileId}", produces="text/plain") @ResponseBody public org.springframework.core.io.FileSystemResource getAnalysisOutputFileContents(@PathVariable java.lang.Long submissionId, @PathVariable java.lang.Long fileId)
Get the actual file contents for an analysis output file.- Parameters:
submissionId
- TheAnalysisSubmission
idfileId
- TheAnalysisOutputFile
id- Returns:
- a
FileSystemResource
containing the contents of theAnalysisOutputFile
.
-
constructCustomResourceLinks
protected java.util.Collection<org.springframework.hateoas.Link> constructCustomResourceLinks(AnalysisSubmission resource)
Construct a collection ofLink
s for a specific resource. Each resource may have custom links that refer to other controllers, but not all will. This method is called by thegetResource
method. add analysis rel if available- Overrides:
constructCustomResourceLinks
in classRESTGenericController<AnalysisSubmission>
- Parameters:
resource
- the resource to generate the links for.- Returns:
- a collection of links.
-
-