View Javadoc

1   /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * 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.springframework.security;
17  
18  import java.io.Serializable;
19  
20  
21  /**
22   * Stores a security system related configuration attribute.
23   *
24   * <p>
25   * When an {@link org.springframework.security.intercept.AbstractSecurityInterceptor}
26   * is setup, a list of configuration attributes is defined for secure object
27   * patterns. These configuration attributes have special meaning to a {@link
28   * RunAsManager}, {@link AccessDecisionManager} or
29   * <code>AccessDecisionManager</code> delegate.
30   * </p>
31   *
32   * <P>
33   * Stored at runtime with other <code>ConfigAttribute</code>s for the same
34   * secure object target within a {@link ConfigAttributeDefinition}.
35   * </p>
36   *
37   * @author Ben Alex
38   * @version $Id: ConfigAttribute.java 2217 2007-10-27 00:45:30Z luke_t $
39   */
40  public interface ConfigAttribute extends Serializable {
41      //~ Methods ========================================================================================================
42  
43      /**
44       * If the <code>ConfigAttribute</code> can be represented as a <code>String</code> and that
45       * <code>String</code> is sufficient in precision to be relied upon as a configuration parameter by a {@link
46       * RunAsManager}, {@link AccessDecisionManager} or <code>AccessDecisionManager</code> delegate, this method should
47       * return such a <code>String</code>.<p>If the <code>ConfigAttribute</code> cannot be expressed with
48       * sufficient precision as a <code>String</code>,  <code>null</code> should be returned. Returning
49       * <code>null</code> will require any relying classes to specifically support the  <code>ConfigAttribute</code>
50       * implementation, so returning  <code>null</code> should be avoided unless actually  required.</p>
51       *
52       * @return a representation of the configuration attribute (or <code>null</code> if the configuration attribute
53       *         cannot be expressed as a <code>String</code> with sufficient precision).
54       */
55      String getAttribute();
56  }