01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
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 1784 2007-02-24 21:00:24Z luke_t $
32: */
33: public interface BasicAclEntryCache {
34: //~ Methods ========================================================================================================
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 <code>null</code>s are permitted in the returned array)
42: * or <code>null</code> if the object identity could not be found or if the cache entry has expired
43: */
44: BasicAclEntry[] getEntriesFromCache(
45: AclObjectIdentity aclObjectIdentity);
46:
47: /**
48: * Places an array of {@link BasicAclEntry}s in the cache.<P>No <code>null</code>s are allowed in the
49: * passed array. If any <code>null</code> is passed, the implementation may throw an exception.</p>
50: *
51: * @param basicAclEntry the ACL entries to cache (the key will be extracted from the {@link
52: * BasicAclEntry#getAclObjectIdentity()} method
53: */
54: void putEntriesInCache(BasicAclEntry[] basicAclEntry);
55:
56: /**
57: * Removes all ACL entries related to an {@link AclObjectIdentity} from the cache.
58: *
59: * @param aclObjectIdentity which should be removed from the cache
60: */
61: void removeEntriesFromCache(AclObjectIdentity aclObjectIdentity);
62: }
|