RoleHierarchyPolicy | Line # 52 | 0 | 1 | - |
-1.0
|
No Tests | |||
1 | /* | |
2 | * Copyright (c) 2000-2005, University of Salford | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions are met: | |
7 | * | |
8 | * Redistributions of source code must retain the above copyright notice, this | |
9 | * list of conditions and the following disclaimer. | |
10 | * | |
11 | * Redistributions in binary form must reproduce the above copyright notice, | |
12 | * this list of conditions and the following disclaimer in the documentation | |
13 | * and/or other materials provided with the distribution. | |
14 | * | |
15 | * Neither the name of the University of Salford nor the names of its | |
16 | * contributors may be used to endorse or promote products derived from this | |
17 | * software without specific prior written permission. | |
18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | |
31 | ||
32 | package issrg.pba.rbac; | |
33 | ||
34 | /** | |
35 | * This interface provides the methods for enquiring the Role Hierarchy Policy. | |
36 | * The | |
37 | * users of the policy will normally only need to know how to convert the role | |
38 | * OID into | |
39 | * the type as it is specified in the policy (the authorisation tokens may | |
40 | * contain an | |
41 | * OID as the identifier of the role type, which is not human readable in the | |
42 | * policy, and | |
43 | * would probably be replaced by a human-readable string). The other thing the | |
44 | * users may | |
45 | * wish to know is the reference to the node representing the given role value | |
46 | * of a particular | |
47 | * type. The node can tell the hierarchical relationship to other nodes. | |
48 | * | |
49 | * @author A.Otenko | |
50 | */ | |
51 | ||
52 | public interface RoleHierarchyPolicy { | |
53 | ||
54 | /** | |
55 | * This method returns the type of the attribute corresponding to the given | |
56 | * OID. | |
57 | * If the policy does not have the requested OID, the method should return | |
58 | * null. | |
59 | * | |
60 | * @param roleOID is the requested OID in the dotted form | |
61 | * | |
62 | * @return the human-readable string used in the policy, and that should be | |
63 | * used | |
64 | * when getting a role hierarchy node | |
65 | */ | |
66 | public String getTypeByOID(String roleOID); | |
67 | ||
68 | ||
69 | /** | |
70 | * This method returns a hashtable that map between type and corresponding OID | |
71 | * | |
72 | * @return a hashtable that map between type and corresponding OID | |
73 | */ | |
74 | public java.util.Map getTypeOid(); | |
75 | ||
76 | /** | |
77 | * This method returns a reference to the role in the hierarchy. The returned | |
78 | * object | |
79 | * can tell the hierarchical relationship to other nodes. | |
80 | * | |
81 | * @param roleType is the identifier of the role type in the policy | |
82 | * @param roleValue is the value of the role to give the reference to | |
83 | * | |
84 | * @return the reference to the node, or null, if no such role is defined | |
85 | */ | |
86 | public RoleHierarchyNode getRole(String roleType, String roleValue); | |
87 | } |
|