Interface SecurableBaseReadOnlyService<C extends Securable>
-
- All Superinterfaces:
BaseReadOnlyService<C>
- All Known Subinterfaces:
ArrayDesignService
,ExpressionExperimentService
,SecurableBaseImmutableService<C>
,SecurableBaseService<C>
,SecurableBaseVoEnabledService<C,VO>
,SecurableFilteringVoEnabledService<C,VO>
- All Known Implementing Classes:
ArrayDesignServiceImpl
,ExpressionExperimentServiceImpl
public interface SecurableBaseReadOnlyService<C extends Securable> extends BaseReadOnlyService<C>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description C
find(C entity)
Does a search for the entity in the persistent storageC
findOrFail(C entity)
Does a search for the entity in the persistent storage, raising aNullPointerException
if not found.C
load(Long id)
Loads object with given ID.Collection<C>
load(Collection<Long> ids)
Loads objects with given ids.Collection<C>
loadAll()
Loads all the entities of specific type.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.-
Methods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, getElementClass
-
-
-
-
Method Detail
-
find
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ_QUIET"}) C find(C entity)
Description copied from interface:BaseReadOnlyService
Does a search for the entity in the persistent storage- Specified by:
find
in interfaceBaseReadOnlyService<C extends Securable>
- Parameters:
entity
- the entity to be searched for- Returns:
- the version of entity retrieved from the persistent storage, if found, otherwise null.
-
findOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) C findOrFail(C entity) throws NullPointerException
Description copied from interface:BaseReadOnlyService
Does a search for the entity in the persistent storage, raising aNullPointerException
if not found.- Specified by:
findOrFail
in interfaceBaseReadOnlyService<C extends Securable>
- Parameters:
entity
- the entity to be searched for- Returns:
- the version of entity retrieved from persistent storage
- Throws:
NullPointerException
- if the entity is not found
-
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 Securable>
- Parameters:
ids
- the ids of objects to be loaded.- Returns:
- collection containing object with given IDs.
-
load
@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 Securable>
- 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 Securable>
- 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 Securable>
- 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 Securable>
- 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 Securable>
- 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 Securable>
- Returns:
- collection of all entities currently available in the persistent storage.
-
-