1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.service.impl; |
17 | |
|
18 | |
import java.lang.ref.SoftReference; |
19 | |
import java.security.GeneralSecurityException; |
20 | |
import java.util.ArrayList; |
21 | |
import java.util.Collection; |
22 | |
import java.util.Collections; |
23 | |
import java.util.HashMap; |
24 | |
import java.util.Iterator; |
25 | |
import java.util.List; |
26 | |
import java.util.Map; |
27 | |
|
28 | |
import org.apache.commons.beanutils.PropertyUtils; |
29 | |
import org.apache.commons.lang.StringUtils; |
30 | |
import org.apache.log4j.Logger; |
31 | |
import org.kuali.rice.core.util.MaxAgeSoftReference; |
32 | |
import org.kuali.rice.kim.bo.Person; |
33 | |
import org.kuali.rice.kim.bo.entity.KimPrincipal; |
34 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo; |
35 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityEntityTypeDefaultInfo; |
36 | |
import org.kuali.rice.kim.bo.impl.PersonImpl; |
37 | |
import org.kuali.rice.kim.bo.reference.dto.ExternalIdentifierTypeInfo; |
38 | |
import org.kuali.rice.kim.service.IdentityManagementService; |
39 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
40 | |
import org.kuali.rice.kim.service.PersonService; |
41 | |
import org.kuali.rice.kim.service.RoleManagementService; |
42 | |
import org.kuali.rice.kim.util.KIMPropertyConstants; |
43 | |
import org.kuali.rice.kns.bo.BusinessObject; |
44 | |
import org.kuali.rice.kns.bo.BusinessObjectRelationship; |
45 | |
import org.kuali.rice.kns.lookup.CollectionIncomplete; |
46 | |
import org.kuali.rice.kns.lookup.LookupUtils; |
47 | |
import org.kuali.rice.kns.service.BusinessObjectMetaDataService; |
48 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
49 | |
import org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService; |
50 | |
import org.kuali.rice.kns.util.KNSConstants; |
51 | |
import org.kuali.rice.kns.util.KNSPropertyConstants; |
52 | |
import org.kuali.rice.kns.util.ObjectUtils; |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | 0 | public class PersonServiceImpl implements PersonService<PersonImpl> { |
61 | |
|
62 | 0 | private static Logger LOG = Logger.getLogger( PersonServiceImpl.class ); |
63 | |
protected static final String ENTITY_EXT_ID_PROPERTY_PREFIX = "externalIdentifiers."; |
64 | |
protected static final String ENTITY_AFFILIATION_PROPERTY_PREFIX = "affiliations."; |
65 | |
protected static final String ENTITY_TYPE_PROPERTY_PREFIX = "entityTypes."; |
66 | |
protected static final String ENTITY_EMAIL_PROPERTY_PREFIX = "entityTypes.emailAddresses."; |
67 | |
protected static final String ENTITY_PHONE_PROPERTY_PREFIX = "entityTypes.phoneNumbers."; |
68 | |
protected static final String ENTITY_ADDRESS_PROPERTY_PREFIX = "entityTypes.addresses."; |
69 | |
protected static final String ENTITY_NAME_PROPERTY_PREFIX = "names."; |
70 | |
protected static final String PRINCIPAL_PROPERTY_PREFIX = "principals."; |
71 | |
protected static final String ENTITY_EMPLOYEE_ID_PROPERTY_PREFIX = "employmentInformation."; |
72 | |
|
73 | |
protected static final String EXTENSION = "extension"; |
74 | |
|
75 | |
private IdentityManagementService identityManagementService; |
76 | |
private RoleManagementService roleManagementService; |
77 | |
private BusinessObjectMetaDataService businessObjectMetaDataService; |
78 | |
private MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService; |
79 | |
|
80 | |
|
81 | 0 | protected int personCacheMaxSize = 3000; |
82 | 0 | protected int personCacheMaxAgeSeconds = 3600; |
83 | |
|
84 | 0 | protected Map<String,MaxAgeSoftReference<PersonImpl>> personCache = Collections.synchronizedMap( new HashMap<String,MaxAgeSoftReference<PersonImpl>>( personCacheMaxSize ) ); |
85 | |
|
86 | |
|
87 | 0 | protected List<String> personEntityTypeCodes = new ArrayList<String>( 4 ); |
88 | |
|
89 | 0 | private String personEntityTypeLookupCriteria = null; |
90 | |
|
91 | 0 | protected Map<String,String> baseLookupCriteria = new HashMap<String,String>(); |
92 | 0 | protected Map<String,String> criteriaConversion = new HashMap<String,String>(); |
93 | 0 | protected ArrayList<String> personCachePropertyNames = new ArrayList<String>(); |
94 | |
{ |
95 | |
|
96 | |
|
97 | 0 | baseLookupCriteria.put( KIMPropertyConstants.Person.ACTIVE, "Y" ); |
98 | 0 | baseLookupCriteria.put( ENTITY_TYPE_PROPERTY_PREFIX + KNSPropertyConstants.ACTIVE, "Y" ); |
99 | |
|
100 | |
|
101 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.ENTITY_ID, KIMPropertyConstants.Person.ENTITY_ID ); |
102 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.ACTIVE, PRINCIPAL_PROPERTY_PREFIX + KNSPropertyConstants.ACTIVE ); |
103 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.PRINCIPAL_ID, PRINCIPAL_PROPERTY_PREFIX + KIMPropertyConstants.Person.PRINCIPAL_ID ); |
104 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.PRINCIPAL_NAME, PRINCIPAL_PROPERTY_PREFIX + KIMPropertyConstants.Person.PRINCIPAL_NAME ); |
105 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.FIRST_NAME, "names.firstName" ); |
106 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.LAST_NAME, "names.lastName" ); |
107 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.MIDDLE_NAME, "names.middleName" ); |
108 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EMAIL_ADDRESS, "entityTypes.emailAddresses.emailAddress" ); |
109 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.PHONE_NUMBER, "entityTypes.phoneNumbers.phoneNumber" ); |
110 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.ADDRESS_LINE_1, "entityTypes.addresses.line1" ); |
111 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.ADDRESS_LINE_2, "entityTypes.addresses.line2" ); |
112 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.ADDRESS_LINE_3, "entityTypes.addresses.line3" ); |
113 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.CITY_NAME, "entityTypes.addresses.cityName" ); |
114 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.STATE_CODE, "entityTypes.addresses.stateCode" ); |
115 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.POSTAL_CODE, "entityTypes.addresses.postalCode" ); |
116 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.COUNTRY_CODE, "entityTypes.addresses.countryCode" ); |
117 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.CAMPUS_CODE, "affiliations.campusCode" ); |
118 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.AFFILIATION_TYPE_CODE, "affiliations.affiliationTypeCode" ); |
119 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EXTERNAL_IDENTIFIER_TYPE_CODE, "externalIdentifiers.externalIdentifierTypeCode" ); |
120 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EXTERNAL_ID, "externalIdentifiers.externalId" ); |
121 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EMPLOYEE_TYPE_CODE, "employmentInformation.employeeTypeCode" ); |
122 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EMPLOYEE_STATUS_CODE, "employmentInformation.employeeStatusCode" ); |
123 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.EMPLOYEE_ID, "employmentInformation.employeeId" ); |
124 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.BASE_SALARY_AMOUNT, "employmentInformation.baseSalaryAmount" ); |
125 | 0 | criteriaConversion.put( KIMPropertyConstants.Person.PRIMARY_DEPARTMENT_CODE, "employmentInformation.primaryDepartmentCode" ); |
126 | |
|
127 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.PRINCIPAL_ID ); |
128 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.PRINCIPAL_NAME ); |
129 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.ENTITY_ID ); |
130 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.FIRST_NAME ); |
131 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.LAST_NAME ); |
132 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.MIDDLE_NAME ); |
133 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.CAMPUS_CODE ); |
134 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.EMPLOYEE_ID ); |
135 | 0 | personCachePropertyNames.add( KIMPropertyConstants.Person.PRIMARY_DEPARTMENT_CODE ); |
136 | 0 | } |
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
public PersonImpl getPerson(String principalId) { |
143 | 0 | if ( StringUtils.isBlank(principalId) ) { |
144 | 0 | return null; |
145 | |
} |
146 | 0 | PersonImpl person = null; |
147 | |
|
148 | 0 | person = getPersonImplFromPrincipalIdCache( principalId ); |
149 | 0 | if ( person != null ) { |
150 | 0 | return person; |
151 | |
} |
152 | 0 | KimEntityDefaultInfo entity = null; |
153 | |
|
154 | 0 | KimPrincipal principal = getIdentityManagementService().getPrincipal( principalId ); |
155 | |
|
156 | 0 | if ( principal != null ) { |
157 | 0 | entity = getIdentityManagementService().getEntityDefaultInfo( principal.getEntityId() ); |
158 | |
} |
159 | |
|
160 | |
|
161 | 0 | if ( person == null && entity != null ) { |
162 | 0 | person = convertEntityToPerson( entity, principal ); |
163 | 0 | addPersonImplToCache( person ); |
164 | |
} |
165 | 0 | return person; |
166 | |
} |
167 | |
|
168 | |
protected PersonImpl convertEntityToPerson( KimEntityDefaultInfo entity, KimPrincipal principal ) { |
169 | |
try { |
170 | |
|
171 | 0 | for ( String entityTypeCode : personEntityTypeCodes ) { |
172 | 0 | KimEntityEntityTypeDefaultInfo entType = entity.getEntityType( entityTypeCode ); |
173 | |
|
174 | 0 | if ( entType == null ) { |
175 | 0 | continue; |
176 | |
} |
177 | |
|
178 | |
|
179 | 0 | return new PersonImpl( principal, entity, entityTypeCode ); |
180 | |
} |
181 | 0 | return null; |
182 | 0 | } catch ( Exception ex ) { |
183 | |
|
184 | 0 | if ( ex instanceof RuntimeException ) { |
185 | 0 | throw (RuntimeException)ex; |
186 | |
} else { |
187 | 0 | throw new RuntimeException( "Problem building person object", ex ); |
188 | |
} |
189 | |
} |
190 | |
} |
191 | |
|
192 | |
protected PersonImpl getPersonImplFromPrincipalNameCache( String principalName ) { |
193 | 0 | SoftReference<PersonImpl> personRef = personCache.get( "principalName="+principalName ); |
194 | 0 | if ( personRef != null ) { |
195 | 0 | return personRef.get(); |
196 | |
} |
197 | 0 | return null; |
198 | |
} |
199 | |
|
200 | |
protected PersonImpl getPersonImplFromPrincipalIdCache( String principalId ) { |
201 | 0 | SoftReference<PersonImpl> personRef = personCache.get( "principalId="+principalId ); |
202 | 0 | if ( personRef != null ) { |
203 | 0 | return personRef.get(); |
204 | |
} |
205 | 0 | return null; |
206 | |
} |
207 | |
|
208 | |
protected PersonImpl getPersonImplFromEmployeeIdCache( String principalId ) { |
209 | 0 | SoftReference<PersonImpl> personRef = personCache.get( "employeeId="+principalId ); |
210 | 0 | if ( personRef != null ) { |
211 | 0 | return personRef.get(); |
212 | |
} |
213 | 0 | return null; |
214 | |
} |
215 | |
|
216 | |
protected void addPersonImplToCache( PersonImpl person ) { |
217 | 0 | if ( person != null ) { |
218 | 0 | synchronized (personCache) { |
219 | 0 | personCache.put( "principalName="+person.getPrincipalName(), new MaxAgeSoftReference<PersonImpl>( personCacheMaxAgeSeconds, person ) ); |
220 | 0 | personCache.put( "principalId="+person.getPrincipalId(), new MaxAgeSoftReference<PersonImpl>( personCacheMaxAgeSeconds, person ) ); |
221 | 0 | personCache.put( "employeeId="+person.getEmployeeId(), new MaxAgeSoftReference<PersonImpl>( personCacheMaxAgeSeconds, person ) ); |
222 | 0 | } |
223 | |
} |
224 | 0 | } |
225 | |
|
226 | |
public void flushPersonCaches() { |
227 | 0 | personCache.clear(); |
228 | 0 | } |
229 | |
|
230 | |
|
231 | |
|
232 | |
|
233 | |
|
234 | |
public PersonImpl getPersonByPrincipalName(String principalName) { |
235 | 0 | if ( StringUtils.isBlank(principalName) ) { |
236 | 0 | return null; |
237 | |
} |
238 | 0 | PersonImpl person = null; |
239 | |
|
240 | 0 | person = getPersonImplFromPrincipalNameCache( principalName ); |
241 | 0 | if ( person != null ) { |
242 | 0 | return person; |
243 | |
} |
244 | 0 | KimEntityDefaultInfo entity = null; |
245 | |
|
246 | 0 | KimPrincipal principal = getIdentityManagementService().getPrincipalByPrincipalName( principalName ); |
247 | |
|
248 | 0 | if ( principal != null ) { |
249 | 0 | entity = getIdentityManagementService().getEntityDefaultInfo( principal.getEntityId() ); |
250 | |
} |
251 | |
|
252 | 0 | if ( entity != null ) { |
253 | 0 | person = convertEntityToPerson( entity, principal ); |
254 | |
} |
255 | 0 | addPersonImplToCache( person ); |
256 | 0 | return person; |
257 | |
} |
258 | |
|
259 | |
public PersonImpl getPersonByEmployeeId(String employeeId) { |
260 | 0 | if ( StringUtils.isBlank( employeeId ) ) { |
261 | 0 | return null; |
262 | |
} |
263 | |
|
264 | 0 | PersonImpl person = getPersonImplFromEmployeeIdCache( employeeId ); |
265 | 0 | if ( person != null ) { |
266 | 0 | return person; |
267 | |
} |
268 | |
|
269 | 0 | Map<String,String> criteria = new HashMap<String,String>( 1 ); |
270 | 0 | criteria.put( KIMPropertyConstants.Person.EMPLOYEE_ID, employeeId ); |
271 | 0 | List<PersonImpl> people = findPeople( criteria ); |
272 | 0 | if ( !people.isEmpty() ) { |
273 | 0 | person = people.get(0); |
274 | 0 | addPersonImplToCache( person ); |
275 | |
} |
276 | 0 | return person; |
277 | |
} |
278 | |
|
279 | |
|
280 | |
|
281 | |
|
282 | |
public List<PersonImpl> findPeople(Map<String, String> criteria) { |
283 | 0 | return findPeople(criteria, true); |
284 | |
} |
285 | |
|
286 | |
|
287 | |
|
288 | |
|
289 | |
public List<PersonImpl> findPeople(Map<String, String> criteria, boolean unbounded) { |
290 | 0 | List<PersonImpl> people = null; |
291 | |
|
292 | 0 | if ( criteria == null ) { |
293 | 0 | criteria = Collections.emptyMap(); |
294 | |
} |
295 | |
|
296 | 0 | criteria = new HashMap<String, String>( criteria ); |
297 | |
|
298 | |
|
299 | 0 | String roleName = criteria.get( "lookupRoleName" ); |
300 | 0 | String namespaceCode = criteria.get( "lookupRoleNamespaceCode" ); |
301 | 0 | criteria.remove("lookupRoleName"); |
302 | 0 | criteria.remove("lookupRoleNamespaceCode"); |
303 | 0 | if ( StringUtils.isNotBlank(namespaceCode) && StringUtils.isNotBlank(roleName) ) { |
304 | 0 | int searchResultsLimit = LookupUtils.getSearchResultsLimit(PersonImpl.class); |
305 | 0 | if ( LOG.isDebugEnabled() ) { |
306 | 0 | LOG.debug("Performing Person search including role filter: " + namespaceCode + "/" + roleName ); |
307 | |
} |
308 | 0 | if ( criteria.size() == 1 && criteria.containsKey(KIMPropertyConstants.Person.ACTIVE) ) { |
309 | 0 | if ( LOG.isDebugEnabled() ) { |
310 | 0 | LOG.debug( "Only active criteria specified, running role search first" ); |
311 | |
} |
312 | |
|
313 | 0 | Collection<String> principalIds = getRoleManagementService().getRoleMemberPrincipalIds(namespaceCode, roleName, null); |
314 | 0 | StringBuffer sb = new StringBuffer(principalIds.size()*15); |
315 | 0 | Iterator<String> pi = principalIds.iterator(); |
316 | 0 | while ( pi.hasNext() ) { |
317 | 0 | sb.append( pi.next() ); |
318 | 0 | if ( pi.hasNext() ) sb.append( '|' ); |
319 | |
} |
320 | |
|
321 | 0 | criteria.put( KIMPropertyConstants.Person.PRINCIPAL_ID, sb.toString() ); |
322 | 0 | people = findPeopleInternal(criteria, false); |
323 | 0 | } else if ( !criteria.isEmpty() ) { |
324 | 0 | if ( LOG.isDebugEnabled() ) { |
325 | 0 | LOG.debug( "Person criteria also specified, running that search first" ); |
326 | |
} |
327 | |
|
328 | 0 | people = findPeopleInternal(criteria, true); |
329 | |
|
330 | |
|
331 | 0 | List<String> principalIds = peopleToPrincipalIds( people ); |
332 | |
|
333 | 0 | principalIds = getRoleManagementService().getPrincipalIdSubListWithRole(principalIds, namespaceCode, roleName, null); |
334 | |
|
335 | 0 | if ( !unbounded && principalIds.size() > searchResultsLimit ) { |
336 | 0 | int actualResultSize = principalIds.size(); |
337 | |
|
338 | 0 | principalIds = new ArrayList<String>(principalIds).subList(0, searchResultsLimit); |
339 | 0 | people = getPeople(principalIds); |
340 | 0 | people = new CollectionIncomplete<PersonImpl>( people.subList(0, searchResultsLimit), new Long(actualResultSize) ); |
341 | 0 | } else { |
342 | 0 | people = getPeople(principalIds); |
343 | |
} |
344 | 0 | } else { |
345 | 0 | if ( LOG.isDebugEnabled() ) { |
346 | 0 | LOG.debug( "No Person criteria specified - only using role service." ); |
347 | |
} |
348 | |
|
349 | 0 | Collection<String> principalIds = getRoleManagementService().getRoleMemberPrincipalIds(namespaceCode, roleName, null); |
350 | 0 | if ( !unbounded && principalIds.size() > searchResultsLimit ) { |
351 | 0 | int actualResultSize = principalIds.size(); |
352 | |
|
353 | 0 | principalIds = new ArrayList<String>(principalIds).subList(0, searchResultsLimit); |
354 | 0 | people = getPeople(principalIds); |
355 | 0 | people = new CollectionIncomplete<PersonImpl>( people.subList(0, searchResultsLimit), new Long(actualResultSize) ); |
356 | 0 | } else { |
357 | 0 | people = getPeople(principalIds); |
358 | |
} |
359 | |
} |
360 | 0 | } else { |
361 | 0 | if ( LOG.isDebugEnabled() ) { |
362 | 0 | LOG.debug( "No Role criteria specified, running person lookup as normal." ); |
363 | |
} |
364 | 0 | people = findPeopleInternal(criteria, unbounded); |
365 | |
} |
366 | 0 | return people; |
367 | |
} |
368 | |
|
369 | |
@SuppressWarnings("unchecked") |
370 | |
protected List<PersonImpl> findPeopleInternal(Map<String,String> criteria, boolean unbounded ) { |
371 | |
|
372 | 0 | Map<String,String> entityCriteria = convertPersonPropertiesToEntityProperties( criteria ); |
373 | |
|
374 | 0 | List<PersonImpl> people = new ArrayList<PersonImpl>(); |
375 | |
|
376 | 0 | List<? extends KimEntityDefaultInfo> entities = getIdentityManagementService().lookupEntityDefaultInfo( entityCriteria, unbounded ); |
377 | |
|
378 | 0 | for ( KimEntityDefaultInfo e : entities ) { |
379 | |
|
380 | 0 | for ( KimPrincipal p : e.getPrincipals() ) { |
381 | 0 | people.add( convertEntityToPerson( e, p ) ); |
382 | |
} |
383 | |
} |
384 | |
|
385 | 0 | if ( entities instanceof CollectionIncomplete ) { |
386 | 0 | return new CollectionIncomplete( people, ((CollectionIncomplete)entities).getActualSizeIfTruncated() ); |
387 | |
} |
388 | 0 | return people; |
389 | |
} |
390 | |
|
391 | |
public Map<String,String> convertPersonPropertiesToEntityProperties( Map<String,String> criteria ) { |
392 | 0 | if ( LOG.isDebugEnabled() ) { |
393 | 0 | LOG.debug( "convertPersonPropertiesToEntityProperties: " + criteria ); |
394 | |
} |
395 | 0 | boolean nameCriteria = false; |
396 | 0 | boolean addressCriteria = false; |
397 | 0 | boolean externalIdentifierCriteria = false; |
398 | 0 | boolean affiliationCriteria = false; |
399 | 0 | boolean affiliationDefaultOnlyCriteria = false; |
400 | 0 | boolean phoneCriteria = false; |
401 | 0 | boolean emailCriteria = false; |
402 | 0 | boolean employeeIdCriteria = false; |
403 | |
|
404 | 0 | HashMap<String,String> newCriteria = new HashMap<String,String>(); |
405 | 0 | newCriteria.putAll( baseLookupCriteria ); |
406 | 0 | newCriteria.put( "entityTypes.entityTypeCode", personEntityTypeLookupCriteria ); |
407 | 0 | if ( criteria != null ) { |
408 | 0 | for ( String key : criteria.keySet() ) { |
409 | |
|
410 | |
|
411 | 0 | if(key.equals(KIMPropertyConstants.Person.ACTIVE)) { |
412 | 0 | newCriteria.put(KIMPropertyConstants.Person.ACTIVE, criteria.get(KIMPropertyConstants.Person.ACTIVE)); |
413 | |
} |
414 | |
|
415 | |
|
416 | 0 | if ( StringUtils.isEmpty( criteria.get(key) ) ) { |
417 | 0 | continue; |
418 | |
} |
419 | |
|
420 | |
|
421 | 0 | if ( key.equals( KIMPropertyConstants.Person.EXTERNAL_ID ) && StringUtils.isNotBlank(criteria.get(key)) ) { |
422 | |
|
423 | 0 | if ( criteria.containsKey( KIMPropertyConstants.Person.EXTERNAL_IDENTIFIER_TYPE_CODE ) ) { |
424 | 0 | String extIdTypeCode = criteria.get(KIMPropertyConstants.Person.EXTERNAL_IDENTIFIER_TYPE_CODE); |
425 | 0 | if ( StringUtils.isNotBlank(extIdTypeCode) ) { |
426 | |
|
427 | 0 | ExternalIdentifierTypeInfo extIdType = getIdentityManagementService().getExternalIdentifierType(extIdTypeCode); |
428 | |
|
429 | 0 | if ( extIdType != null && extIdType.isEncryptionRequired() ) { |
430 | |
try { |
431 | 0 | criteria.put(key, |
432 | |
KNSServiceLocator.getEncryptionService().encrypt(criteria.get(key)) |
433 | |
); |
434 | 0 | } catch (GeneralSecurityException ex) { |
435 | 0 | LOG.error("Unable to encrypt value for external ID search of type " + extIdTypeCode, ex ); |
436 | 0 | } |
437 | |
} |
438 | |
} |
439 | |
} |
440 | |
} |
441 | |
|
442 | |
|
443 | 0 | String entityProperty = criteriaConversion.get( key ); |
444 | 0 | if ( entityProperty != null ) { |
445 | 0 | newCriteria.put( entityProperty, criteria.get( key ) ); |
446 | |
} else { |
447 | 0 | entityProperty = key; |
448 | |
|
449 | 0 | newCriteria.put( key, criteria.get( key ) ); |
450 | |
} |
451 | |
|
452 | 0 | if ( isNameEntityCriteria( entityProperty ) ) { |
453 | 0 | nameCriteria = true; |
454 | |
} |
455 | 0 | if ( isExternalIdentifierEntityCriteria( entityProperty ) ) { |
456 | 0 | externalIdentifierCriteria = true; |
457 | |
} |
458 | 0 | if ( isAffiliationEntityCriteria( entityProperty ) ) { |
459 | 0 | affiliationCriteria = true; |
460 | |
} |
461 | 0 | if ( isAddressEntityCriteria( entityProperty ) ) { |
462 | 0 | addressCriteria = true; |
463 | |
} |
464 | 0 | if ( isPhoneEntityCriteria( entityProperty ) ) { |
465 | 0 | phoneCriteria = true; |
466 | |
} |
467 | 0 | if ( isEmailEntityCriteria( entityProperty ) ) { |
468 | 0 | emailCriteria = true; |
469 | |
} |
470 | 0 | if ( isEmployeeIdEntityCriteria( entityProperty ) ) { |
471 | 0 | employeeIdCriteria = true; |
472 | |
} |
473 | |
|
474 | |
|
475 | 0 | if ( key.equals( "campusCode" ) ) { |
476 | 0 | affiliationDefaultOnlyCriteria = true; |
477 | |
} |
478 | 0 | } |
479 | 0 | if ( nameCriteria ) { |
480 | 0 | newCriteria.put( ENTITY_NAME_PROPERTY_PREFIX + "active", "Y" ); |
481 | 0 | newCriteria.put( ENTITY_NAME_PROPERTY_PREFIX + "dflt", "Y" ); |
482 | |
|
483 | |
} |
484 | 0 | if ( addressCriteria ) { |
485 | 0 | newCriteria.put( ENTITY_ADDRESS_PROPERTY_PREFIX + "active", "Y" ); |
486 | 0 | newCriteria.put( ENTITY_ADDRESS_PROPERTY_PREFIX + "dflt", "Y" ); |
487 | |
} |
488 | 0 | if ( phoneCriteria ) { |
489 | 0 | newCriteria.put( ENTITY_PHONE_PROPERTY_PREFIX + "active", "Y" ); |
490 | 0 | newCriteria.put( ENTITY_PHONE_PROPERTY_PREFIX + "dflt", "Y" ); |
491 | |
} |
492 | 0 | if ( emailCriteria ) { |
493 | 0 | newCriteria.put( ENTITY_EMAIL_PROPERTY_PREFIX + "active", "Y" ); |
494 | 0 | newCriteria.put( ENTITY_EMAIL_PROPERTY_PREFIX + "dflt", "Y" ); |
495 | |
} |
496 | 0 | if ( employeeIdCriteria ) { |
497 | 0 | newCriteria.put( ENTITY_EMPLOYEE_ID_PROPERTY_PREFIX + "active", "Y" ); |
498 | 0 | newCriteria.put( ENTITY_EMPLOYEE_ID_PROPERTY_PREFIX + "primary", "Y" ); |
499 | |
} |
500 | 0 | if ( affiliationCriteria ) { |
501 | 0 | newCriteria.put( ENTITY_AFFILIATION_PROPERTY_PREFIX + "active", "Y" ); |
502 | |
} |
503 | 0 | if ( affiliationDefaultOnlyCriteria ) { |
504 | 0 | newCriteria.put( ENTITY_AFFILIATION_PROPERTY_PREFIX + "dflt", "Y" ); |
505 | |
} |
506 | 0 | if ( externalIdentifierCriteria ) { |
507 | 0 | newCriteria.put( ENTITY_EXT_ID_PROPERTY_PREFIX + "active", "Y" ); |
508 | |
} |
509 | |
} |
510 | |
|
511 | 0 | if ( LOG.isDebugEnabled() ) { |
512 | 0 | LOG.debug( "Converted: " + newCriteria ); |
513 | |
} |
514 | 0 | return newCriteria; |
515 | |
} |
516 | |
|
517 | |
protected boolean isNameEntityCriteria( String propertyName ) { |
518 | 0 | return propertyName.startsWith( ENTITY_NAME_PROPERTY_PREFIX ); |
519 | |
} |
520 | |
protected boolean isAddressEntityCriteria( String propertyName ) { |
521 | 0 | return propertyName.startsWith( ENTITY_ADDRESS_PROPERTY_PREFIX ); |
522 | |
} |
523 | |
protected boolean isPhoneEntityCriteria( String propertyName ) { |
524 | 0 | return propertyName.startsWith( ENTITY_PHONE_PROPERTY_PREFIX ); |
525 | |
} |
526 | |
protected boolean isEmailEntityCriteria( String propertyName ) { |
527 | 0 | return propertyName.startsWith( ENTITY_EMAIL_PROPERTY_PREFIX ); |
528 | |
} |
529 | |
protected boolean isEmployeeIdEntityCriteria( String propertyName ) { |
530 | 0 | return propertyName.startsWith( ENTITY_EMPLOYEE_ID_PROPERTY_PREFIX ); |
531 | |
} |
532 | |
protected boolean isAffiliationEntityCriteria( String propertyName ) { |
533 | 0 | return propertyName.startsWith( ENTITY_AFFILIATION_PROPERTY_PREFIX ); |
534 | |
} |
535 | |
protected boolean isExternalIdentifierEntityCriteria( String propertyName ) { |
536 | 0 | return propertyName.startsWith( ENTITY_EXT_ID_PROPERTY_PREFIX ); |
537 | |
} |
538 | |
|
539 | |
|
540 | |
|
541 | |
|
542 | |
|
543 | |
|
544 | |
public List<String> getPersonEntityTypeCodes() { |
545 | 0 | return this.personEntityTypeCodes; |
546 | |
} |
547 | |
|
548 | |
public void setPersonEntityTypeCodes(List<String> personEntityTypeCodes) { |
549 | 0 | this.personEntityTypeCodes = personEntityTypeCodes; |
550 | 0 | personEntityTypeLookupCriteria = null; |
551 | 0 | for ( String entityTypeCode : personEntityTypeCodes ) { |
552 | 0 | if ( personEntityTypeLookupCriteria == null ) { |
553 | 0 | personEntityTypeLookupCriteria = entityTypeCode; |
554 | |
} else { |
555 | 0 | personEntityTypeLookupCriteria = personEntityTypeLookupCriteria + "|" + entityTypeCode; |
556 | |
} |
557 | |
} |
558 | 0 | } |
559 | |
|
560 | |
|
561 | |
protected List<PersonImpl> getPeople( Collection<String> principalIds ) { |
562 | 0 | List<PersonImpl> people = new ArrayList<PersonImpl>( principalIds.size() ); |
563 | 0 | for ( String principalId : principalIds ) { |
564 | 0 | people.add( getPerson(principalId) ); |
565 | |
} |
566 | 0 | return people; |
567 | |
} |
568 | |
|
569 | |
protected List<String> peopleToPrincipalIds( List<? extends Person> people ) { |
570 | 0 | List<String> principalIds = new ArrayList<String>(); |
571 | |
|
572 | 0 | for ( Person person : people ) { |
573 | 0 | principalIds.add( person.getPrincipalId() ); |
574 | |
} |
575 | |
|
576 | 0 | return principalIds; |
577 | |
} |
578 | |
|
579 | |
|
580 | |
|
581 | |
|
582 | |
public List<PersonImpl> getPersonByExternalIdentifier(String externalIdentifierTypeCode, String externalId) { |
583 | 0 | if (StringUtils.isBlank( externalIdentifierTypeCode ) || StringUtils.isBlank( externalId ) ) { |
584 | 0 | return null; |
585 | |
} |
586 | 0 | Map<String,String> criteria = new HashMap<String,String>( 2 ); |
587 | 0 | criteria.put( KIMPropertyConstants.Person.EXTERNAL_IDENTIFIER_TYPE_CODE, externalIdentifierTypeCode ); |
588 | 0 | criteria.put( KIMPropertyConstants.Person.EXTERNAL_ID, externalId ); |
589 | 0 | return findPeople( criteria ); |
590 | |
} |
591 | |
|
592 | |
|
593 | |
|
594 | |
|
595 | |
public Person updatePersonIfNecessary(String sourcePrincipalId, Person currentPerson ) { |
596 | 0 | if (currentPerson == null |
597 | |
|| !StringUtils.equals(sourcePrincipalId, currentPerson.getPrincipalId() ) |
598 | |
|| currentPerson.getEntityId() == null ) { |
599 | 0 | Person person = getPerson( sourcePrincipalId ); |
600 | |
|
601 | |
|
602 | 0 | if ( person == null ) { |
603 | 0 | if ( currentPerson != null && currentPerson.getEntityId() == null ) { |
604 | 0 | return currentPerson; |
605 | |
} |
606 | |
} |
607 | |
|
608 | 0 | if ( person == null && currentPerson == null ) { |
609 | |
try { |
610 | 0 | return new PersonImpl(); |
611 | 0 | } catch ( Exception ex ) { |
612 | 0 | LOG.error( "unable to instantiate an object of type: " + getPersonImplementationClass() + " - returning null", ex ); |
613 | 0 | return null; |
614 | |
} |
615 | |
} |
616 | 0 | return person; |
617 | |
} |
618 | |
|
619 | 0 | return currentPerson; |
620 | |
} |
621 | |
|
622 | |
|
623 | |
|
624 | |
|
625 | |
|
626 | |
private Map<String,String> getNonPersonSearchCriteria( BusinessObject bo, Map<String,String> fieldValues) { |
627 | 0 | Map<String,String> nonUniversalUserSearchCriteria = new HashMap<String,String>(); |
628 | 0 | for ( String propertyName : fieldValues.keySet() ) { |
629 | 0 | if (!isPersonProperty(bo, propertyName)) { |
630 | 0 | nonUniversalUserSearchCriteria.put(propertyName, fieldValues.get(propertyName)); |
631 | |
} |
632 | |
} |
633 | 0 | return nonUniversalUserSearchCriteria; |
634 | |
} |
635 | |
|
636 | |
|
637 | |
private boolean isPersonProperty(BusinessObject bo, String propertyName) { |
638 | |
try { |
639 | 0 | if ( ObjectUtils.isNestedAttribute( propertyName ) |
640 | |
&& !StringUtils.contains(propertyName, "add.") ) { |
641 | 0 | Class<?> type = PropertyUtils.getPropertyType(bo, ObjectUtils.getNestedAttributePrefix( propertyName )); |
642 | |
|
643 | 0 | if ( type != null ) { |
644 | 0 | return Person.class.isAssignableFrom(type); |
645 | |
} else { |
646 | 0 | LOG.warn( "Unable to determine type of nested property: " + bo.getClass().getName() + " / " + propertyName ); |
647 | |
} |
648 | |
} |
649 | 0 | } catch (Exception ex) { |
650 | 0 | if ( LOG.isDebugEnabled() ) { |
651 | 0 | LOG.debug("Unable to determine if property on " + bo.getClass().getName() + " to a person object: " + propertyName, ex ); |
652 | |
} |
653 | 0 | } |
654 | 0 | return false; |
655 | |
} |
656 | |
|
657 | |
|
658 | |
|
659 | |
|
660 | |
public boolean hasPersonProperty(Class<? extends BusinessObject> businessObjectClass, Map<String,String> fieldValues) { |
661 | 0 | if ( businessObjectClass == null || fieldValues == null ) { |
662 | 0 | return false; |
663 | |
} |
664 | |
try { |
665 | 0 | BusinessObject bo = businessObjectClass.newInstance(); |
666 | 0 | for ( String propertyName : fieldValues.keySet() ) { |
667 | 0 | if (isPersonProperty(bo, propertyName)) { |
668 | 0 | return true; |
669 | |
} |
670 | |
} |
671 | 0 | } catch (Exception ex) { |
672 | 0 | if ( LOG.isDebugEnabled() ) { |
673 | 0 | LOG.debug( "Error instantiating business object class passed into hasPersonProperty", ex ); |
674 | |
} |
675 | |
|
676 | 0 | } |
677 | 0 | return false; |
678 | |
} |
679 | |
|
680 | |
|
681 | |
|
682 | |
|
683 | |
@SuppressWarnings("unchecked") |
684 | |
public Map<String,String> resolvePrincipalNamesToPrincipalIds(BusinessObject businessObject, Map<String,String> fieldValues) { |
685 | 0 | if ( fieldValues == null ) { |
686 | 0 | return null; |
687 | |
} |
688 | 0 | if ( businessObject == null ) { |
689 | 0 | return fieldValues; |
690 | |
} |
691 | 0 | StringBuffer resolvedPrincipalIdPropertyName = new StringBuffer(); |
692 | |
|
693 | |
|
694 | 0 | Map<String,String> processedFieldValues = getNonPersonSearchCriteria(businessObject, fieldValues); |
695 | 0 | for ( String propertyName : fieldValues.keySet() ) { |
696 | 0 | if ( !StringUtils.isBlank(fieldValues.get(propertyName)) |
697 | |
&& isPersonProperty(businessObject, propertyName) |
698 | |
) { |
699 | |
|
700 | 0 | String personPropertyName = ObjectUtils.getNestedAttributePrimitive( propertyName ); |
701 | |
|
702 | 0 | if ( StringUtils.equals( KIMPropertyConstants.Person.PRINCIPAL_NAME, personPropertyName) ) { |
703 | 0 | Class targetBusinessObjectClass = null; |
704 | 0 | BusinessObject targetBusinessObject = null; |
705 | 0 | resolvedPrincipalIdPropertyName.setLength( 0 ); |
706 | |
|
707 | |
|
708 | 0 | String personReferenceObjectPropertyName = ObjectUtils.getNestedAttributePrefix( propertyName ); |
709 | |
|
710 | |
|
711 | 0 | if ( ObjectUtils.isNestedAttribute( personReferenceObjectPropertyName ) ) { |
712 | 0 | String targetBusinessObjectPropertyName = ObjectUtils.getNestedAttributePrefix( personReferenceObjectPropertyName ); |
713 | 0 | targetBusinessObject = (BusinessObject)ObjectUtils.getPropertyValue( businessObject, targetBusinessObjectPropertyName ); |
714 | 0 | if (targetBusinessObject != null) { |
715 | 0 | targetBusinessObjectClass = targetBusinessObject.getClass(); |
716 | 0 | resolvedPrincipalIdPropertyName.append(targetBusinessObjectPropertyName).append("."); |
717 | |
} else { |
718 | 0 | LOG.error("Could not find target property '"+propertyName+"' in class "+businessObject.getClass().getName()+". Property value was null."); |
719 | |
} |
720 | 0 | } else { |
721 | 0 | targetBusinessObjectClass = businessObject.getClass(); |
722 | 0 | targetBusinessObject = businessObject; |
723 | |
} |
724 | |
|
725 | 0 | if (targetBusinessObjectClass != null) { |
726 | |
|
727 | |
|
728 | |
|
729 | 0 | String propName = ObjectUtils.getNestedAttributePrimitive( personReferenceObjectPropertyName ); |
730 | 0 | BusinessObjectRelationship rel = getBusinessObjectMetaDataService().getBusinessObjectRelationship( targetBusinessObject, propName ); |
731 | 0 | if ( rel != null ) { |
732 | 0 | String sourcePrimitivePropertyName = rel.getParentAttributeForChildAttribute(KIMPropertyConstants.Person.PRINCIPAL_ID); |
733 | 0 | resolvedPrincipalIdPropertyName.append(sourcePrimitivePropertyName); |
734 | |
|
735 | 0 | String principalName = fieldValues.get( propertyName ); |
736 | 0 | KimPrincipal principal = getIdentityManagementService().getPrincipalByPrincipalName( principalName ); |
737 | 0 | if (principal != null ) { |
738 | 0 | processedFieldValues.put(resolvedPrincipalIdPropertyName.toString(), principal.getPrincipalId()); |
739 | |
} else { |
740 | 0 | processedFieldValues.put(resolvedPrincipalIdPropertyName.toString(), null); |
741 | |
try { |
742 | |
|
743 | |
|
744 | |
|
745 | |
|
746 | 0 | ObjectUtils.setObjectProperty(targetBusinessObject, resolvedPrincipalIdPropertyName.toString(), null ); |
747 | 0 | ObjectUtils.setObjectProperty(targetBusinessObject, propName, null ); |
748 | 0 | ObjectUtils.setObjectProperty(targetBusinessObject, propName + ".principalName", principalName ); |
749 | 0 | } catch ( Exception ex ) { |
750 | 0 | LOG.error( "Unable to blank out the person object after finding that the person with the given principalName does not exist.", ex ); |
751 | 0 | } |
752 | |
} |
753 | 0 | } else { |
754 | 0 | LOG.error( "Missing relationship for " + propName + " on " + targetBusinessObjectClass.getName() ); |
755 | |
} |
756 | 0 | } else { |
757 | 0 | processedFieldValues.put(resolvedPrincipalIdPropertyName.toString(), null); |
758 | |
} |
759 | |
} |
760 | |
|
761 | |
|
762 | |
|
763 | 0 | } else if (propertyName.endsWith("." + KIMPropertyConstants.Person.PRINCIPAL_NAME)){ |
764 | |
|
765 | 0 | String principalName = fieldValues.get(propertyName); |
766 | 0 | if ( StringUtils.isNotEmpty( principalName ) ) { |
767 | 0 | String containerPropertyName = propertyName; |
768 | 0 | if (containerPropertyName.startsWith(KNSConstants.MAINTENANCE_ADD_PREFIX)) { |
769 | 0 | containerPropertyName = StringUtils.substringAfter( propertyName, KNSConstants.MAINTENANCE_ADD_PREFIX ); |
770 | |
} |
771 | |
|
772 | |
|
773 | |
|
774 | 0 | if ( ObjectUtils.isNestedAttribute( containerPropertyName ) ) { |
775 | |
|
776 | 0 | String collectionName = StringUtils.substringBefore( containerPropertyName, "." ); |
777 | |
|
778 | |
|
779 | |
|
780 | 0 | Class<? extends BusinessObject> collectionBusinessObjectClass = getMaintenanceDocumentDictionaryService() |
781 | |
.getCollectionBusinessObjectClass( |
782 | |
getMaintenanceDocumentDictionaryService() |
783 | |
.getDocumentTypeName(businessObject.getClass()), collectionName); |
784 | 0 | if (collectionBusinessObjectClass != null) { |
785 | |
|
786 | |
|
787 | 0 | List<BusinessObjectRelationship> relationships = |
788 | |
getBusinessObjectMetaDataService().getBusinessObjectRelationships( collectionBusinessObjectClass ); |
789 | |
|
790 | |
|
791 | 0 | for ( BusinessObjectRelationship rel : relationships ) { |
792 | 0 | String parentAttribute = rel.getParentAttributeForChildAttribute( KIMPropertyConstants.Person.PRINCIPAL_ID ); |
793 | 0 | if ( parentAttribute == null ) { |
794 | 0 | continue; |
795 | |
} |
796 | |
|
797 | 0 | processedFieldValues.remove( propertyName ); |
798 | 0 | String fieldPrefix = StringUtils.substringBeforeLast( StringUtils.substringBeforeLast( propertyName, "." + KIMPropertyConstants.Person.PRINCIPAL_NAME ), "." ); |
799 | 0 | String relatedPrincipalIdPropertyName = fieldPrefix + "." + parentAttribute; |
800 | |
|
801 | 0 | if(EXTENSION.equals(StringUtils.substringAfterLast(fieldPrefix, ".")) && EXTENSION.equals(StringUtils.substringBefore(parentAttribute, "."))) |
802 | |
{ |
803 | 0 | relatedPrincipalIdPropertyName = fieldPrefix + "." + StringUtils.substringAfter(parentAttribute, "."); |
804 | |
} |
805 | 0 | String currRelatedPersonPrincipalId = processedFieldValues.get(relatedPrincipalIdPropertyName); |
806 | 0 | if ( StringUtils.isBlank( currRelatedPersonPrincipalId ) ) { |
807 | 0 | KimPrincipal principal = getIdentityManagementService().getPrincipalByPrincipalName( principalName ); |
808 | 0 | if ( principal != null ) { |
809 | 0 | processedFieldValues.put(relatedPrincipalIdPropertyName, principal.getPrincipalId()); |
810 | |
} else { |
811 | 0 | processedFieldValues.put(relatedPrincipalIdPropertyName, null); |
812 | |
} |
813 | |
} |
814 | 0 | } |
815 | 0 | } else { |
816 | 0 | if ( LOG.isDebugEnabled() ) { |
817 | 0 | LOG.debug( "Unable to determine class for collection referenced as part of property: " + containerPropertyName + " on " + businessObject.getClass().getName() ); |
818 | |
} |
819 | |
} |
820 | 0 | } else { |
821 | 0 | if ( LOG.isDebugEnabled() ) { |
822 | 0 | LOG.debug( "Non-nested property ending with 'principalName': " + containerPropertyName + " on " + businessObject.getClass().getName() ); |
823 | |
} |
824 | |
} |
825 | |
} |
826 | 0 | } |
827 | |
} |
828 | 0 | return processedFieldValues; |
829 | |
} |
830 | |
|
831 | |
|
832 | |
|
833 | |
protected IdentityManagementService getIdentityManagementService() { |
834 | 0 | if ( identityManagementService == null ) { |
835 | 0 | identityManagementService = KIMServiceLocator.getIdentityManagementService(); |
836 | |
} |
837 | 0 | return identityManagementService; |
838 | |
} |
839 | |
|
840 | |
protected RoleManagementService getRoleManagementService() { |
841 | 0 | if ( roleManagementService == null ) { |
842 | 0 | roleManagementService = KIMServiceLocator.getRoleManagementService(); |
843 | |
} |
844 | 0 | return roleManagementService; |
845 | |
} |
846 | |
|
847 | |
|
848 | |
public Class<? extends Person> getPersonImplementationClass() { |
849 | 0 | return PersonImpl.class; |
850 | |
} |
851 | |
|
852 | |
protected BusinessObjectMetaDataService getBusinessObjectMetaDataService() { |
853 | 0 | if ( businessObjectMetaDataService == null ) { |
854 | 0 | businessObjectMetaDataService = KNSServiceLocator.getBusinessObjectMetaDataService(); |
855 | |
} |
856 | 0 | return businessObjectMetaDataService; |
857 | |
} |
858 | |
|
859 | |
protected MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() { |
860 | 0 | if ( maintenanceDocumentDictionaryService == null ) { |
861 | 0 | maintenanceDocumentDictionaryService = KNSServiceLocator.getMaintenanceDocumentDictionaryService(); |
862 | |
} |
863 | 0 | return maintenanceDocumentDictionaryService; |
864 | |
} |
865 | |
|
866 | |
public void setPersonCacheMaxSize(int personCacheMaxSize) { |
867 | 0 | this.personCacheMaxSize = personCacheMaxSize; |
868 | 0 | } |
869 | |
|
870 | |
public void setPersonCacheMaxAgeSeconds(int personCacheMaxAgeSeconds) { |
871 | 0 | this.personCacheMaxAgeSeconds = personCacheMaxAgeSeconds; |
872 | 0 | } |
873 | |
|
874 | |
} |