01: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.concurrency;
07:
08: import org.jasig.portal.IBasicEntity;
09:
10: /**
11: * Defines the api for a cache that caches <code>IBasicEntities</code>
12: * of a single type.
13: *
14: * @author Dan Ellentuck
15: * @version $Revision: 34757 $
16: */
17: public interface IEntityCache {
18:
19: /**
20: * @param entity - the entity to be cached.
21: */
22: public void add(IBasicEntity entity) throws CachingException;
23:
24: /**
25: * Purge stale entries from the cache.
26: */
27: public void cleanupCache() throws CachingException;
28:
29: /**
30: * Remove all entries from the cache.
31: */
32: public void clearCache() throws CachingException;
33:
34: /**
35: * @param key the key of the entity.
36: * @return org.jasig.portal.concurrency.IBasicEntity
37: */
38: public IBasicEntity get(String key);
39:
40: /**
41: * @see org.jasig.portal.EntityTypes for known types.
42: * @return java.lang.Class
43: */
44: public Class getEntityType();
45:
46: /**
47: * @param entityKey - the key of the entity to be un-cached.
48: */
49: public void remove(String entityKey) throws CachingException;
50:
51: /**
52: * Answers the number of entries in the cache.
53: */
54: public int size();
55:
56: /**
57: * @param entity - the entity to be updated in the cache.
58: */
59: public void update(IBasicEntity entity) throws CachingException;
60:
61: }
|