1 package eu
.etaxonomy
.cdm
.model
;
5 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
10 * Cache class for CDM Entities based on Ehcache.
11 * The class manages a singleton {@link net.sf.ehcache.CacheManager} having a
12 * {@link net.sf.ehcache.Cache} initialised with a default configuration.
14 * FIXME: This interface should actually be in an external project which also
15 * includes the implemented cachers.
19 public interface ICdmUuidCacher
extends ICdmCacher
{
22 * Puts the (Key,Value) pair of ({@link java.util.UUID}, {@link eu.etaxonomy.cdm.model.common.CdmBase}),
28 public void put(UUID uuid
, CdmBase cdmEntity
);
31 * Load a CDM Entity object with given UUID.
32 * This method checks the (default) cache for the entity,
33 * else retrieves the entity from the service layer.
35 * NOTE : Currently this method can only be used for CDM Term
36 * (DefinedTermBase) entities.
38 * @param uuid of CDM Entity to return
41 public CdmBase
load(UUID uuid
);
44 * Get a CDM Entity object with given UUID from the (default) cache.
49 public CdmBase
getFromCache(UUID uuid
);
54 * Check if a CDM Entity with given UUID exists in the cache.
56 * @param uuid of CDM Entity to check
57 * @return true if CDM Entity with given UUID exists in the cache, o/w false
59 public boolean exists(UUID uuid
);
62 * Check if a CDM Entity with given UUID exists in the cache
63 * and that it is not null.
65 * @param uuid of CDM Entity to check
66 * @return true if CDM Entity with given UUID exists in the cache and that it is not null, o/w false
68 public boolean existsAndIsNotNull(UUID uuid
);