Class CombinedEntityCache


  • public class CombinedEntityCache
    extends Object
    Caches CacheHits with Entitys from different repositories in dehydrated form in a single combined Guava Cache.
    • Method Detail

      • putDeletion

        public void putDeletion​(org.molgenis.data.EntityKey entityKey)
        Caches the deletion of an entity instance.
        Parameters:
        entityKey - the EntityKey of the deleted entity instance
      • evictAll

        public void evictAll​(org.molgenis.data.meta.model.EntityType entityType)
        Evicts all entries from the cache that belong to a certain entityType.
        Parameters:
        entityType - the id of the entity whose entries are to be evicted
      • getIfPresent

        public Optional<CacheHit<org.molgenis.data.Entity>> getIfPresent​(org.molgenis.data.meta.model.EntityType entityType,
                                                                         Object id)
        Retrieves an entity from the cache if present.
        Parameters:
        entityType - EntityType of the entity to retrieve
        id - id value of the entity to retrieve
        Returns:
        Optional CacheHit with the result from the cache, empty if no record of the entity is present in the cache
      • put

        public void put​(org.molgenis.data.Entity entity)
        Inserts an entity into the cache.
        Parameters:
        entity - the entity to insert into the cache
      • evict

        public void evict​(Stream<org.molgenis.data.EntityKey> entityKeys)