Class L3CacheRepositoryDecorator

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<org.molgenis.data.Entity>, org.molgenis.data.Repository<org.molgenis.data.Entity>

    public class L3CacheRepositoryDecorator
    extends org.molgenis.data.AbstractRepositoryDecorator<org.molgenis.data.Entity>
    Retrieves identifiers from the L3Cache based on a Query if RepositoryCapability.CACHEABLE.

    Delegates to the underlying Repository

    • Constructor Summary

      Constructors 
      Constructor Description
      L3CacheRepositoryDecorator​(org.molgenis.data.Repository<org.molgenis.data.Entity> delegateRepository, L3Cache l3Cache, org.molgenis.data.transaction.TransactionInformation transactionInformation)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.stream.Stream<org.molgenis.data.Entity> findAll​(org.molgenis.data.Query<org.molgenis.data.Entity> query)
      Retrieves a List of identifiers from the L3Cache if the Repository is cacheable and the Query is limited (i.e.
      org.molgenis.data.Entity findOne​(org.molgenis.data.Query<org.molgenis.data.Entity> query)
      Retrieves a single identifier from the L3Cache if the Repository is cacheable and hasn't been touched in this transaction.
      • Methods inherited from class org.molgenis.data.AbstractRepositoryDecorator

        add, add, aggregate, close, count, count, delegate, delete, delete, deleteAll, deleteAll, deleteById, findAll, findAll, findOneById, findOneById, forEachBatched, getCapabilities, getEntityType, getName, getQueryOperators, iterator, query, update, update
      • Methods inherited from class com.google.common.collect.ForwardingObject

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface org.molgenis.data.Repository

        forEachBatched, getExistingIDs, upsertBatch
    • Constructor Detail

      • L3CacheRepositoryDecorator

        public L3CacheRepositoryDecorator​(org.molgenis.data.Repository<org.molgenis.data.Entity> delegateRepository,
                                          L3Cache l3Cache,
                                          org.molgenis.data.transaction.TransactionInformation transactionInformation)
    • Method Detail

      • findAll

        public java.util.stream.Stream<org.molgenis.data.Entity> findAll​(org.molgenis.data.Query<org.molgenis.data.Entity> query)
        Retrieves a List of identifiers from the L3Cache if the Repository is cacheable and the Query is limited (i.e. contains a pageSize) between 0 and MAX_PAGE_SIZE
        Specified by:
        findAll in interface org.molgenis.data.Repository<org.molgenis.data.Entity>
        Overrides:
        findAll in class org.molgenis.data.AbstractRepositoryDecorator<org.molgenis.data.Entity>
        Parameters:
        query - The Query
        Returns:
        A stream of Entity
      • findOne

        public org.molgenis.data.Entity findOne​(org.molgenis.data.Query<org.molgenis.data.Entity> query)
        Retrieves a single identifier from the L3Cache if the Repository is cacheable and hasn't been touched in this transaction.
        Specified by:
        findOne in interface org.molgenis.data.Repository<org.molgenis.data.Entity>
        Overrides:
        findOne in class org.molgenis.data.AbstractRepositoryDecorator<org.molgenis.data.Entity>
        Parameters:
        query - The Query
        Returns:
        A single Entity or null if not found