Package cz.cvut.kbss.jopa.model
Interface Cache
- All Known Subinterfaces:
CacheManager
- All Known Implementing Classes:
DisabledCacheManager
,LruCacheManager
,TtlCacheManager
public interface Cache
Interface used to interact with the second-level cache.
If a cache is not in use, the methods of this interface have no effect, except for contains, which returns false.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(Class<?> cls, Object identifier, Descriptor descriptor) Checks whether the cache contains data for the given entity.void
Removes the data for entities of the specified class (and its subclasses) from the cache.void
Removes the data for the given entity from the cache.void
Removes the data for entities of the specified repository context from the cache.void
evictAll()
Clears the cache.
-
Method Details
-
contains
Checks whether the cache contains data for the given entity.- Parameters:
cls
- Entity classidentifier
- Instance identifierdescriptor
- Specifies instance context and additional possible information, e.g. language tags- Returns:
boolean
indicating whether the entity is in the cache
-
evict
Removes the data for the given entity from the cache.- Parameters:
cls
- Entity classidentifier
- Instance identifiercontext
- Context URI, possiblynull
, meaning the default context
-
evict
Removes the data for entities of the specified class (and its subclasses) from the cache.This method removes the entities from all available contexts.
- Parameters:
cls
- entity class
-
evict
Removes the data for entities of the specified repository context from the cache.- Parameters:
context
- URI of the context to evict, possiblynull
, meaning the default context
-
evictAll
void evictAll()Clears the cache.
-