Interface BaseReadOnlyService<O extends Identifiable>

All Known Subinterfaces:
AnalysisResultSetService<K,O>, AnalysisService<T>, AnnotationAssociationService, ArrayDesignService, AuditTrailService, BaseImmutableService<O>, BaseService<O>, BaseVoEnabledService<O,VO>, BibliographicReferenceService, BioAssayDimensionService, BioAssayService, BioMaterialService, BioSequenceService, BlacklistedEntityService, BlatAssociationService, BlatResultService, BulkExpressionDataVectorService<T>, CharacteristicService, ChromosomeService, CoexpressionAnalysisService, CompositeSequenceService, CompoundService, ContactService, DatabaseEntryService, DifferentialExpressionAnalysisService, DifferentialExpressionResultService, ExperimentalDesignService, ExperimentalFactorService, ExpressionAnalysisResultSetService, ExpressionExperimentService, ExpressionExperimentSetService, ExpressionExperimentSubSetService, ExternalDatabaseService, FactorValueService, FilteringService<O>, FilteringVoEnabledService<O,VO>, GeeqService, Gene2GOAssociationService, GeneDiffExMetaAnalysisService, GeneProductService, GeneService, GeneSetService, PrincipalComponentAnalysisService, ProcessedExpressionDataVectorService, ProtocolService, QuantitationTypeService, RawAndProcessedExpressionDataVectorService, RawExpressionDataVectorService, SecurableBaseImmutableService<C>, SecurableBaseReadOnlyService<C>, SecurableBaseService<C>, SecurableBaseVoEnabledService<C,VO>, SecurableFilteringVoEnabledService<C,VO>, TaxonService
All Known Implementing Classes:
AbstractBulkExpressionDataVectorService, AbstractFilteringVoEnabledService, AbstractService, AbstractVoEnabledService, AnnotationAssociationServiceImpl, ArrayDesignServiceImpl, AuditTrailServiceImpl, BibliographicReferenceServiceImpl, BioAssayDimensionServiceImpl, BioAssayServiceImpl, BioMaterialServiceImpl, BioSequenceServiceImpl, BlacklistedEntityServiceImpl, BlatAssociationServiceImpl, BlatResultServiceImpl, CharacteristicServiceImpl, ChromosomeServiceImpl, CoexpressionAnalysisServiceImpl, CompositeSequenceServiceImpl, CompoundServiceImpl, ContactServiceImpl, DatabaseEntryServiceImpl, DifferentialExpressionAnalysisServiceImpl, DifferentialExpressionResultServiceImpl, ExperimentalDesignServiceImpl, ExperimentalFactorServiceImpl, ExpressionAnalysisResultSetServiceImpl, ExpressionExperimentServiceImpl, ExpressionExperimentSetServiceImpl, ExpressionExperimentSubSetServiceImpl, ExternalDatabaseServiceImpl, FactorValueServiceImpl, GeeqServiceImpl, Gene2GOAssociationServiceImpl, GeneDiffExMetaAnalysisServiceImpl, GeneProductServiceImpl, GeneServiceImpl, GeneSetServiceImpl, PrincipalComponentAnalysisServiceImpl, ProcessedExpressionDataVectorServiceImpl, ProtocolServiceImpl, QuantitationTypeServiceImpl, RawAndProcessedExpressionDataVectorServiceImpl, RawExpressionDataVectorServiceImpl, TaxonServiceImpl

public interface BaseReadOnlyService<O extends Identifiable>
Interface for read-only services.
Author:
poirigui
  • Method Details

    • getElementClass

      Class<? extends O> getElementClass()
    • find

      Does a search for the entity in the persistent storage
      Parameters:
      entity - the entity to be searched for
      Returns:
      the version of entity retrieved from the persistent storage, if found, otherwise null.
    • findOrFail

      @Nonnull @CheckReturnValue O findOrFail(O entity) throws NullPointerException
      Does a search for the entity in the persistent storage, raising a NullPointerException if not found.
      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

      Collection<O> load(Collection<Long> ids)
      Loads objects with given ids.
      Parameters:
      ids - the ids of objects to be loaded.
      Returns:
      collection containing object with given IDs.
    • load

      @Nullable O load(Long id)
      Loads object with given ID.
      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 O loadOrFail(Long id) throws NullPointerException
      Convenience for running load(Long) and checking if the result is null.
      Parameters:
      id - the ID used to retrieve the entity
      Returns:
      the entity as per load(Long), never null
      Throws:
      NullPointerException - if the entity does not exist in the persistent storage
    • loadOrFail

      @Nonnull <T extends Exception> O loadOrFail(Long id, Supplier<T> exceptionSupplier) throws T
      Load an entity or fail with the supplied exception.
      Throws:
      T - if the entity does not exist in the persistent storage
    • loadOrFail

      @Nonnull <T extends Exception> O loadOrFail(Long id, Function<String,T> exceptionSupplier) throws T
      Load an entity or fail with the supplied exception; the message is generated automatically.
      Throws:
      T - if the entity does not exist in the persistent storage
    • loadOrFail

      @Nonnull <T extends Exception> O loadOrFail(Long id, Function<String,T> exceptionSupplier, String message) throws T
      Load an entity or fail with the supplied exception and message.
      Throws:
      T - if the entity does not exist in the persistent storage
    • loadAll

      Collection<O> loadAll()
      Loads all the entities of specific type.
      Returns:
      collection of all entities currently available in the persistent storage.
    • countAll

      long countAll()
    • streamAll

      Stream<O> streamAll()
    • streamAll

      Stream<O> streamAll(boolean createNewSession)