1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.intercept;
17
18 import org.acegisecurity.ConfigAttributeDefinition;
19
20 import java.util.Iterator;
21
22
23 /***
24 * Implemented by classes that store and can identify the {@link
25 * ConfigAttributeDefinition} that applies to a given secure object
26 * invocation.
27 *
28 * @author Ben Alex
29 * @version $Id: ObjectDefinitionSource.java,v 1.3 2005/11/17 00:55:51 benalex Exp $
30 */
31 public interface ObjectDefinitionSource {
32
33
34 /***
35 * Accesses the <code>ConfigAttributeDefinition</code> that applies to a
36 * given secure object.
37 *
38 * <P>
39 * Returns <code>null</code> if no <code>ConfigAttribiteDefinition</code>
40 * applies.
41 * </p>
42 *
43 * @param object the object being secured
44 *
45 * @return the <code>ConfigAttributeDefinition</code> that applies to the
46 * passed object
47 *
48 * @throws IllegalArgumentException if the passed object is not of a type
49 * supported by the <code>ObjectDefinitionSource</code>
50 * implementation
51 */
52 public ConfigAttributeDefinition getAttributes(Object object)
53 throws IllegalArgumentException;
54
55 /***
56 * If available, all of the <code>ConfigAttributeDefinition</code>s defined
57 * by the implementing class.
58 *
59 * <P>
60 * This is used by the {@link AbstractSecurityInterceptor} to perform
61 * startup time validation of each <code>ConfigAttribute</code> configured
62 * against it.
63 * </p>
64 *
65 * @return an iterator over all the <code>ConfigAttributeDefinition</code>s
66 * or <code>null</code> if unsupported
67 */
68 public Iterator getConfigAttributeDefinitions();
69
70 /***
71 * Indicates whether the <code>ObjectDefinitionSource</code> implementation
72 * is able to provide <code>ConfigAttributeDefinition</code>s for the
73 * indicated secure object type.
74 *
75 * @param clazz the class that is being queried
76 *
77 * @return true if the implementation can process the indicated class
78 */
79 public boolean supports(Class clazz);
80 }