Interface CuratableService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
-
- All Superinterfaces:
BaseImmutableService<C>
,BaseReadOnlyService<C>
,BaseService<C>
,BaseVoEnabledService<C,VO>
,FilteringService<C>
,FilteringVoEnabledService<C,VO>
- All Known Subinterfaces:
ArrayDesignService
,ExpressionExperimentService
- All Known Implementing Classes:
ArrayDesignServiceImpl
,ExpressionExperimentServiceImpl
public interface CuratableService<C extends Curatable,VO extends AbstractCuratableValueObject<C>> extends BaseService<C>, FilteringVoEnabledService<C,VO>
Interface for curatable services.For now, this mainly adds
Secured
annotations to safeguard methods inherited fromBaseService
.- Author:
- poirigui
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description C
create(C curatable)
Creates the given entity in the persistent storage.Collection<C>
create(Collection<C> entities)
Creates all the given entities in a persistent storageC
find(C curatable)
Does a search for the entity in the persistent storageC
findOrCreate(C curatable)
Does a search for the entity in the persistent storage, and if not found, creates it.C
load(Long id)
Loads object with given ID.Collection<C>
load(Collection<Long> ids)
Loads objects with given ids.List<C>
load(Filters filters, Sort sort)
Slice<C>
load(Filters filters, Sort sort, int offset, int limit)
Collection<C>
loadAll()
Loads all the entities of specific type.List<VO>
loadAllValueObjects()
Loads value objects representing all the entities of specific type.List<Long>
loadIds(Filters filters, Sort sort)
C
loadOrFail(Long id)
Convenience for runningBaseReadOnlyService.load(Long)
and checking if the result is null.<T extends Exception>
CloadOrFail(Long id, Function<String,T> exceptionSupplier)
Load an entity or fail with the supplied exception; the message is generated automatically.<T extends Exception>
CloadOrFail(Long id, Function<String,T> exceptionSupplier, String message)
Load an entity or fail with the supplied exception and message.<T extends Exception>
CloadOrFail(Long id, Supplier<T> exceptionSupplier)
Load an entity or fail with the supplied exception.VO
loadValueObject(C entity)
VO
loadValueObjectById(Long entityId)
List<VO>
loadValueObjects(Collection<C> entities)
Loads value objects for all given entities.List<VO>
loadValueObjects(Filters filters, Sort sort)
Slice<VO>
loadValueObjects(Filters filters, Sort sort, int offset, int limit)
List<VO>
loadValueObjectsByIds(Collection<Long> ids)
Load value objects by a given collection of IDs.void
remove(C expressionExperiment)
Removes the given entity from the persistent storage.void
remove(Long id)
Removes the entity with given ID from the persistent storage.C
save(C entity)
Collection<C>
save(Collection<C> entities)
void
update(C entity)
Updates the given entity in the persistent storage.void
update(Collection<C> entities)
Updates all entities in the given collection in the persistent storage.-
Methods inherited from interface ubic.gemma.persistence.service.BaseImmutableService
remove
-
Methods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, findOrFail, getElementClass
-
Methods inherited from interface ubic.gemma.persistence.service.FilteringService
count, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyConfigAttributes, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyResolvableAllowedValuesLabels, getFilterablePropertyType, getIdentifierPropertyName, getSort
-
-
-
-
Method Detail
-
find
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ_QUIET"}) C find(C curatable)
Description copied from interface:BaseReadOnlyService
Does a search for the entity in the persistent storage- Specified by:
find
in interfaceBaseReadOnlyService<C extends Curatable>
- Parameters:
curatable
- the entity to be searched for- Returns:
- the version of entity retrieved from the persistent storage, if found, otherwise null.
-
findOrCreate
@Secured({"GROUP_USER","AFTER_ACL_READ"}) C findOrCreate(C curatable)
Description copied from interface:BaseImmutableService
Does a search for the entity in the persistent storage, and if not found, creates it.- Specified by:
findOrCreate
in interfaceBaseImmutableService<C extends Curatable>
- Parameters:
curatable
- the entity to look for, and create if not found.- Returns:
- the entity retrieved from the persistent storage, either found or created.
-
create
@Secured("GROUP_USER") Collection<C> create(Collection<C> entities)
Description copied from interface:BaseImmutableService
Creates all the given entities in a persistent storage- Specified by:
create
in interfaceBaseImmutableService<C extends Curatable>
- Parameters:
entities
- the entities to be created.- Returns:
- collection of objects referencing the persistent instances of given entities.
-
create
@Secured("GROUP_USER") C create(C curatable)
Description copied from interface:BaseImmutableService
Creates the given entity in the persistent storage.- Specified by:
create
in interfaceBaseImmutableService<C extends Curatable>
- Parameters:
curatable
- the entity to be created.- Returns:
- object referencing the persistent instance of the given entity.
-
load
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<C> load(Collection<Long> ids)
Description copied from interface:BaseReadOnlyService
Loads objects with given ids.- Specified by:
load
in interfaceBaseReadOnlyService<C extends Curatable>
- Parameters:
ids
- the ids of objects to be loaded.- Returns:
- collection containing object with given IDs.
-
load
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ_QUIET"}) C load(Long id)
Description copied from interface:BaseReadOnlyService
Loads object with given ID.- Specified by:
load
in interfaceBaseReadOnlyService<C extends Curatable>
- Parameters:
id
- the ID of entity to be loaded.- Returns:
- the entity with matching ID, or null if the entity does not exist or if the passed ID was null
-
loadOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) C loadOrFail(Long id) throws NullPointerException
Description copied from interface:BaseReadOnlyService
Convenience for runningBaseReadOnlyService.load(Long)
and checking if the result is null.- Specified by:
loadOrFail
in interfaceBaseReadOnlyService<C extends Curatable>
- Parameters:
id
- the ID used to retrieve the entity- Returns:
- the entity as per
BaseReadOnlyService.load(Long)
, never null - Throws:
NullPointerException
- if the entity does not exist in the persistent storage
-
loadOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) <T extends Exception> C loadOrFail(Long id, Supplier<T> exceptionSupplier) throws T extends Exception
Description copied from interface:BaseReadOnlyService
Load an entity or fail with the supplied exception.- Specified by:
loadOrFail
in interfaceBaseReadOnlyService<C extends Curatable>
- Throws:
T
- if the entity does not exist in the persistent storageT extends Exception
-
loadOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) <T extends Exception> C loadOrFail(Long id, Function<String,T> exceptionSupplier) throws T extends Exception
Description copied from interface:BaseReadOnlyService
Load an entity or fail with the supplied exception; the message is generated automatically.- Specified by:
loadOrFail
in interfaceBaseReadOnlyService<C extends Curatable>
- Throws:
T
- if the entity does not exist in the persistent storageT extends Exception
-
loadOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) <T extends Exception> C loadOrFail(Long id, Function<String,T> exceptionSupplier, String message) throws T extends Exception
Description copied from interface:BaseReadOnlyService
Load an entity or fail with the supplied exception and message.- Specified by:
loadOrFail
in interfaceBaseReadOnlyService<C extends Curatable>
- Throws:
T
- if the entity does not exist in the persistent storageT extends Exception
-
loadAll
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<C> loadAll()
Description copied from interface:BaseReadOnlyService
Loads all the entities of specific type.- Specified by:
loadAll
in interfaceBaseReadOnlyService<C extends Curatable>
- Returns:
- collection of all entities currently available in the persistent storage.
-
loadIds
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") List<Long> loadIds(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
loadIds
in interfaceFilteringService<C extends Curatable>
- See Also:
FilteringDao.loadIds(Filters, Sort)
-
load
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") List<C> load(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
load
in interfaceFilteringService<C extends Curatable>
- See Also:
FilteringDao.load(Filters, Sort)
-
load
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Slice<C> load(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
load
in interfaceFilteringService<C extends Curatable>
- See Also:
FilteringDao.load(Filters, Sort, int, int)
-
loadValueObjects
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") List<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- See Also:
FilteringVoEnabledDao.loadValueObjects(Filters, Sort)
-
loadValueObjects
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Slice<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- See Also:
FilteringVoEnabledDao.loadValueObjects(Filters, Sort, int, int)
-
loadValueObject
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) VO loadValueObject(C entity)
- Specified by:
loadValueObject
in interfaceBaseVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- See Also:
BaseVoEnabledDao.loadValueObject(Identifiable)
-
loadValueObjectById
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) VO loadValueObjectById(Long entityId)
- Specified by:
loadValueObjectById
in interfaceBaseVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- See Also:
BaseVoEnabledDao.loadValueObjectById(Long)
-
loadValueObjects
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<VO> loadValueObjects(Collection<C> entities)
Description copied from interface:BaseVoEnabledService
Loads value objects for all given entities.- Specified by:
loadValueObjects
in interfaceBaseVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- Parameters:
entities
- the entities to be converted to value objects- Returns:
- a collection of value objects representing he given entities.
-
loadValueObjectsByIds
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<VO> loadValueObjectsByIds(Collection<Long> ids)
Description copied from interface:BaseVoEnabledService
Load value objects by a given collection of IDs.- Specified by:
loadValueObjectsByIds
in interfaceBaseVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
-
loadAllValueObjects
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<VO> loadAllValueObjects()
Description copied from interface:BaseVoEnabledService
Loads value objects representing all the entities of specific type.- Specified by:
loadAllValueObjects
in interfaceBaseVoEnabledService<C extends Curatable,VO extends AbstractCuratableValueObject<C>>
- Returns:
- a collection of value objects
-
save
@Secured({"GROUP_USER","ACL_SECURABLE_COLLECTION_EDIT_IGNORE_TRANSIENT"}) Collection<C> save(Collection<C> entities)
- Specified by:
save
in interfaceBaseService<C extends Curatable>
- See Also:
BaseDao.save(Collection)
-
save
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT_IGNORE_TRANSIENT"}) C save(C entity)
- Specified by:
save
in interfaceBaseService<C extends Curatable>
- See Also:
BaseDao.save(Object)
-
update
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void update(C entity)
Description copied from interface:BaseService
Updates the given entity in the persistent storage.- Specified by:
update
in interfaceBaseService<C extends Curatable>
- Parameters:
entity
- the entity to be updated.
-
update
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void update(Collection<C> entities)
Description copied from interface:BaseService
Updates all entities in the given collection in the persistent storage.- Specified by:
update
in interfaceBaseService<C extends Curatable>
- Parameters:
entities
- the entities to be updated.
-
remove
@Secured("GROUP_ADMIN") void remove(Long id)
Removes the entity with given ID from the persistent storage.Only administrator are allowed to remove entity by ID.
- Specified by:
remove
in interfaceBaseImmutableService<C extends Curatable>
- Parameters:
id
- the ID of entity to be removed.
-
remove
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void remove(C expressionExperiment)
Description copied from interface:BaseImmutableService
Removes the given entity from the persistent storage.- Specified by:
remove
in interfaceBaseImmutableService<C extends Curatable>
- Parameters:
expressionExperiment
- the entity to be removed.
-
-