View Javadoc

1   /*
2    *   @(#) $Id: OperationScope.java 292940 2005-10-01 08:05:01Z trustin $
3    *   
4    *   Copyright 2004 The Apache Software Foundation
5    *
6    *   Licensed under the Apache License, Version 2.0 (the "License");
7    *   you may not use this file except in compliance with the License.
8    *   You may obtain a copy of the License at
9    *
10   *       http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing, software
13   *   distributed under the License is distributed on an "AS IS" BASIS,
14   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   *   See the License for the specific language governing permissions and
16   *   limitations under the License.
17   *
18   */
19  package org.apache.ldap.server.authz.support;
20  
21  /***
22   * An enumeration that represents the scope of user operation.
23   *
24   * @author The Apache Directory Project
25   * @version $Rev: 292940 $, $Date: 2005-10-01 04:05:01 -0400 (Sat, 01 Oct 2005) $
26   */
27  public class OperationScope
28  {
29      /***
30       * An operation that affects the whole entry.
31       */
32      public static final OperationScope ENTRY = new OperationScope( "Entry" );
33      
34      /***
35       * An operation that affects all values in an attribute type.
36       */
37      public static final OperationScope ATTRIBUTE_TYPE = new OperationScope( "Attribute Type" );
38      
39      /***
40       * An operation that affects the specific value in an attribute type.
41       */
42      public static final OperationScope ATTRIBUTE_TYPE_AND_VALUE = new OperationScope( "Attribute Type & Value" );
43      
44      private final String name;
45      
46      private OperationScope( String name )
47      {
48          this.name = name;
49      }
50      
51      /***
52       * Return the name of this scope.
53       */
54      public String getName()
55      {
56          return name;
57      }
58  
59      /***
60       * Returns the name of this scope.
61       */
62      public String toString()
63      {
64          return name;
65      }
66  }