Class AnalysisSubmissionServiceImpl
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl<java.lang.Long,AnalysisSubmission>
-
- ca.corefacility.bioinformatics.irida.service.impl.analysis.submission.AnalysisSubmissionServiceImpl
-
- All Implemented Interfaces:
AnalysisSubmissionService
,CRUDService<java.lang.Long,AnalysisSubmission>
@Service public class AnalysisSubmissionServiceImpl extends CRUDServiceImpl<java.lang.Long,AnalysisSubmission> implements AnalysisSubmissionService
Implementation of an AnalysisSubmissionService.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ca.corefacility.bioinformatics.irida.service.AnalysisSubmissionService
AnalysisSubmissionService.AnalysisServiceStatus
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<AnalysisState,java.lang.Float>
STATE_PERCENTAGE
AMap
defining the progress transitions points for each state in anAnalysisSubmission
.-
Fields inherited from class ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl
CREATED_DATE_SORT_PROPERTY, repository, validator, valueType
-
-
Constructor Summary
Constructors Constructor Description AnalysisSubmissionServiceImpl(AnalysisSubmissionRepository analysisSubmissionRepository, AnalysisSubmissionTemplateRepository analysisTemplateRepository, UserRepository userRepository, ReferenceFileRepository referenceFileRepository, SequencingObjectService sequencingObjectService, GalaxyHistoriesService galaxyHistoriesService, ProjectAnalysisSubmissionJoinRepository pasRepository, JobErrorRepository jobErrorRepository, IridaWorkflowsService iridaWorkflowsService, javax.validation.Validator validator)
Builds a new AnalysisSubmissionServiceImpl with the given information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
count()
How many entities ofType
exist in the database?AnalysisSubmission
create(AnalysisSubmission analysisSubmission)
Create a new object in the persistence store.AnalysisSubmission
createMultipleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String newAnalysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
java.util.Collection<AnalysisSubmission>
createSingleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
AnalysisSubmissionTemplate
createSingleSampleSubmissionTemplate(IridaWorkflow workflow, java.lang.Long referenceFileId, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String submissionName, java.lang.String statusMessage, java.lang.String analysisDescription, Project projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
Create a newAnalysisSubmissionTemplate
for a project with the given settingsvoid
delete(java.lang.Long id)
Delete the object with the specified identifier from the database.void
deleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Delete anAnalysisSubmissionTemplate
from the givenProject
void
deleteMultiple(java.util.Collection<java.lang.Long> ids)
Delete multipleAnalysisSubmission
sjava.lang.Boolean
exists(java.lang.Long id)
Check to see if an identifier forType
exists in the database.java.lang.Iterable<AnalysisSubmission>
findAll()
List all objects ofType
in the database.java.util.Collection<AnalysisSubmission>
findAnalysesByState(java.util.Collection<AnalysisState> states)
Get a list of allAnalysisSubmission
s with a givenAnalysisState
org.springframework.data.history.Revisions<java.lang.Integer,AnalysisSubmission>
findRevisions(java.lang.Long id)
Find all of the revisions for the specified identifier.org.springframework.data.domain.Page<org.springframework.data.history.Revision<java.lang.Integer,AnalysisSubmission>>
findRevisions(java.lang.Long id, org.springframework.data.domain.Pageable pageable)
Returns aPage
of revisions for the entity with the given id.java.util.List<ProjectSampleAnalysisOutputInfo>
getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)
Get allProjectSampleAnalysisOutputInfo
for aProject
.java.util.List<ProjectSampleAnalysisOutputInfo>
getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)
Get all automatedProjectSampleAnalysisOutputInfo
for aProject
.java.util.List<ProjectSampleAnalysisOutputInfo>
getAllUserAnalysisOutputInfo(User user)
Get allUser
generatedAnalysisOutputFile
infojava.util.List<GenericStatModel>
getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)
Get list ofGenericStatModel
of analyses run in the past n time period grouped by the format provided.java.lang.Long
getAnalysesRanInTimePeriod(java.util.Date createdDate)
Get count of analyses run in the time periodAnalysisSubmissionService.AnalysisServiceStatus
getAnalysisServiceStatus()
Get the status of the analysis service.java.util.List<AnalysisSubmission>
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)
Gets allAnalysisSubmissionService
s accessible by the current user matching one of the workflow ids.java.util.Set<AnalysisSubmission>
getAnalysisSubmissionsForCurrentUser()
java.util.Set<AnalysisSubmission>
getAnalysisSubmissionsForUser(User user)
java.util.Collection<AnalysisSubmission>
getAnalysisSubmissionsSharedToProject(Project project)
Get a collection of allAnalysisSubmission
s shared with aProject
.java.util.List<AnalysisSubmissionTemplate>
getAnalysisTemplatesForProject(Project project)
Get all theAnalysisSubmissionTemplate
s for a givenProject
JobError
getFirstJobError(java.lang.Long id)
Get firstJobError
for aAnalysisSubmission
idjava.util.List<JobError>
getJobErrors(java.lang.Long id)
Get theJobError
objects for aAnalysisSubmission
idint
getNumberAnalysesByUser(User user)
Get count ofAnalysisSubmission
for the user grouped by the format provided.float
getPercentCompleteForAnalysisSubmission(java.lang.Long id)
Given the id of anAnalysisSubmission
gets the percentage complete.AnalysisState
getStateForAnalysisSubmission(java.lang.Long analysisSubmissionId)
Given an analysis submission id, gets the state of this analysis.org.springframework.data.domain.Page<AnalysisSubmission>
list(int page, int size, org.springframework.data.domain.Sort.Direction order)
List objects ofType
in the database, limited to some specific page, ordered by calling thecompareTo
method on the class.org.springframework.data.domain.Page<AnalysisSubmission>
list(int page, int size, org.springframework.data.domain.Sort.Direction order, java.lang.String... sortProperties)
List objects ofType
in the database, limited to some specific page.org.springframework.data.domain.Page<AnalysisSubmission>
listAllSubmissions(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page of allAnalysisSubmission
s in the systemorg.springframework.data.domain.Page<AnalysisSubmission>
listSubmissionsForProject(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, Project project, org.springframework.data.domain.PageRequest pageRequest)
Get a page of theAnalysisSubmission
s shared with a project.org.springframework.data.domain.Page<AnalysisSubmission>
listSubmissionsForUser(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, User user, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page ofAnalysisSubmission
s the given user has submitted.AnalysisSubmission
read(java.lang.Long id)
Read the object type by unique identifier.AnalysisSubmissionTemplate
readAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Get anAnalysisSubmissionTemplate
on the givenProject
java.lang.Iterable<AnalysisSubmission>
readMultiple(java.lang.Iterable<java.lang.Long> idents)
Read multiple objects by the given collection of identifiersvoid
removeAnalysisProjectShare(AnalysisSubmission submission, Project project)
Cancel the share of anAnalysisSubmission
with a givenProject
void
setAnalysisExecutionService(AnalysisExecutionServiceGalaxyCleanupAsync analysisExecutionService)
ProjectAnalysisSubmissionJoin
shareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)
Share anAnalysisSubmission
with a givenProject
AnalysisSubmission
update(AnalysisSubmission object)
Update an objectAnalysisSubmission
updatePriority(AnalysisSubmission submission, AnalysisSubmission.Priority priority)
Update the priority of anAnalysisSubmission
-
Methods inherited from class ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl
list, search, search, updateFields, updateMultiple
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ca.corefacility.bioinformatics.irida.service.CRUDService
list, search, search, updateFields, updateMultiple
-
-
-
-
Field Detail
-
STATE_PERCENTAGE
public static final java.util.Map<AnalysisState,java.lang.Float> STATE_PERCENTAGE
AMap
defining the progress transitions points for each state in anAnalysisSubmission
.
-
-
Constructor Detail
-
AnalysisSubmissionServiceImpl
@Autowired public AnalysisSubmissionServiceImpl(AnalysisSubmissionRepository analysisSubmissionRepository, AnalysisSubmissionTemplateRepository analysisTemplateRepository, UserRepository userRepository, ReferenceFileRepository referenceFileRepository, SequencingObjectService sequencingObjectService, GalaxyHistoriesService galaxyHistoriesService, ProjectAnalysisSubmissionJoinRepository pasRepository, JobErrorRepository jobErrorRepository, IridaWorkflowsService iridaWorkflowsService, javax.validation.Validator validator)
Builds a new AnalysisSubmissionServiceImpl with the given information.- Parameters:
analysisSubmissionRepository
- A repository for accessing analysis submissions.analysisTemplateRepository
- repository forAnalysisSubmissionTemplate
suserRepository
- A repository for accessing user information.referenceFileRepository
- the reference file repositorysequencingObjectService
- theSequencingObject
service.galaxyHistoriesService
- TheGalaxyHistoriesService
.pasRepository
- TheProjectAnalysisSubmissionJoinRepository
jobErrorRepository
- A repository for accessingJobError
iridaWorkflowsService
- TheIridaWorkflowsService
validator
- A validator.
-
-
Method Detail
-
setAnalysisExecutionService
public void setAnalysisExecutionService(AnalysisExecutionServiceGalaxyCleanupAsync analysisExecutionService)
-
listSubmissionsForProject
@PreAuthorize("hasPermission(#project, \'canReadProject\')") public org.springframework.data.domain.Page<AnalysisSubmission> listSubmissionsForProject(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, Project project, org.springframework.data.domain.PageRequest pageRequest)
Get a page of theAnalysisSubmission
s shared with a project.- Specified by:
listSubmissionsForProject
in interfaceAnalysisSubmissionService
- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchworkflowIds
- set of workflow UUIDs to searchproject
-Project
to search inpageRequest
- aPageRequest
for the results to show- Returns:
- a page of
AnalysisSubmission
-
listAllSubmissions
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<AnalysisSubmission> listAllSubmissions(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page of allAnalysisSubmission
s in the system- Specified by:
listAllSubmissions
in interfaceAnalysisSubmissionService
- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchworkflowIds
- set of workflow UUIDs to searchpageRequest
- aPageRequest
for the results to show- Returns:
- a page of
AnalysisSubmission
-
listSubmissionsForUser
@PreAuthorize("hasRole(\'ROLE_USER\')") public org.springframework.data.domain.Page<AnalysisSubmission> listSubmissionsForUser(java.lang.String search, java.lang.String name, java.util.Set<AnalysisState> states, User user, java.util.Set<java.util.UUID> workflowIds, org.springframework.data.domain.PageRequest pageRequest)
Get a page ofAnalysisSubmission
s the given user has submitted.- Specified by:
listSubmissionsForUser
in interfaceAnalysisSubmissionService
- Parameters:
search
- basic search stringname
- analysis submission namestates
- Set ofAnalysisState
of the submission to searchuser
- theUser
to get submissions forworkflowIds
- set of workflow UUIDs to searchpageRequest
- aPageRequest
for the restults to show- Returns:
- a page of
AnalysisSubmission
s for the given user
-
getStateForAnalysisSubmission
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#analysisSubmissionId, \'canReadAnalysisSubmission\')") public AnalysisState getStateForAnalysisSubmission(java.lang.Long analysisSubmissionId) throws EntityNotFoundException
Given an analysis submission id, gets the state of this analysis.- Specified by:
getStateForAnalysisSubmission
in interfaceAnalysisSubmissionService
- Parameters:
analysisSubmissionId
- The id of this analysis.- Returns:
- The state of this analysis.
- Throws:
EntityNotFoundException
- If the corresponding analysis cannot be found.
-
read
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public AnalysisSubmission read(java.lang.Long id) throws EntityNotFoundException
Read the object type by unique identifier.- Specified by:
read
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
read
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
id
- The unique identifier for this object.- Returns:
- The object corresponding to the unique identifier.
- Throws:
EntityNotFoundException
- If the identifier does not exist in the database.
-
readMultiple
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#idents, \'canReadAnalysisSubmission\')") public java.lang.Iterable<AnalysisSubmission> readMultiple(java.lang.Iterable<java.lang.Long> idents)
Read multiple objects by the given collection of identifiers- Specified by:
readMultiple
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
readMultiple
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
idents
- The unique identifiers of the objects to read- Returns:
- A collection of the requested objects
-
findAll
@PreAuthorize("hasRole(\'ROLE_USER\')") @PostFilter("hasPermission(filterObject, \'canReadAnalysisSubmission\')") public java.lang.Iterable<AnalysisSubmission> findAll()
List all objects ofType
in the database.- Specified by:
findAll
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
findAll
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Returns:
- All objects of the specified
Type
in the database.
-
exists
@PreAuthorize("hasRole(\'ROLE_USER\')") public java.lang.Boolean exists(java.lang.Long id)
Check to see if an identifier forType
exists in the database.- Specified by:
exists
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
exists
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
id
- The identifier to check for.- Returns:
true
if the identifier exists,false
otherwise.
-
findRevisions
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public org.springframework.data.history.Revisions<java.lang.Integer,AnalysisSubmission> findRevisions(java.lang.Long id)
Find all of the revisions for the specified identifier.- Specified by:
findRevisions
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
findRevisions
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
id
- the identifier to find revisions for.- Returns:
- the collection of revisions for the identifier.
-
findRevisions
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public org.springframework.data.domain.Page<org.springframework.data.history.Revision<java.lang.Integer,AnalysisSubmission>> findRevisions(java.lang.Long id, org.springframework.data.domain.Pageable pageable)
Returns aPage
of revisions for the entity with the given id.- Specified by:
findRevisions
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
findRevisions
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
id
- the identifier to find revisions for.pageable
- the page specification.- Returns:
- the page of revisions for the specified resource.
-
list
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<AnalysisSubmission> list(int page, int size, org.springframework.data.domain.Sort.Direction order, java.lang.String... sortProperties) throws java.lang.IllegalArgumentException
List objects ofType
in the database, limited to some specific page.- Specified by:
list
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
list
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
page
- the specific page to use.size
- the size of the pages used to compute the number of pages.order
- the order of the sort.sortProperties
- the properties used to sort the collection.- Returns:
- the list of users within the specified range.
- Throws:
java.lang.IllegalArgumentException
- If theType
has no public propertysortProperty
.
-
list
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<AnalysisSubmission> list(int page, int size, org.springframework.data.domain.Sort.Direction order)
List objects ofType
in the database, limited to some specific page, ordered by calling thecompareTo
method on the class.- Specified by:
list
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
list
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
page
- the specific page to use.size
- the size of the pages used to compute the number of pages.order
- the order of the sort.- Returns:
- the list of users within the specified range.
-
count
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public long count()
How many entities ofType
exist in the database?- Specified by:
count
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
count
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Returns:
- the number of entities in the database.
-
delete
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canUpdateAnalysisSubmission\')") public void delete(java.lang.Long id) throws EntityNotFoundException
Delete the object with the specified identifier from the database.- Specified by:
delete
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
delete
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
id
- The identifier of the object to delete.- Throws:
EntityNotFoundException
- If no object with the specified identifier exists in the database.
-
deleteMultiple
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#ids, \'canUpdateAnalysisSubmission\')") public void deleteMultiple(java.util.Collection<java.lang.Long> ids)
Delete multipleAnalysisSubmission
s- Specified by:
deleteMultiple
in interfaceAnalysisSubmissionService
- Parameters:
ids
- the collection of IDs to delete
-
update
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#object, \'canUpdateAnalysisSubmission\')") public AnalysisSubmission update(AnalysisSubmission object)
Update an object- Specified by:
update
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
update
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
object
- The object to update- Returns:
- The updated object
-
updatePriority
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public AnalysisSubmission updatePriority(AnalysisSubmission submission, AnalysisSubmission.Priority priority)
Update the priority of anAnalysisSubmission
- Specified by:
updatePriority
in interfaceAnalysisSubmissionService
- Parameters:
submission
- the submission to updatepriority
- the new priority- Returns:
- the updated submission
-
getAllUserAnalysisOutputInfo
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or authentication.name == #user.username") public java.util.List<ProjectSampleAnalysisOutputInfo> getAllUserAnalysisOutputInfo(User user)
Description copied from interface:AnalysisSubmissionService
Get allUser
generatedAnalysisOutputFile
info- Specified by:
getAllUserAnalysisOutputInfo
in interfaceAnalysisSubmissionService
- Parameters:
user
-User
- Returns:
- List of
AnalysisOutputFile
info
-
getAllAnalysisOutputInfoSharedWithProject
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\') or hasPermission(#projectId, \'canReadProject\')") public java.util.List<ProjectSampleAnalysisOutputInfo> getAllAnalysisOutputInfoSharedWithProject(java.lang.Long projectId)
Get allProjectSampleAnalysisOutputInfo
for aProject
.- Specified by:
getAllAnalysisOutputInfoSharedWithProject
in interfaceAnalysisSubmissionService
- Parameters:
projectId
-Project
id- Returns:
- a list of
ProjectSampleAnalysisOutputInfo
-
getAllAutomatedAnalysisOutputInfoForAProject
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\') or hasPermission(#projectId, \'canReadProject\')") public java.util.List<ProjectSampleAnalysisOutputInfo> getAllAutomatedAnalysisOutputInfoForAProject(java.lang.Long projectId)
Get all automatedProjectSampleAnalysisOutputInfo
for aProject
.- Specified by:
getAllAutomatedAnalysisOutputInfoForAProject
in interfaceAnalysisSubmissionService
- Parameters:
projectId
-Project
id- Returns:
- a list of
ProjectSampleAnalysisOutputInfo
-
create
@PreAuthorize("hasRole(\'ROLE_USER\')") public AnalysisSubmission create(AnalysisSubmission analysisSubmission) throws javax.validation.ConstraintViolationException, EntityExistsException
Create a new object in the persistence store.- Specified by:
create
in interfaceCRUDService<java.lang.Long,AnalysisSubmission>
- Overrides:
create
in classCRUDServiceImpl<java.lang.Long,AnalysisSubmission>
- Parameters:
analysisSubmission
- The object to persist.- Returns:
- The object as it was persisted in the database. May modify the identifier of the object when returned.
- Throws:
javax.validation.ConstraintViolationException
- If the object being persisted cannot be validated by validation rules associated with the object.EntityExistsException
- If the object being persisted violates uniqueness constraints in the database.
-
getAnalysisSubmissionsForUser
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or authentication.name == #user.username") public java.util.Set<AnalysisSubmission> getAnalysisSubmissionsForUser(User user)
- Specified by:
getAnalysisSubmissionsForUser
in interfaceAnalysisSubmissionService
- Parameters:
user
- TheUser
to find all submissions for.- Returns:
- A
Set
ofAnalysisSubmission
s for a user.
-
getAnalysisSubmissionsForCurrentUser
@PreAuthorize("hasRole(\'ROLE_USER\')") public java.util.Set<AnalysisSubmission> getAnalysisSubmissionsForCurrentUser()
- Specified by:
getAnalysisSubmissionsForCurrentUser
in interfaceAnalysisSubmissionService
- Returns:
- A
Set
ofAnalysisSubmission
s for the current user.
-
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds
@PreAuthorize("hasRole(\'ROLE_USER\')") @PostFilter("hasPermission(filterObject, \'canReadAnalysisSubmission\')") public java.util.List<AnalysisSubmission> getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds(java.util.Collection<java.util.UUID> workflowIds)
Gets allAnalysisSubmissionService
s accessible by the current user matching one of the workflow ids.- Specified by:
getAnalysisSubmissionsAccessibleByCurrentUserByWorkflowIds
in interfaceAnalysisSubmissionService
- Parameters:
workflowIds
- The workflow ids to match.- Returns:
- A list of
AnalysisSubmission
s matching one of the workflow ids.
-
getAnalysisTemplatesForProject
@PreAuthorize("hasPermission(#project, \'canReadProject\')") public java.util.List<AnalysisSubmissionTemplate> getAnalysisTemplatesForProject(Project project)
Get all theAnalysisSubmissionTemplate
s for a givenProject
- Specified by:
getAnalysisTemplatesForProject
in interfaceAnalysisSubmissionService
- Parameters:
project
- theProject
to get templates for- Returns:
- a list of all
AnalysisSubmissionTemplate
s
-
createSingleSampleSubmissionTemplate
@PreAuthorize("hasPermission(#projectsToShare, \'canManageLocalProjectSettings\')") public AnalysisSubmissionTemplate createSingleSampleSubmissionTemplate(IridaWorkflow workflow, java.lang.Long referenceFileId, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String submissionName, java.lang.String statusMessage, java.lang.String analysisDescription, Project projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
Create a newAnalysisSubmissionTemplate
for a project with the given settings- Specified by:
createSingleSampleSubmissionTemplate
in interfaceAnalysisSubmissionService
- Parameters:
workflow
-IridaWorkflow
that the files will be run onreferenceFileId
-Long
id for aReferenceFile
params
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.submissionName
-String
the name for the analysisstatusMessage
- A status message for the submission templateanalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- TheProject
to save the analysis towriteResultsToSamples
- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted
- Whether or not to email the pipeline results that completed to the useremailPipelineResultError
- Whether or not to email the pipeline results that errored to the user- Returns:
- the newly created
AnalysisSubmissionTemplate
-
readAnalysisSubmissionTemplateForProject
@PreAuthorize("hasPermission(#project, \'canReadProject\')") public AnalysisSubmissionTemplate readAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Get anAnalysisSubmissionTemplate
on the givenProject
- Specified by:
readAnalysisSubmissionTemplateForProject
in interfaceAnalysisSubmissionService
- Parameters:
id
- theAnalysisSubmissionTemplate
idproject
- theProject
to get templates for- Returns:
- the found
AnalysisSubmissionTemplate
-
deleteAnalysisSubmissionTemplateForProject
@PreAuthorize("hasPermission(#project, \'canReadProject\')") public void deleteAnalysisSubmissionTemplateForProject(java.lang.Long id, Project project)
Delete anAnalysisSubmissionTemplate
from the givenProject
- Specified by:
deleteAnalysisSubmissionTemplateForProject
in interfaceAnalysisSubmissionService
- Parameters:
id
- The id of anAnalysisSubmissionTemplate
.project
- theProject
to delete from
-
createSingleSampleSubmission
@PreAuthorize("hasRole(\'ROLE_USER\')") public java.util.Collection<AnalysisSubmission> createSingleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String analysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
- Specified by:
createSingleSampleSubmission
in interfaceAnalysisSubmissionService
- Parameters:
workflow
-IridaWorkflow
that the files will be run onref
-Long
id for aReferenceFile
sequenceFiles
-List
ofSequenceFile
to run on the workflowsequenceFilePairs
-List
ofSequenceFilePair
to run on the workflowparams
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.name
-String
the name for the analysisanalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- A list ofProject
s to share analysis results withwriteResultsToSamples
- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted
- If true, user will be emailed if a pipelines successfully completesemailPipelineResultError
- If true, user will be emailed if a pipeline errors- Returns:
- the
Collection
ofAnalysisSubmission
created for the supplied files.
-
createMultipleSampleSubmission
@PreAuthorize("hasRole(\'ROLE_USER\')") public AnalysisSubmission createMultipleSampleSubmission(IridaWorkflow workflow, java.lang.Long ref, java.util.List<SingleEndSequenceFile> sequenceFiles, java.util.List<SequenceFilePair> sequenceFilePairs, java.util.Map<java.lang.String,java.lang.String> params, IridaWorkflowNamedParameters namedParameters, java.lang.String name, java.lang.String newAnalysisDescription, java.util.List<Project> projectsToShare, boolean writeResultsToSamples, boolean emailPipelineResultCompleted, boolean emailPipelineResultError)
- Specified by:
createMultipleSampleSubmission
in interfaceAnalysisSubmissionService
- Parameters:
workflow
-IridaWorkflow
that the files will be run onref
-Long
id for aReferenceFile
sequenceFiles
-List
ofSequenceFile
to run on the workflowsequenceFilePairs
-List
ofSequenceFilePair
to run on the workflowparams
-Map
of parameters specific for the pipelinenamedParameters
- the named parameters to use for the workflow.name
-String
the name for the analysisnewAnalysisDescription
-String
the description of the analysis being submittedprojectsToShare
- A list ofProject
s to share analysis results withwriteResultsToSamples
- If true, results of this pipeline will be saved back to the samples on successful completion.emailPipelineResultCompleted
- If true, user will be emailed if a pipeline successfully completesemailPipelineResultError
- If true, user will be emailed if a pipeline errors- Returns:
- the
AnalysisSubmission
created for the files.
-
getPercentCompleteForAnalysisSubmission
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public float getPercentCompleteForAnalysisSubmission(java.lang.Long id) throws EntityNotFoundException, ExecutionManagerException, NoPercentageCompleteException
Given the id of anAnalysisSubmission
gets the percentage complete.- Specified by:
getPercentCompleteForAnalysisSubmission
in interfaceAnalysisSubmissionService
- Parameters:
id
- The id of anAnalysisSubmission
.- Returns:
- The percentage complete for this
AnalysisSubmission
. - Throws:
EntityNotFoundException
- If no such corresponding submission exists.NoPercentageCompleteException
- An exception that indicates there is no percentage complete for the submission.ExecutionManagerException
- If there was an issue when contacting the execution manager.
-
getJobErrors
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public java.util.List<JobError> getJobErrors(java.lang.Long id) throws EntityNotFoundException
Get theJobError
objects for aAnalysisSubmission
id- Specified by:
getJobErrors
in interfaceAnalysisSubmissionService
- Parameters:
id
-AnalysisSubmission
id- Returns:
JobError
objects for aAnalysisSubmission
- Throws:
EntityNotFoundException
- If no suchAnalysisSubmission
exists.
-
getFirstJobError
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadAnalysisSubmission\')") public JobError getFirstJobError(java.lang.Long id) throws EntityNotFoundException
Get firstJobError
for aAnalysisSubmission
id- Specified by:
getFirstJobError
in interfaceAnalysisSubmissionService
- Parameters:
id
-AnalysisSubmission
id- Returns:
JobError
object- Throws:
EntityNotFoundException
- If no suchAnalysisSubmission
exists.
-
shareAnalysisSubmissionWithProject
@PreAuthorize("hasPermission(#submission, \'canUpdateAnalysisSubmission\') AND hasPermission(#project, \'canReadProject\')") public ProjectAnalysisSubmissionJoin shareAnalysisSubmissionWithProject(AnalysisSubmission submission, Project project)
Share anAnalysisSubmission
with a givenProject
- Specified by:
shareAnalysisSubmissionWithProject
in interfaceAnalysisSubmissionService
- Parameters:
submission
-AnalysisSubmission
to shareproject
-Project
to share with- Returns:
- a
ProjectAnalysisSubmissionJoin
describing the relationship
-
removeAnalysisProjectShare
@PreAuthorize("hasPermission(#submission, \'canUpdateAnalysisSubmission\') AND hasPermission(#project, \'canReadProject\')") public void removeAnalysisProjectShare(AnalysisSubmission submission, Project project)
Cancel the share of anAnalysisSubmission
with a givenProject
- Specified by:
removeAnalysisProjectShare
in interfaceAnalysisSubmissionService
- Parameters:
submission
- theAnalysisSubmission
to stop sharingproject
- theProject
to stop sharing with
-
findAnalysesByState
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public java.util.Collection<AnalysisSubmission> findAnalysesByState(java.util.Collection<AnalysisState> states)
Get a list of allAnalysisSubmission
s with a givenAnalysisState
- Specified by:
findAnalysesByState
in interfaceAnalysisSubmissionService
- Parameters:
states
- A list ofAnalysisState
to findAnalysisSubmission
s for- Returns:
- a Collection of
AnalysisSubmission
-
getAnalysisSubmissionsSharedToProject
@PreAuthorize("hasPermission(#project, \'canReadProject\')") public java.util.Collection<AnalysisSubmission> getAnalysisSubmissionsSharedToProject(Project project)
Get a collection of allAnalysisSubmission
s shared with aProject
.- Specified by:
getAnalysisSubmissionsSharedToProject
in interfaceAnalysisSubmissionService
- Parameters:
project
- TheProject
to search.- Returns:
- A collection of
AnalysisSubmission
s.
-
getAnalysisServiceStatus
@PreAuthorize("hasRole(\'ROLE_USER\')") public AnalysisSubmissionService.AnalysisServiceStatus getAnalysisServiceStatus()
Get the status of the analysis service. This will be the number of running and queued analyses- Specified by:
getAnalysisServiceStatus
in interfaceAnalysisSubmissionService
- Returns:
- An
AnalysisSubmissionService.AnalysisServiceStatus
object showing the number of running and queued analyses
-
getAnalysesRanInTimePeriod
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public java.lang.Long getAnalysesRanInTimePeriod(java.util.Date createdDate)
Get count of analyses run in the time period- Specified by:
getAnalysesRanInTimePeriod
in interfaceAnalysisSubmissionService
- Parameters:
createdDate
- the minimum date for submissions ran- Returns:
- An
Long
count of analyses ran
-
getAnalysesRanGrouped
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") public java.util.List<GenericStatModel> getAnalysesRanGrouped(java.util.Date createdDate, StatisticTimePeriod statisticTimePeriod)
Get list ofGenericStatModel
of analyses run in the past n time period grouped by the format provided.- Specified by:
getAnalysesRanGrouped
in interfaceAnalysisSubmissionService
- Parameters:
createdDate
- the minimum date for submissions ranstatisticTimePeriod
- the enum containing format for which to group the results by- Returns:
- An
GenericStatModel
list
-
getNumberAnalysesByUser
@PreAuthorize("hasRole(\'ROLE_USER\')") public int getNumberAnalysesByUser(User user)
Get count ofAnalysisSubmission
for the user grouped by the format provided.- Specified by:
getNumberAnalysesByUser
in interfaceAnalysisSubmissionService
- Parameters:
user
- The user identifier- Returns:
- Count of analyses ran by user
-
-