1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.acl.basic;
17
18 /***
19 * Provides a cache of {@link BasicAclEntry} objects.
20 *
21 * <P>
22 * Implementations should provide appropriate methods to set their cache
23 * parameters (eg time-to-live) and/or force removal of entities before their
24 * normal expiration. These are not part of the
25 * <code>BasicAclEntryCache</code> interface contract because they vary
26 * depending on the type of caching system used (eg in-memory vs disk vs
27 * cluster vs hybrid).
28 * </p>
29 *
30 * @author Ben Alex
31 * @version $Id: BasicAclEntryCache.java,v 1.2 2005/11/17 00:55:47 benalex Exp $
32 */
33 public interface BasicAclEntryCache {
34
35
36 /***
37 * Obtains an array of {@link BasicAclEntry}s from the cache.
38 *
39 * @param aclObjectIdentity which should be obtained from the cache
40 *
41 * @return any applicable <code>BasicAclEntry</code>s (no
42 * <code>null</code>s are permitted in the returned array) or
43 * <code>null</code> if the object identity could not be found or
44 * if the cache entry has expired
45 */
46 public BasicAclEntry[] getEntriesFromCache(
47 AclObjectIdentity aclObjectIdentity);
48
49 /***
50 * Places an array of {@link BasicAclEntry}s in the cache.
51 *
52 * <P>
53 * No <code>null</code>s are allowed in the passed array. If any
54 * <code>null</code> is passed, the implementation may throw an exception.
55 * </p>
56 *
57 * @param basicAclEntry the ACL entries to cache (the key will be extracted
58 * from the {@link BasicAclEntry#getAclObjectIdentity()} method
59 */
60 public void putEntriesInCache(BasicAclEntry[] basicAclEntry);
61 }