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 Cfind(C entity)Does a search for the entity in the persistent storageCfindOrFail(C entity)Does a search for the entity in the persistent storage, raising aNullPointerExceptionif not found.Cload(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.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.-
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:BaseReadOnlyServiceDoes a search for the entity in the persistent storage- Specified by:
findin 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:BaseReadOnlyServiceDoes a search for the entity in the persistent storage, raising aNullPointerExceptionif not found.- Specified by:
findOrFailin 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:BaseReadOnlyServiceLoads objects with given ids.- Specified by:
loadin 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:BaseReadOnlyServiceLoads object with given ID.- Specified by:
loadin 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:BaseReadOnlyServiceConvenience for runningBaseReadOnlyService.load(Long)and checking if the result is null.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception; the message is generated automatically.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoad an entity or fail with the supplied exception and message.- Specified by:
loadOrFailin 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:BaseReadOnlyServiceLoads all the entities of specific type.- Specified by:
loadAllin interfaceBaseReadOnlyService<C extends Securable>- Returns:
- collection of all entities currently available in the persistent storage.
-
-