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;
17:
18: import java.io.Serializable;
19:
20: /**
21: * Stores a security system related configuration attribute.
22: *
23: * <p>
24: * When an {@link org.acegisecurity.intercept.AbstractSecurityInterceptor}
25: * is setup, a list of configuration attributes is defined for secure object
26: * patterns. These configuration attributes have special meaning to a {@link
27: * RunAsManager}, {@link AccessDecisionManager} or
28: * <code>AccessDecisionManager</code> delegate.
29: * </p>
30: *
31: * <P>
32: * Stored at runtime with other <code>ConfigAttribute</code>s for the same
33: * secure object target within a {@link ConfigAttributeDefinition}.
34: * </p>
35: *
36: * @author Ben Alex
37: * @version $Id: ConfigAttribute.java 1784 2007-02-24 21:00:24Z luke_t $
38: */
39: public interface ConfigAttribute extends Serializable {
40: //~ Methods ========================================================================================================
41:
42: /**
43: * If the <code>ConfigAttribute</code> can be represented as a <code>String</code> and that
44: * <code>String</code> is sufficient in precision to be relied upon as a configuration parameter by a {@link
45: * RunAsManager}, {@link AccessDecisionManager} or <code>AccessDecisionManager</code> delegate, this method should
46: * return such a <code>String</code>.<p>If the <code>ConfigAttribute</code> cannot be expressed with
47: * sufficient precision as a <code>String</code>, <code>null</code> should be returned. Returning
48: * <code>null</code> will require any relying classes to specifically support the <code>ConfigAttribute</code>
49: * implementation, so returning <code>null</code> should be avoided unless actually required.</p>
50: *
51: * @return a representation of the configuration attribute (or <code>null</code> if the configuration attribute
52: * cannot be expressed as a <code>String</code> with sufficient precision).
53: */
54: String getAttribute();
55: }
|