Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PersonService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 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.kim.service; | |
17 | ||
18 | import java.util.List; | |
19 | import java.util.Map; | |
20 | ||
21 | import org.kuali.rice.kim.bo.Person; | |
22 | import org.kuali.rice.krad.bo.BusinessObject; | |
23 | ||
24 | /** | |
25 | * | |
26 | * This service acts as a facade on the entity information that is provided | |
27 | * through the IdentityService and provides a "person-centric" view of that | |
28 | * entity data. | |
29 | * | |
30 | * <p>In general, the Person object flattens out the various related pieces of | |
31 | * entity data into a denormalized view on that data. In many cases, that | |
32 | * data will have a defined "default" value in the entity data model. This | |
33 | * default data is what the Person object will be constructed with. For | |
34 | * example, an entity can have more than one name, but one of those names | |
35 | * is flagged as the default. | |
36 | * | |
37 | * <p>This service will do it's best to construct valid Person objects even | |
38 | * for entities that don't have an entity type of "PERSON". In those cases | |
39 | * not all of the attributes on the Person object will be populated. | |
40 | * | |
41 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
42 | * | |
43 | */ | |
44 | public interface PersonService { | |
45 | ||
46 | /** | |
47 | * Retrieve a single Person object by Principal ID. | |
48 | */ | |
49 | Person getPerson( String principalId ); | |
50 | ||
51 | /** | |
52 | * Retrieve a person by an arbitrary external identifier. This method could | |
53 | * potentially return multiple results as there is no guarantee of uniqueness | |
54 | * for external identifiers. | |
55 | * | |
56 | * @param externalIdentifierTypeCode Type of external identifier to search for. | |
57 | * @param externalId The external identifier. | |
58 | * @return List of Person objects. | |
59 | */ | |
60 | List<Person> getPersonByExternalIdentifier( String externalIdentifierTypeCode, String externalId ); | |
61 | ||
62 | /** | |
63 | * Gets a single Person by their principal name (user ID). | |
64 | */ | |
65 | Person getPersonByPrincipalName( String principalName ); | |
66 | ||
67 | /** | |
68 | * Gets a single Person by their employee id. | |
69 | */ | |
70 | Person getPersonByEmployeeId( String employeeId ); | |
71 | ||
72 | /** | |
73 | * Perform an unbounded search for person records. | |
74 | */ | |
75 | List<Person> findPeople( Map<String, String> criteria ); | |
76 | ||
77 | /** | |
78 | * Perform a Person lookup. If bounded, it will follow the configured KNS lookup limit. | |
79 | */ | |
80 | List<Person> findPeople( Map<String, String> criteria, boolean unbounded ); | |
81 | ||
82 | /** | |
83 | * Get the class object which points to the class used by the underlying implementation. | |
84 | * | |
85 | * This can be used by implementors who may need to construct Person objects without wishing to bind their code | |
86 | * to a specific implementation. | |
87 | */ | |
88 | Class<? extends Person> getPersonImplementationClass(); | |
89 | ||
90 | /** | |
91 | * This method takes a map on its way to populate a business object and replaces all | |
92 | * user identifiers with their corresponding universal users | |
93 | */ | |
94 | Map<String, String> resolvePrincipalNamesToPrincipalIds( BusinessObject businessObject, Map<String, String> fieldValues ); | |
95 | ||
96 | /** | |
97 | * Compares the Principal ID passed in with that in the Person object. If they are the same, it returns the | |
98 | * original object. Otherwise, it pulls the Person from KIM based on the sourcePrincipalId. | |
99 | */ | |
100 | Person updatePersonIfNecessary(String sourcePrincipalId, Person currentPerson ); | |
101 | ||
102 | /** | |
103 | * Checks whether the given set of search criteria contain any non-blank properties which need to be applied against | |
104 | * a related Person object. This would be used by the lookup service to determine if special steps need | |
105 | * to be taken when performing a search. | |
106 | */ | |
107 | boolean hasPersonProperty(Class<? extends BusinessObject> businessObjectClass, Map<String,String> fieldValues); | |
108 | ||
109 | ||
110 | /** | |
111 | * Flush all of the role-related caches. | |
112 | */ | |
113 | void flushPersonCaches(); | |
114 | } |