Class ReferenceFileServiceImpl
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl<java.lang.Long,ReferenceFile>
-
- ca.corefacility.bioinformatics.irida.service.impl.ReferenceFileServiceImpl
-
- All Implemented Interfaces:
CRUDService<java.lang.Long,ReferenceFile>
,ReferenceFileService
@Service public class ReferenceFileServiceImpl extends CRUDServiceImpl<java.lang.Long,ReferenceFile> implements ReferenceFileService
Service for storing and readingReferenceFile
objects
-
-
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 ReferenceFileServiceImpl(ReferenceFileRepository repository, ProjectReferenceFileJoinRepository prfjRepository, javax.validation.Validator validator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReferenceFile
create(ReferenceFile object)
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.util.List<Join<Project,ReferenceFile>>
getReferenceFilesForProject(Project project)
Get the collection ofReferenceFile
attached to the specifiedProject
.ReferenceFile
read(java.lang.Long id)
Read the object type by unique identifier.-
Methods inherited from class ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl
count, exists, findAll, findRevisions, findRevisions, list, list, list, readMultiple, search, search, update, 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
count, exists, findAll, findRevisions, findRevisions, list, list, list, readMultiple, search, search, update, updateFields, updateMultiple
-
-
-
-
Constructor Detail
-
ReferenceFileServiceImpl
@Autowired public ReferenceFileServiceImpl(ReferenceFileRepository repository, ProjectReferenceFileJoinRepository prfjRepository, javax.validation.Validator validator)
-
-
Method Detail
-
read
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canReadReferenceFile\')") public ReferenceFile read(java.lang.Long id) throws EntityNotFoundException
Read the object type by unique identifier.- Specified by:
read
in interfaceCRUDService<java.lang.Long,ReferenceFile>
- Overrides:
read
in classCRUDServiceImpl<java.lang.Long,ReferenceFile>
- 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.
-
getReferenceFilesForProject
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#project, \'canReadProject\')") public java.util.List<Join<Project,ReferenceFile>> getReferenceFilesForProject(Project project)
Get the collection ofReferenceFile
attached to the specifiedProject
.- Specified by:
getReferenceFilesForProject
in interfaceReferenceFileService
- Parameters:
project
- theProject
to getReferenceFile
s for.- Returns:
- the collection of
ReferenceFile
attached to theProject
.
-
create
@PreAuthorize("hasRole(\'ROLE_USER\')") public ReferenceFile create(ReferenceFile object) throws javax.validation.ConstraintViolationException, EntityExistsException
Create a new object in the persistence store.- Specified by:
create
in interfaceCRUDService<java.lang.Long,ReferenceFile>
- Overrides:
create
in classCRUDServiceImpl<java.lang.Long,ReferenceFile>
- Parameters:
object
- 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.
-
delete
@PreAuthorize("hasRole(\'ROLE_ADMIN\') or hasPermission(#id, \'canUpdateReferenceFile\')") 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,ReferenceFile>
- Overrides:
delete
in classCRUDServiceImpl<java.lang.Long,ReferenceFile>
- Parameters:
id
- The identifier of the object to delete.- Throws:
EntityNotFoundException
- If no object with the specified identifier exists in the database.
-
-