Class SequencingRunServiceImpl
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl<java.lang.Long,SequencingRun>
-
- ca.corefacility.bioinformatics.irida.service.impl.SequencingRunServiceImpl
-
- All Implemented Interfaces:
CRUDService<java.lang.Long,SequencingRun>
,SequencingRunService
@Service public class SequencingRunServiceImpl extends CRUDServiceImpl<java.lang.Long,SequencingRun> implements SequencingRunService
-
-
Field Summary
-
Fields inherited from class ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl
CREATED_DATE_SORT_PROPERTY, repository, validator, valueType
-
-
Constructor Summary
Constructors Constructor Description SequencingRunServiceImpl(SequencingRunRepository repository, SequenceFileRepository sequenceFileRepository, SequencingObjectRepository objectRepository, SampleSequencingObjectJoinRepository ssoRepository, SampleRepository sampleRepository, AnalysisSubmissionRepository submissionRepository, UserRepository userRepository, javax.validation.Validator validator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSequencingObjectToSequencingRun(SequencingRun run, SequencingObject seqobject)
Create a join between aSequencingObject
to aSequencingRun
SequencingRun
create(SequencingRun o)
Create a new object in the persistence store.void
delete(java.lang.Long id)
Delete the object with the specified identifier from the database.java.lang.Iterable<SequencingRun>
findAll()
List all objects ofType
in the database.org.springframework.data.domain.Page<SequencingRun>
list(int page, int size, org.springframework.data.domain.Sort sort)
List objects ofType
in the database, limited to some specific pageorg.springframework.data.domain.Page<SequencingRun>
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.SequencingRun
read(java.lang.Long id)
Read the object type by unique identifier.SequencingRun
update(SequencingRun object)
Update an objectSequencingRun
updateFields(java.lang.Long id, java.util.Map<java.lang.String,java.lang.Object> updatedFields)
Update properties of the given object by given fields.-
Methods inherited from class ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl
count, exists, findRevisions, findRevisions, list, readMultiple, search, search, 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
count, exists, findRevisions, findRevisions, list, readMultiple, search, search, updateMultiple
-
-
-
-
Constructor Detail
-
SequencingRunServiceImpl
@Autowired public SequencingRunServiceImpl(SequencingRunRepository repository, SequenceFileRepository sequenceFileRepository, SequencingObjectRepository objectRepository, SampleSequencingObjectJoinRepository ssoRepository, SampleRepository sampleRepository, AnalysisSubmissionRepository submissionRepository, UserRepository userRepository, javax.validation.Validator validator)
-
-
Method Detail
-
read
@Transactional(readOnly=true) @PreAuthorize("hasAnyRole(\'ROLE_SEQUENCER\', \'ROLE_USER\', \'ROLE_TECHNICIAN\')") public SequencingRun read(java.lang.Long id)
Read the object type by unique identifier.- Specified by:
read
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
read
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
id
- The unique identifier for this object.- Returns:
- The object corresponding to the unique identifier.
-
findAll
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\', \'ROLE_SEQUENCER\', \'ROLE_USER\', \'ROLE_TECHNICIAN\')") @PostFilter("hasPermission(filterObject, \'canReadSequencingRun\')") public java.lang.Iterable<SequencingRun> findAll()
List all objects ofType
in the database.- Specified by:
findAll
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
findAll
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Returns:
- All objects of the specified
Type
in the database.
-
addSequencingObjectToSequencingRun
@Transactional @PreAuthorize("hasAnyRole(\'ROLE_SEQUENCER\',\'ROLE_ADMIN\')") public void addSequencingObjectToSequencingRun(SequencingRun run, SequencingObject seqobject)
Create a join between aSequencingObject
to aSequencingRun
- Specified by:
addSequencingObjectToSequencingRun
in interfaceSequencingRunService
- Parameters:
run
- TheSequencingRun
seqobject
- TheSequencingObject
-
create
@PreAuthorize("hasAnyRole(\'ROLE_SEQUENCER\',\'ROLE_ADMIN\', \'ROLE_USER\')") public SequencingRun create(SequencingRun o)
Description copied from class:CRUDServiceImpl
Create a new object in the persistence store.- Specified by:
create
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
create
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
o
- The object to persist.- Returns:
- The object as it was persisted in the database. May modify the identifier of the object when returned.
-
delete
@Transactional @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public void delete(java.lang.Long id)
Delete the object with the specified identifier from the database.- Specified by:
delete
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
delete
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
id
- The identifier of the object to delete.
-
updateFields
@PreAuthorize("hasAnyRole(\'ROLE_SEQUENCER\',\'ROLE_ADMIN\') or hasPermission(#id, \'canUpdateSequencingRun\')") public SequencingRun updateFields(java.lang.Long id, java.util.Map<java.lang.String,java.lang.Object> updatedFields) throws javax.validation.ConstraintViolationException, EntityExistsException, InvalidPropertyException
Update properties of the given object by given fields. The object must have a valid identifier prior to being passed to this method.- Specified by:
updateFields
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
updateFields
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
id
- The identifier of the object to update.updatedFields
- the object properties that should be updated.- 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.InvalidPropertyException
- If the updated properties map contains a property name that does not exist on the domain model.
-
update
@PreAuthorize("hasAnyRole(\'ROLE_SEQUENCER\',\'ROLE_ADMIN\') or hasPermission(#object, \'canUpdateSequencingRun\')") public SequencingRun update(SequencingRun object)
Update an object- Specified by:
update
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
update
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
object
- The object to update- Returns:
- The updated object
-
list
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\', \'ROLE_SEQUENCER\', \'ROLE_TECHNICIAN\')") public org.springframework.data.domain.Page<SequencingRun> 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,SequencingRun>
- Overrides:
list
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- 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("hasAnyRole(\'ROLE_ADMIN\', \'ROLE_SEQUENCER\', \'ROLE_TECHNICIAN\')") public org.springframework.data.domain.Page<SequencingRun> list(int page, int size, org.springframework.data.domain.Sort sort) throws java.lang.IllegalArgumentException
List objects ofType
in the database, limited to some specific page- Specified by:
list
in interfaceCRUDService<java.lang.Long,SequencingRun>
- Overrides:
list
in classCRUDServiceImpl<java.lang.Long,SequencingRun>
- Parameters:
page
- the specific page to usesize
- the size of the pagessort
- ASort
object for ordering the results- Returns:
- a list of objects in the given range
- Throws:
java.lang.IllegalArgumentException
-
-