Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IdentityHelperService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007-2008 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kew.identity.service; | |
17 | ||
18 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
19 | import org.kuali.rice.kew.actionrequest.Recipient; | |
20 | import org.kuali.rice.kew.user.UserId; | |
21 | import org.kuali.rice.kew.workgroup.GroupId; | |
22 | import org.kuali.rice.kim.api.identity.principal.Principal; | |
23 | import org.kuali.rice.kim.api.group.Group; | |
24 | import org.kuali.rice.kim.bo.Person; | |
25 | ||
26 | ||
27 | /** | |
28 | * A simple helper service in KEW for interacting with the KIM identity | |
29 | * management services. Some of the methods on here exist solely for | |
30 | * the purpose of assisting with the piece-by-piece migration of | |
31 | * KEW to use the KIM services. | |
32 | * | |
33 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
34 | */ | |
35 | public interface IdentityHelperService { | |
36 | ||
37 | public String getIdForPrincipalName(String principalName); | |
38 | ||
39 | public String getIdForGroupName(String namespace, String groupName); | |
40 | ||
41 | /** | |
42 | * Returns the KimPrincipal for the given principal id. Throws an exception | |
43 | * if the principal id cannot be resolved to a principal. | |
44 | * | |
45 | * @throws RiceIllegalArgumentException if the principal id cannot be resolved to a principal. | |
46 | */ | |
47 | public Principal getPrincipal(String principalId); | |
48 | ||
49 | /** | |
50 | * Returns the KimPrincipal for the given principal name. Throws an exception | |
51 | * if the principal name cannot be resolved to a principal. | |
52 | * | |
53 | * @throws RiceIllegalArgumentException if the principal name cannot be resolved to a principal | |
54 | */ | |
55 | public Principal getPrincipalByPrincipalName(String principalName); | |
56 | ||
57 | /** | |
58 | * Returns the Person for the given principal id. Throws an exception | |
59 | * if the principal id cannot be resolved to a person. | |
60 | * | |
61 | * @throws RiceIllegalArgumentException if the principal id cannot be resolved to a person. | |
62 | */ | |
63 | public Person getPerson(String principalId); | |
64 | ||
65 | /** | |
66 | * Returns the Person for the given principal name. Throws an exception | |
67 | * if the principal name cannot be resolved to a person. | |
68 | * | |
69 | * @throws RiceIllegalArgumentException if the principal name cannot be resolved to a person. | |
70 | */ | |
71 | public Person getPersonByPrincipalName(String principalName); | |
72 | ||
73 | /** | |
74 | * Returns the Person for the given employee id. Throws an exception | |
75 | * if the principal name cannot be resolved to a person. | |
76 | * | |
77 | * @throws RiceIllegalArgumentException if the principal name cannot be resolved to a person. | |
78 | */ | |
79 | public Person getPersonByEmployeeId(String employeeId); | |
80 | ||
81 | /** | |
82 | * Checks that the given principalId is valid. Throws a RiceRuntimeException if it is not. | |
83 | * | |
84 | * @throws RiceIllegalArgumentException if the given principalId is valid | |
85 | */ | |
86 | public void validatePrincipalId(String principalId); | |
87 | ||
88 | /** | |
89 | * Returns the principal for the given UserId. | |
90 | * | |
91 | * @throws RiceIllegalArgumentException if the given UserId does not resolve to a valid principal | |
92 | */ | |
93 | public Principal getPrincipal(UserId userId); | |
94 | ||
95 | /** | |
96 | * Returns the Group for the given groupId. Throws an exception | |
97 | * if the groupId cannot be resolved to a group. | |
98 | * | |
99 | * @throws RiceIllegalArgumentException if the groupId cannot be resolved to a group. | |
100 | */ | |
101 | public Group getGroup(String groupId); | |
102 | ||
103 | /** | |
104 | * Returns the Group for the given GroupId. Throws an exception | |
105 | * if the groupId cannot be resolved to a group. | |
106 | * | |
107 | * @throws RiceIllegalArgumentException if the GroupId cannot be resolved to a group. | |
108 | */ | |
109 | public Group getGroup(GroupId groupId); | |
110 | ||
111 | /** | |
112 | * Returns the Group for the given namespaceCode and name. Throws an exception | |
113 | * if the namespaceCode and name cannot be resolved to a group. | |
114 | * | |
115 | * @throws RiceIllegalArgumentException if the namespaceCode and name cannot be resolved to a group. | |
116 | */ | |
117 | public Group getGroupByName(String namespaceCode, String name); | |
118 | ||
119 | /** | |
120 | * Returns the Recipient for the given principalId. Throws an exception | |
121 | * if the principalId cannot be resolved to a recipient. | |
122 | * | |
123 | * @throws RiceIllegalArgumentException if the principalId cannot be resolved to a recipient | |
124 | */ | |
125 | public Recipient getPrincipalRecipient(String principalId); | |
126 | ||
127 | /** | |
128 | * Returns the principal for the "system user". This is a user | |
129 | * that can be used in the cases where an actual user cannot be | |
130 | * determined. | |
131 | */ | |
132 | public Principal getSystemPrincipal(); | |
133 | } |