public class CombinedEntityCache extends Object
| Constructor and Description |
|---|
CombinedEntityCache(EntityHydration entityHydration,
com.google.common.cache.Cache<EntityKey,CacheHit<Map<String,Object>>> cache)
Creates a new
CombinedEntityCache |
| Modifier and Type | Method and Description |
|---|---|
void |
evict(Stream<EntityKey> entityKeys) |
void |
evictAll(EntityType entityType)
Evicts all entries from the cache that belong to a certain entityType.
|
Optional<CacheHit<Entity>> |
getIfPresent(EntityType entityType,
Object id)
Retrieves an entity from the cache if present.
|
void |
put(Entity entity)
Inserts an entity into the cache.
|
void |
putDeletion(EntityKey entityKey)
Caches the deletion of an entity instance.
|
public CombinedEntityCache(EntityHydration entityHydration, com.google.common.cache.Cache<EntityKey,CacheHit<Map<String,Object>>> cache)
CombinedEntityCacheentityHydration - EntityHydration used to hydrate and dehydrate the entities and
generate cache keyscache - the Cache to store the CacheHits inpublic void putDeletion(EntityKey entityKey)
entityKey - the EntityKey of the deleted entity instancepublic void evictAll(EntityType entityType)
entityType - the id of the entity whose entries are to be evictedpublic Optional<CacheHit<Entity>> getIfPresent(EntityType entityType, Object id)
entityType - EntityType of the entity to retrieveid - id value of the entity to retrieveCacheHit with the result from the cache, empty if no record of
the entity is present in the cachepublic void put(Entity entity)
entity - the entity to insert into the cacheCopyright © 2018 Pivotal Software, Inc.. All rights reserved.