1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.kim.mock; |
17 | |
|
18 | |
import java.util.Arrays; |
19 | |
import java.util.HashMap; |
20 | |
import java.util.List; |
21 | |
import java.util.Map; |
22 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityAddressInfo; |
23 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityAffiliationInfo; |
24 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityBioDemographicsInfo; |
25 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo; |
26 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityEmailInfo; |
27 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityEmploymentInformationInfo; |
28 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityEntityTypeDefaultInfo; |
29 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityEntityTypeInfo; |
30 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityExternalIdentifierInfo; |
31 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityInfo; |
32 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityNameInfo; |
33 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityNamePrincipalNameInfo; |
34 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityPrivacyPreferencesInfo; |
35 | |
import org.kuali.rice.kim.bo.entity.dto.KimPrincipalInfo; |
36 | |
import org.kuali.rice.kim.bo.reference.dto.AddressTypeInfo; |
37 | |
import org.kuali.rice.kim.bo.reference.dto.AffiliationTypeInfo; |
38 | |
import org.kuali.rice.kim.bo.reference.dto.CitizenshipStatusInfo; |
39 | |
import org.kuali.rice.kim.bo.reference.dto.EmailTypeInfo; |
40 | |
import org.kuali.rice.kim.bo.reference.dto.EmploymentStatusInfo; |
41 | |
import org.kuali.rice.kim.bo.reference.dto.EmploymentTypeInfo; |
42 | |
import org.kuali.rice.kim.bo.reference.dto.EntityNameTypeInfo; |
43 | |
import org.kuali.rice.kim.bo.reference.dto.EntityTypeInfo; |
44 | |
import org.kuali.rice.kim.bo.reference.dto.ExternalIdentifierTypeInfo; |
45 | |
import org.kuali.rice.kim.bo.reference.dto.PhoneTypeInfo; |
46 | |
import org.kuali.rice.kim.service.IdentityService; |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | 4 | public class MockIdentityServiceImpl implements IdentityService { |
52 | |
|
53 | |
@Override |
54 | |
public AddressTypeInfo getAddressType(String code) { |
55 | 0 | for (AddressTypeEnum at : AddressTypeEnum.values()) { |
56 | 0 | if (at.getCode().equals(code)) { |
57 | 0 | AddressTypeInfo info = new AddressTypeInfo(); |
58 | 0 | info.setActive(at.isActive()); |
59 | 0 | info.setAddressTypeCode(at.getCode()); |
60 | 0 | info.setAddressTypeName(at.getName()); |
61 | 0 | info.setDisplaySortCode(at.getSort()); |
62 | 0 | info.setCode(at.getCode()); |
63 | 0 | info.setName(at.getName()); |
64 | 0 | return info; |
65 | |
} |
66 | |
} |
67 | 0 | return null; |
68 | |
} |
69 | |
|
70 | |
@Override |
71 | |
public AffiliationTypeInfo getAffiliationType(String code) { |
72 | 0 | for (AffiliationTypeEnum aff : AffiliationTypeEnum.values()) { |
73 | 0 | if (aff.getCode().equals(code)) { |
74 | 0 | AffiliationTypeInfo info = new AffiliationTypeInfo(); |
75 | 0 | info.setActive(aff.isActive()); |
76 | 0 | info.setAffiliationTypeCode(aff.getCode()); |
77 | 0 | info.setAffiliationTypeName(aff.getName()); |
78 | 0 | info.setCode(aff.getCode()); |
79 | 0 | info.setName(aff.getName()); |
80 | 0 | info.setDisplaySortCode(aff.getSort()); |
81 | 0 | return info; |
82 | |
} |
83 | |
} |
84 | 0 | return null; |
85 | |
} |
86 | |
|
87 | |
@Override |
88 | |
public CitizenshipStatusInfo getCitizenshipStatus(String code) { |
89 | 0 | throw new UnsupportedOperationException("Not supported yet."); |
90 | |
} |
91 | |
|
92 | |
private KimEntityNameInfo toKimEntityNameInfo(PersonEnum pers) { |
93 | 0 | KimEntityNameInfo info = new KimEntityNameInfo(); |
94 | 0 | info.setActive(pers.isActive()); |
95 | 0 | info.setDefault(true); |
96 | 0 | info.setEntityNameId(pers.getEntityId()); |
97 | 0 | info.setFirstName(pers.getFirstName()); |
98 | 0 | info.setFirstNameUnmasked(pers.getFirstName()); |
99 | 0 | info.setFormattedName(pers.getFormattedName()); |
100 | 0 | info.setFormattedNameUnmasked(pers.getFormattedName()); |
101 | 0 | info.setLastName(pers.getLastName()); |
102 | 0 | info.setLastNameUnmasked(pers.getLastName()); |
103 | 0 | info.setMiddleName(pers.getMiddleName()); |
104 | 0 | info.setMiddleNameUnmasked(null); |
105 | 0 | info.setNameTypeCode(EntityNameTypeEnum.PRIMARY.getCode()); |
106 | 0 | info.setSuffix(pers.getSuffix()); |
107 | 0 | info.setSuffixUnmasked(pers.getSuffix()); |
108 | 0 | info.setSuppressName(false); |
109 | 0 | info.setTitle(pers.getTitle()); |
110 | 0 | info.setTitleUnmasked(pers.getTitle()); |
111 | 0 | return info; |
112 | |
} |
113 | |
|
114 | |
private KimEntityAffiliationInfo toKimEntityAffiliationInfo(PersonEnum pers) { |
115 | |
|
116 | |
|
117 | 0 | KimEntityAffiliationInfo info = new KimEntityAffiliationInfo(); |
118 | 0 | info.setActive(true); |
119 | 0 | info.setAffiliationTypeCode(pers.getAffiliation()); |
120 | 0 | info.setCampusCode(null); |
121 | 0 | info.setDefault(true); |
122 | 0 | info.setEntityAffiliationId(pers.getEntityId()); |
123 | 0 | return info; |
124 | |
} |
125 | |
|
126 | |
private KimEntityEmailInfo toKimEntityEmailInfo(PersonEnum pers) { |
127 | 0 | KimEntityEmailInfo info = new KimEntityEmailInfo(); |
128 | 0 | info.setActive(true); |
129 | 0 | info.setDefault(true); |
130 | 0 | info.setEmailAddress(pers.getPrincipalName()); |
131 | 0 | info.setEmailAddressUnmasked(pers.getPrincipalName()); |
132 | 0 | info.setEmailTypeCode(EmailTypeEnum.WORK.getCode()); |
133 | 0 | info.setEntityEmailId(pers.getEntityId()); |
134 | 0 | info.setEntityTypeCode(EntityTypeEnum.PERSON.getCode()); |
135 | 0 | info.setSuppressEmail(false); |
136 | 0 | return info; |
137 | |
} |
138 | |
|
139 | |
private KimEntityAddressInfo toKimEntityAddressInfo(PersonEnum pers) { |
140 | 0 | KimEntityAddressInfo info = new KimEntityAddressInfo(); |
141 | 0 | info.setActive(true); |
142 | 0 | info.setAddressTypeCode(AddressTypeEnum.HOME.getCode()); |
143 | 0 | info.setCityName(pers.getCity()); |
144 | 0 | info.setCityNameUnmasked(pers.getCity()); |
145 | 0 | info.setCountryCode("US"); |
146 | 0 | info.setCountryCodeUnmasked("US"); |
147 | 0 | info.setDefault(true); |
148 | 0 | info.setEntityAddressId(pers.getEntityId()); |
149 | 0 | info.setEntityTypeCode(EntityTypeEnum.PERSON.getCode()); |
150 | 0 | info.setLine1(pers.getStreet()); |
151 | 0 | info.setLine1Unmasked(pers.getStreet()); |
152 | 0 | info.setLine2(null); |
153 | 0 | info.setLine2Unmasked(null); |
154 | 0 | info.setLine3(null); |
155 | 0 | info.setLine3Unmasked(null); |
156 | 0 | info.setPostalCode(pers.getZip()); |
157 | 0 | info.setPostalCodeUnmasked(pers.getZip()); |
158 | 0 | info.setStateCode(pers.getState()); |
159 | 0 | info.setStateCodeUnmasked(pers.getState()); |
160 | 0 | info.setSuppressAddress(false); |
161 | 0 | return info; |
162 | |
} |
163 | |
|
164 | |
private KimEntityEntityTypeDefaultInfo toKimEntityEntityTypeDefaultInfo(PersonEnum pers) { |
165 | 0 | KimEntityEntityTypeDefaultInfo info = new KimEntityEntityTypeDefaultInfo(); |
166 | 0 | info.setDefaultEmailAddress(this.toKimEntityEmailInfo(pers)); |
167 | 0 | info.setDefaultAddress(this.toKimEntityAddressInfo(pers)); |
168 | 0 | info.setEntityTypeCode(EntityTypeEnum.PERSON.getCode()); |
169 | 0 | return info; |
170 | |
} |
171 | |
|
172 | |
private KimEntityExternalIdentifierInfo toKimEntityExternalIdentifierInfo(PersonEnum pers) { |
173 | 0 | if (pers.getSsn() == null || pers.getSsn().isEmpty()) { |
174 | 0 | return null; |
175 | |
} |
176 | 0 | KimEntityExternalIdentifierInfo info = new KimEntityExternalIdentifierInfo(); |
177 | 0 | info.setEntityExternalIdentifierId(pers.getEntityId()); |
178 | 0 | info.setExternalId(pers.getSsn()); |
179 | 0 | info.setExternalIdentifierTypeCode(ExternalIdentifierTypeEnum.TAX.getCode()); |
180 | 0 | return info; |
181 | |
} |
182 | |
|
183 | |
private KimEntityEmploymentInformationInfo toKimEntityEmploymentInformationInfo(PersonEnum pers) { |
184 | |
|
185 | 0 | if (!(pers.getAffiliation().equals(AffiliationTypeEnum.FACULTY.getCode()) |
186 | |
|| pers.getAffiliation().equals(AffiliationTypeEnum.STAFF.getCode()))) { |
187 | 0 | return null; |
188 | |
} |
189 | 0 | KimEntityEmploymentInformationInfo info = new KimEntityEmploymentInformationInfo(); |
190 | 0 | info.setActive(true); |
191 | 0 | info.setBaseSalaryAmount(null); |
192 | 0 | info.setEmployeeId(pers.getSsn()); |
193 | 0 | info.setEmployeeStatusCode(EmployeeStatusEnum.ACTIVE.getCode()); |
194 | 0 | info.setEmployeeTypeCode(EmployeeTypeEnum.PROFESSIONAL.getCode()); |
195 | 0 | info.setEmploymentRecordId(pers.getSsn()); |
196 | 0 | info.setEntityAffiliationId(pers.getEntityId()); |
197 | 0 | info.setEntityEmploymentId(pers.getEntityId()); |
198 | 0 | info.setPrimary(true); |
199 | 0 | info.setPrimaryDepartmentCode(pers.getDept()); |
200 | 0 | return info; |
201 | |
} |
202 | |
|
203 | |
private KimPrincipalInfo toKimPrincipalInfo(PersonEnum pers) { |
204 | 0 | KimPrincipalInfo info = new KimPrincipalInfo(); |
205 | 0 | info.setActive(pers.isActive()); |
206 | 0 | info.setEntityId(pers.getEntityId()); |
207 | 0 | info.setPassword(pers.getPassword()); |
208 | 0 | info.setPrincipalId(pers.getPrincipalId()); |
209 | 0 | info.setPrincipalName(pers.getPrincipalName()); |
210 | 0 | return info; |
211 | |
} |
212 | |
|
213 | |
private KimEntityPrivacyPreferencesInfo toKimEntityPrivacyPreferencesInfo(PersonEnum pers) { |
214 | 0 | KimEntityPrivacyPreferencesInfo info = new KimEntityPrivacyPreferencesInfo(); |
215 | 0 | info.setSuppressAddress(false); |
216 | 0 | info.setSuppressEmail(false); |
217 | 0 | info.setSuppressName(false); |
218 | 0 | info.setSuppressPhone(false); |
219 | 0 | return info; |
220 | |
} |
221 | |
|
222 | |
private KimEntityDefaultInfo toKimEntityDefaultInfo(PersonEnum pers) { |
223 | 0 | KimEntityDefaultInfo info = new KimEntityDefaultInfo(); |
224 | 0 | info.setActive(pers.isActive()); |
225 | 0 | info.setEntityTypes(Arrays.asList(this.toKimEntityEntityTypeDefaultInfo(pers))); |
226 | 0 | info.setDefaultAffiliation(this.toKimEntityAffiliationInfo(pers)); |
227 | 0 | info.setAffiliations(Arrays.asList(info.getAffiliations().get(0))); |
228 | 0 | info.setDefaultName(toKimEntityNameInfo(pers)); |
229 | 0 | info.setEntityId(pers.getEntityId()); |
230 | 0 | info.setExternalIdentifiers(Arrays.asList(this.toKimEntityExternalIdentifierInfo(pers))); |
231 | 0 | info.setPrimaryEmployment(this.toKimEntityEmploymentInformationInfo(pers)); |
232 | 0 | info.setPrincipals(Arrays.asList(this.toKimPrincipalInfo(pers))); |
233 | 0 | info.setPrivacyPreferences(this.toKimEntityPrivacyPreferencesInfo(pers)); |
234 | 0 | return info; |
235 | |
} |
236 | |
|
237 | |
@Override |
238 | |
public Map<String, KimEntityNameInfo> getDefaultNamesForEntityIds(List<String> entityIds) { |
239 | 0 | Map<String, KimEntityNameInfo> map = new HashMap<String, KimEntityNameInfo>(); |
240 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
241 | 0 | if (entityIds.contains(pers.getEntityId())) { |
242 | 0 | map.put(pers.getPrincipalId(), toKimEntityNameInfo(pers)); |
243 | |
} |
244 | |
} |
245 | 0 | return map; |
246 | |
} |
247 | |
|
248 | |
@Override |
249 | |
public Map<String, KimEntityNamePrincipalNameInfo> getDefaultNamesForPrincipalIds(List<String> principalIds) { |
250 | 0 | Map<String, KimEntityNamePrincipalNameInfo> map = new HashMap<String, KimEntityNamePrincipalNameInfo>(); |
251 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
252 | 0 | if (principalIds.contains(pers.getPrincipalId())) { |
253 | 0 | KimEntityNamePrincipalNameInfo info = new KimEntityNamePrincipalNameInfo(); |
254 | 0 | info.setPrincipalName(pers.getPrincipalName()); |
255 | 0 | info.setDefaultEntityName(toKimEntityNameInfo(pers)); |
256 | 0 | map.put(pers.getPrincipalId(), info); |
257 | |
} |
258 | |
} |
259 | 0 | return map; |
260 | |
} |
261 | |
|
262 | |
@Override |
263 | |
public EmailTypeInfo getEmailType(String code) { |
264 | 0 | for (EmailTypeEnum at : EmailTypeEnum.values()) { |
265 | 0 | if (at.getCode().equals(code)) { |
266 | 0 | EmailTypeInfo info = new EmailTypeInfo(); |
267 | 0 | info.setActive(at.isActive()); |
268 | 0 | info.setEmailTypeCode(at.getCode()); |
269 | 0 | info.setEmailTypeName(at.getName()); |
270 | 0 | info.setDisplaySortCode(at.getSort()); |
271 | 0 | info.setCode(at.getCode()); |
272 | 0 | info.setName(at.getName()); |
273 | 0 | return info; |
274 | |
} |
275 | |
} |
276 | 0 | return null; |
277 | |
} |
278 | |
|
279 | |
private EmploymentStatusInfo toEmploymentStatusInfo(EmployeeStatusEnum st) { |
280 | 0 | EmploymentStatusInfo info = new EmploymentStatusInfo(); |
281 | 0 | info.setActive(st.isActive()); |
282 | 0 | info.setCode(st.getCode()); |
283 | 0 | info.setDisplaySortCode(st.getSort()); |
284 | 0 | info.setEmploymentStatusCode(st.getCode()); |
285 | 0 | info.setEmploymentStatusName(st.getName()); |
286 | 0 | info.setName(st.getName()); |
287 | 0 | return info; |
288 | |
} |
289 | |
|
290 | |
@Override |
291 | |
public EmploymentStatusInfo getEmploymentStatus(String code) { |
292 | 0 | for (EmployeeStatusEnum st : EmployeeStatusEnum.values()) { |
293 | 0 | if (st.getCode().equals(code)) { |
294 | 0 | return this.toEmploymentStatusInfo(st); |
295 | |
} |
296 | |
} |
297 | 0 | return null; |
298 | |
} |
299 | |
|
300 | |
private EmploymentTypeInfo toEmploymentTypeInfo(EmployeeTypeEnum typ) { |
301 | 0 | EmploymentTypeInfo info = new EmploymentTypeInfo(); |
302 | 0 | info.setActive(typ.isActive()); |
303 | 0 | info.setCode(typ.getCode()); |
304 | 0 | info.setDisplaySortCode(typ.getSort()); |
305 | 0 | info.setEmploymentTypeCode(typ.getCode()); |
306 | 0 | info.setEmploymentTypeName(typ.getName()); |
307 | 0 | info.setName(typ.getName()); |
308 | 0 | return info; |
309 | |
} |
310 | |
|
311 | |
@Override |
312 | |
public EmploymentTypeInfo getEmploymentType(String code) { |
313 | 0 | for (EmployeeTypeEnum st : EmployeeTypeEnum.values()) { |
314 | 0 | if (st.getCode().equals(code)) { |
315 | 0 | return this.toEmploymentTypeInfo(st); |
316 | |
} |
317 | |
} |
318 | 0 | return null; |
319 | |
} |
320 | |
|
321 | |
@Override |
322 | |
public KimEntityDefaultInfo getEntityDefaultInfo(String entityId) { |
323 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
324 | 0 | if (pers.getEntityId().equals(entityId)) { |
325 | 0 | return this.toKimEntityDefaultInfo(pers); |
326 | |
} |
327 | |
} |
328 | 0 | return null; |
329 | |
} |
330 | |
|
331 | |
@Override |
332 | |
public KimEntityDefaultInfo getEntityDefaultInfoByPrincipalId(String principalId) { |
333 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
334 | 0 | if (pers.getPrincipalId().equals(principalId)) { |
335 | 0 | return this.toKimEntityDefaultInfo(pers); |
336 | |
} |
337 | |
} |
338 | 0 | return null; |
339 | |
} |
340 | |
|
341 | |
@Override |
342 | |
public KimEntityDefaultInfo getEntityDefaultInfoByPrincipalName(String principalName) { |
343 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
344 | 0 | if (pers.getPrincipalName().equals(principalName)) { |
345 | 0 | return this.toKimEntityDefaultInfo(pers); |
346 | |
} |
347 | |
} |
348 | 0 | return null; |
349 | |
} |
350 | |
|
351 | |
private KimEntityEntityTypeInfo toKimEntityEntityTypeInfo(PersonEnum pers) { |
352 | 0 | KimEntityEntityTypeInfo info = new KimEntityEntityTypeInfo(); |
353 | 0 | info.setActive(pers.isActive()); |
354 | 0 | info.setDefaultAddress(this.toKimEntityAddressInfo(pers)); |
355 | 0 | info.setAddresses(Arrays.asList(info.getDefaultAddress())); |
356 | 0 | info.setDefaultEmailAddress(this.toKimEntityEmailInfo(pers)); |
357 | 0 | info.setDefaultPhoneNumber(null); |
358 | 0 | info.setEmailAddresses(Arrays.asList(info.getDefaultEmailAddress())); |
359 | 0 | info.setEntityType(this.getEntityType(EntityTypeEnum.PERSON.getCode())); |
360 | 0 | info.setEntityTypeCode(EntityTypeEnum.PERSON.getCode()); |
361 | 0 | info.setPhoneNumbers(null); |
362 | 0 | return info; |
363 | |
} |
364 | |
|
365 | |
private KimEntityBioDemographicsInfo toKimEntityBioDemographicsInfo(PersonEnum pers) { |
366 | 0 | KimEntityBioDemographicsInfo info = new KimEntityBioDemographicsInfo(); |
367 | 0 | info.setBirthDate(null); |
368 | 0 | info.setBirthDateUnmasked(null); |
369 | 0 | info.setBirthStateCode(null); |
370 | 0 | info.setBirthStateCodeUnmasked(null); |
371 | 0 | info.setCityOfBirth(null); |
372 | 0 | info.setCityOfBirthUnmasked(null); |
373 | 0 | info.setCountryOfBirthCode(null); |
374 | 0 | info.setCountryOfBirthCodeUnmasked(null); |
375 | 0 | info.setDeceasedDate(null); |
376 | 0 | info.setEntityId(pers.getEntityId()); |
377 | 0 | info.setGenderCode(pers.getGender().substring(0, 1)); |
378 | 0 | info.setGenderCodeUnmasked(info.getGenderCode()); |
379 | 0 | info.setGenderCodeUnmaskedUnmasked(info.getGenderCode()); |
380 | 0 | info.setGeographicOrigin(null); |
381 | 0 | info.setGeographicOriginUnmasked(null); |
382 | 0 | info.setMaritalStatusCode(null); |
383 | 0 | info.setMaritalStatusCodeUnmasked(null); |
384 | 0 | info.setPrimaryLanguageCode(null); |
385 | 0 | info.setPrimaryLanguageCodeUnmasked(null); |
386 | 0 | info.setSecondaryLanguageCode(null); |
387 | 0 | info.setSecondaryLanguageCodeUnmasked(null); |
388 | 0 | info.setSuppressPersonal(false); |
389 | 0 | return info; |
390 | |
} |
391 | |
|
392 | |
private KimEntityInfo toKimEntityInfo(PersonEnum pers) { |
393 | 0 | KimEntityInfo info = new KimEntityInfo(); |
394 | 0 | info.setActive(pers.isActive()); |
395 | 0 | info.setAffiliations(Arrays.asList(this.toKimEntityAffiliationInfo(pers))); |
396 | 0 | info.setBioDemographics(this.toKimEntityBioDemographicsInfo(pers)); |
397 | 0 | info.setCitizenships(null); |
398 | 0 | info.setEmploymentInformation(Arrays.asList(toKimEntityEmploymentInformationInfo(pers))); |
399 | 0 | info.setEntityId(pers.getEntityId()); |
400 | 0 | info.setEntityTypes(Arrays.asList(this.toKimEntityEntityTypeInfo(pers))); |
401 | 0 | return info; |
402 | |
} |
403 | |
|
404 | |
@Override |
405 | |
public KimEntityInfo getEntityInfo(String entityId) { |
406 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
407 | 0 | if (pers.getEntityId().equals(entityId)) { |
408 | 0 | return this.toKimEntityInfo(pers); |
409 | |
} |
410 | |
} |
411 | 0 | return null; |
412 | |
} |
413 | |
|
414 | |
@Override |
415 | |
public KimEntityInfo getEntityInfoByPrincipalId(String principalId) { |
416 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
417 | 0 | if (pers.getPrincipalId().equals(principalId)) { |
418 | 0 | return this.toKimEntityInfo(pers); |
419 | |
} |
420 | |
} |
421 | 0 | return null; |
422 | |
} |
423 | |
|
424 | |
@Override |
425 | |
public KimEntityInfo getEntityInfoByPrincipalName(String principalName) { |
426 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
427 | 0 | if (pers.getPrincipalName().equals(principalName)) { |
428 | 0 | return this.toKimEntityInfo(pers); |
429 | |
} |
430 | |
} |
431 | 0 | return null; |
432 | |
} |
433 | |
|
434 | |
@Override |
435 | |
public EntityNameTypeInfo getEntityNameType(String code) { |
436 | 0 | for (EntityNameTypeEnum at : EntityNameTypeEnum.values()) { |
437 | 0 | if (at.getCode().equals(code)) { |
438 | 0 | EntityNameTypeInfo info = new EntityNameTypeInfo(); |
439 | 0 | info.setActive(at.isActive()); |
440 | 0 | info.setEntityNameTypeCode(at.getCode()); |
441 | 0 | info.setEntityNameTypeName(at.getName()); |
442 | 0 | info.setDisplaySortCode(at.getSort()); |
443 | 0 | info.setCode(at.getCode()); |
444 | 0 | info.setName(at.getName()); |
445 | 0 | return info; |
446 | |
} |
447 | |
} |
448 | 0 | return null; |
449 | |
} |
450 | |
|
451 | |
@Override |
452 | |
public KimEntityPrivacyPreferencesInfo getEntityPrivacyPreferences(String entityId) { |
453 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
454 | 0 | if (pers.getEntityId().equals(entityId)) { |
455 | 0 | return this.toKimEntityPrivacyPreferencesInfo(pers); |
456 | |
} |
457 | |
} |
458 | 0 | return null; |
459 | |
} |
460 | |
|
461 | |
@Override |
462 | |
public EntityTypeInfo getEntityType(String code) { |
463 | 0 | for (EntityTypeEnum typ : EntityTypeEnum.values()) { |
464 | 0 | if (typ.getCode().equals(code)) { |
465 | 0 | EntityTypeInfo info = new EntityTypeInfo(); |
466 | 0 | info.setActive(typ.isActive()); |
467 | 0 | info.setCode(typ.getCode()); |
468 | 0 | info.setDisplaySortCode(typ.getSort()); |
469 | 0 | info.setEntityTypeCode(typ.getCode()); |
470 | 0 | info.setEntityTypeName(typ.getName()); |
471 | 0 | info.setName(typ.getName()); |
472 | 0 | return info; |
473 | |
} |
474 | |
} |
475 | 0 | return null; |
476 | |
} |
477 | |
|
478 | |
@Override |
479 | |
public ExternalIdentifierTypeInfo getExternalIdentifierType(String code) { |
480 | 0 | for (ExternalIdentifierTypeEnum typ : ExternalIdentifierTypeEnum.values()) { |
481 | 0 | if (typ.getCode().equals(code)) { |
482 | 0 | ExternalIdentifierTypeInfo info = new ExternalIdentifierTypeInfo(); |
483 | 0 | info.setActive(typ.isActive()); |
484 | 0 | info.setCode(typ.getCode()); |
485 | 0 | info.setDisplaySortCode(typ.getSort()); |
486 | 0 | info.setExternalIdentifierTypeCode(typ.getCode()); |
487 | 0 | info.setExternalIdentifierTypeName(typ.getName()); |
488 | 0 | info.setName(typ.getName()); |
489 | 0 | return info; |
490 | |
} |
491 | |
} |
492 | 0 | return null; |
493 | |
} |
494 | |
|
495 | |
|
496 | |
@Override |
497 | |
public PhoneTypeInfo getPhoneType(String code) { |
498 | 0 | for (PhoneTypeEnum typ : PhoneTypeEnum.values()) { |
499 | 0 | if (typ.getCode().equals(code)) { |
500 | 0 | PhoneTypeInfo info = new PhoneTypeInfo(); |
501 | 0 | info.setActive(typ.isActive()); |
502 | 0 | info.setCode(typ.getCode()); |
503 | 0 | info.setDisplaySortCode(typ.getSort()); |
504 | 0 | info.setPhoneTypeCode(typ.getCode()); |
505 | 0 | info.setPhoneTypeName(typ.getName()); |
506 | 0 | info.setName(typ.getName()); |
507 | 0 | return info; |
508 | |
} |
509 | |
} |
510 | 0 | return null; |
511 | |
} |
512 | |
|
513 | |
@Override |
514 | |
public KimPrincipalInfo getPrincipal(String principalId) { |
515 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
516 | 0 | if (pers.getPrincipalId().equals(principalId)) { |
517 | 0 | return this.toKimPrincipalInfo(pers); |
518 | |
} |
519 | |
} |
520 | 0 | return null; |
521 | |
} |
522 | |
|
523 | |
@Override |
524 | |
public KimPrincipalInfo getPrincipalByPrincipalName(String principalName) { |
525 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
526 | 0 | if (pers.getPrincipalName().equals(principalName)) { |
527 | 0 | return this.toKimPrincipalInfo(pers); |
528 | |
} |
529 | |
} |
530 | 0 | return null; |
531 | |
} |
532 | |
|
533 | |
@Override |
534 | |
public KimPrincipalInfo getPrincipalByPrincipalNameAndPassword(String principalName, |
535 | |
String password) { |
536 | 0 | for (PersonEnum pers : PersonEnum.values()) { |
537 | 0 | if (pers.getPrincipalName().equals(principalName)) { |
538 | 0 | if (pers.getPassword().equals(password)) { |
539 | 0 | return this.toKimPrincipalInfo(pers); |
540 | |
} |
541 | |
} |
542 | |
} |
543 | 0 | return null; |
544 | |
} |
545 | |
|
546 | |
@Override |
547 | |
public List<KimEntityDefaultInfo> lookupEntityDefaultInfo(Map<String, String> searchCriteria, |
548 | |
boolean unbounded) { |
549 | 0 | throw new UnsupportedOperationException("Not supported yet."); |
550 | |
} |
551 | |
|
552 | |
@Override |
553 | |
public List<KimEntityInfo> lookupEntityInfo(Map<String, String> searchCriteria, |
554 | |
boolean unbounded) { |
555 | 0 | throw new UnsupportedOperationException("Not supported yet."); |
556 | |
} |
557 | |
|
558 | |
|
559 | |
@Override |
560 | |
public int getMatchingEntityCount(Map<String, String> searchCriteria) { |
561 | 0 | throw new UnsupportedOperationException("Not supported yet."); |
562 | |
} |
563 | |
} |
564 | |
|