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
Securedannotations to safeguard methods inherited fromBaseService.- Author:
- poirigui
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Ccreate(C curatable)Creates the given entity in the persistent storage.Collection<C>create(Collection<C> entities)Creates all the given entities in a persistent storageCfind(C curatable)Does a search for the entity in the persistent storageCfindOrCreate(C curatable)Does a search for the entity in the persistent storage, and if not found, creates it.Cload(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)CloadOrFail(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.VOloadValueObject(C entity)VOloadValueObjectById(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.voidremove(C expressionExperiment)Removes the given entity from the persistent storage.voidremove(Long id)Removes the entity with given ID from the persistent storage.Csave(C entity)Collection<C>save(Collection<C> entities)voidupdate(C entity)Updates the given entity in the persistent storage.voidupdate(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:BaseReadOnlyServiceDoes a search for the entity in the persistent storage- Specified by:
findin 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:BaseImmutableServiceDoes a search for the entity in the persistent storage, and if not found, creates it.- Specified by:
findOrCreatein 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:BaseImmutableServiceCreates all the given entities in a persistent storage- Specified by:
createin 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:BaseImmutableServiceCreates the given entity in the persistent storage.- Specified by:
createin 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:BaseReadOnlyServiceLoads objects with given ids.- Specified by:
loadin 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:BaseReadOnlyServiceLoads object with given ID.- Specified by:
loadin 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:BaseReadOnlyServiceConvenience for runningBaseReadOnlyService.load(Long)and checking if the result is null.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception; the message is generated automatically.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception and message.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoads all the entities of specific type.- Specified by:
loadAllin 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:
loadIdsin 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:
loadin 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:
loadin 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:
loadValueObjectsin 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:
loadValueObjectsin 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:
loadValueObjectin 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:
loadValueObjectByIdin 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:BaseVoEnabledServiceLoads value objects for all given entities.- Specified by:
loadValueObjectsin 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:BaseVoEnabledServiceLoad value objects by a given collection of IDs.- Specified by:
loadValueObjectsByIdsin 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:BaseVoEnabledServiceLoads value objects representing all the entities of specific type.- Specified by:
loadAllValueObjectsin 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:
savein interfaceBaseService<C extends Curatable>- See Also:
BaseDao.save(Collection)
-
save
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT_IGNORE_TRANSIENT"}) C save(C entity)- Specified by:
savein interfaceBaseService<C extends Curatable>- See Also:
BaseDao.save(Object)
-
update
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void update(C entity)Description copied from interface:BaseServiceUpdates the given entity in the persistent storage.- Specified by:
updatein 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:BaseServiceUpdates all entities in the given collection in the persistent storage.- Specified by:
updatein 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:
removein 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:BaseImmutableServiceRemoves the given entity from the persistent storage.- Specified by:
removein interfaceBaseImmutableService<C extends Curatable>- Parameters:
expressionExperiment- the entity to be removed.
-
-