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 org.kuali.rice.core.api.criteria.QueryByCriteria; |
19 | |
import org.kuali.rice.kim.api.identity.Type; |
20 | |
import org.kuali.rice.kim.api.identity.address.EntityAddress; |
21 | |
import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation; |
22 | |
import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType; |
23 | |
import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship; |
24 | |
import org.kuali.rice.kim.api.identity.email.EntityEmail; |
25 | |
import org.kuali.rice.kim.api.identity.employment.EntityEmployment; |
26 | |
import org.kuali.rice.kim.api.identity.entity.Entity; |
27 | |
import org.kuali.rice.kim.api.identity.entity.EntityDefault; |
28 | |
import org.kuali.rice.kim.api.identity.entity.EntityDefaultQueryResults; |
29 | |
import org.kuali.rice.kim.api.identity.entity.EntityQueryResults; |
30 | |
import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier; |
31 | |
import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierType; |
32 | |
import org.kuali.rice.kim.api.identity.name.EntityName; |
33 | |
import org.kuali.rice.kim.api.identity.personal.EntityBioDemographics; |
34 | |
import org.kuali.rice.kim.api.identity.personal.EntityEthnicity; |
35 | |
import org.kuali.rice.kim.api.identity.phone.EntityPhone; |
36 | |
import org.kuali.rice.kim.api.identity.principal.EntityNamePrincipalName; |
37 | |
import org.kuali.rice.kim.api.identity.principal.Principal; |
38 | |
import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences; |
39 | |
import org.kuali.rice.kim.api.identity.residency.EntityResidency; |
40 | |
import org.kuali.rice.kim.api.identity.type.EntityTypeData; |
41 | |
import org.kuali.rice.kim.api.identity.visa.EntityVisa; |
42 | |
import org.kuali.rice.kim.api.services.IdentityArchiveService; |
43 | |
import org.kuali.rice.kim.api.services.IdentityService; |
44 | |
import org.kuali.rice.kim.service.IdentityUpdateService; |
45 | |
import org.kuali.rice.kim.util.KIMWebServiceConstants; |
46 | |
|
47 | |
import javax.jws.WebParam; |
48 | |
import javax.jws.WebService; |
49 | |
import java.util.List; |
50 | |
import java.util.Map; |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
@WebService(endpointInterface = KIMWebServiceConstants.IdentityService.INTERFACE_CLASS, serviceName = KIMWebServiceConstants.IdentityService.WEB_SERVICE_NAME, portName = KIMWebServiceConstants.IdentityService.WEB_SERVICE_PORT, targetNamespace = KIMWebServiceConstants.MODULE_TARGET_NAMESPACE) |
61 | |
public class IdentityCurrentAndArchivedServiceImpl implements IdentityService, IdentityUpdateService { |
62 | |
|
63 | |
private final IdentityArchiveService identityArchiveService; |
64 | |
private final IdentityService innerIdentityService; |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
public IdentityCurrentAndArchivedServiceImpl(IdentityService innerIdentityService, |
71 | 0 | IdentityArchiveService identityArchiveService) { |
72 | 0 | this.innerIdentityService = innerIdentityService; |
73 | 0 | this.identityArchiveService = identityArchiveService; |
74 | 0 | } |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
public Type getAddressType(String code) { |
80 | 0 | return getInnerIdentityService().getAddressType(code); |
81 | |
} |
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public EntityAffiliationType getAffiliationType(String code) { |
87 | 0 | return getInnerIdentityService().getAffiliationType(code); |
88 | |
} |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
public Type getCitizenshipStatus(String code) { |
94 | 0 | return Type.Builder.create(getInnerIdentityService().getCitizenshipStatus(code)).build(); |
95 | |
} |
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
public Map<String, EntityNamePrincipalName> getDefaultNamesForEntityIds( |
101 | |
List<String> entityIds) { |
102 | 0 | return getInnerIdentityService().getDefaultNamesForEntityIds(entityIds); |
103 | |
} |
104 | |
|
105 | |
@Override |
106 | |
public EntityName addNameToEntity(EntityName name) { |
107 | 0 | return getInnerIdentityService().addNameToEntity(name); |
108 | |
} |
109 | |
|
110 | |
@Override |
111 | |
public EntityName updateName(EntityName name) { |
112 | 0 | return getInnerIdentityService().updateName(name); |
113 | |
} |
114 | |
|
115 | |
@Override |
116 | |
public EntityName inactivateName(String id) { |
117 | 0 | return getInnerIdentityService().inactivateName(id); |
118 | |
} |
119 | |
|
120 | |
@Override |
121 | |
public EntityEmployment addEmploymentToEntity(EntityEmployment employment) { |
122 | 0 | return getInnerIdentityService().addEmploymentToEntity(employment); |
123 | |
} |
124 | |
|
125 | |
@Override |
126 | |
public EntityEmployment updateEmployment(EntityEmployment employment) { |
127 | 0 | return getInnerIdentityService().updateEmployment(employment); |
128 | |
} |
129 | |
|
130 | |
@Override |
131 | |
public EntityEmployment inactivateEmployment(String id) { |
132 | 0 | return getInnerIdentityService().inactivateEmployment(id); |
133 | |
} |
134 | |
|
135 | |
@Override |
136 | |
public EntityBioDemographics addBioDemographicsToEntity(EntityBioDemographics bioDemographics) { |
137 | 0 | return getInnerIdentityService().addBioDemographicsToEntity(bioDemographics); |
138 | |
} |
139 | |
|
140 | |
@Override |
141 | |
public EntityBioDemographics updateBioDemographics(EntityBioDemographics bioDemographics) { |
142 | 0 | return getInnerIdentityService().updateBioDemographics(bioDemographics); |
143 | |
} |
144 | |
|
145 | |
|
146 | |
|
147 | |
|
148 | |
public Map<String, EntityNamePrincipalName> getDefaultNamesForPrincipalIds( |
149 | |
List<String> principalIds) { |
150 | 0 | return getInnerIdentityService().getDefaultNamesForPrincipalIds(principalIds); |
151 | |
} |
152 | |
|
153 | |
|
154 | |
|
155 | |
|
156 | |
public Type getEmailType(String code) { |
157 | 0 | return getInnerIdentityService().getEmailType(code); |
158 | |
} |
159 | |
|
160 | |
|
161 | |
|
162 | |
|
163 | |
public Type getEmploymentStatus(String code) { |
164 | 0 | return getInnerIdentityService().getEmploymentStatus(code); |
165 | |
} |
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
public Type getEmploymentType(String code) { |
172 | 0 | return getInnerIdentityService().getEmploymentType(code); |
173 | |
} |
174 | |
|
175 | |
|
176 | |
|
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
public EntityDefault getEntityDefault(String entityId) { |
183 | 0 | EntityDefault entity = getInnerIdentityService().getEntityDefault(entityId); |
184 | 0 | if ( entity == null ) { |
185 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchive( entityId ); |
186 | |
} else { |
187 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
188 | |
} |
189 | 0 | return entity; |
190 | |
} |
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
public EntityDefault getEntityDefaultByPrincipalId(String principalId) { |
199 | 0 | EntityDefault entity = getInnerIdentityService().getEntityDefaultByPrincipalId(principalId); |
200 | 0 | if ( entity == null ) { |
201 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchiveByPrincipalId( principalId ); |
202 | |
} else { |
203 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
204 | |
} |
205 | 0 | return entity; |
206 | |
} |
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
|
212 | |
|
213 | |
|
214 | |
public EntityDefault getEntityDefaultByPrincipalName(String principalName) { |
215 | 0 | EntityDefault entity = getInnerIdentityService().getEntityDefaultByPrincipalName(principalName); |
216 | 0 | if ( entity == null ) { |
217 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchiveByPrincipalName( principalName ); |
218 | |
} else { |
219 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
220 | |
} |
221 | 0 | return entity; |
222 | |
} |
223 | |
|
224 | |
@Override |
225 | |
public EntityDefaultQueryResults findEntityDefaults(@WebParam(name = "query") QueryByCriteria queryByCriteria) { |
226 | 0 | return getInnerIdentityService().findEntityDefaults(queryByCriteria); |
227 | |
} |
228 | |
|
229 | |
@Override |
230 | |
public EntityQueryResults findEntities(@WebParam(name = "query") QueryByCriteria queryByCriteria) { |
231 | 0 | return getInnerIdentityService().findEntities(queryByCriteria); |
232 | |
} |
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
public Entity getEntity(String entityId) { |
238 | 0 | return getInnerIdentityService().getEntity(entityId); |
239 | |
} |
240 | |
|
241 | |
|
242 | |
|
243 | |
|
244 | |
public Entity getEntityByPrincipalId(String principalId) { |
245 | 0 | return getInnerIdentityService().getEntityByPrincipalId(principalId); |
246 | |
} |
247 | |
|
248 | |
|
249 | |
|
250 | |
|
251 | |
public Entity getEntityByPrincipalName(String principalName) { |
252 | 0 | return getInnerIdentityService().getEntityByPrincipalName(principalName); |
253 | |
} |
254 | |
|
255 | |
|
256 | |
@Override |
257 | |
public Entity createEntity(Entity entity) { |
258 | 0 | return getInnerIdentityService().createEntity(entity); |
259 | |
} |
260 | |
|
261 | |
@Override |
262 | |
public Entity updateEntity(Entity entity) { |
263 | 0 | return getInnerIdentityService().updateEntity(entity); |
264 | |
} |
265 | |
|
266 | |
@Override |
267 | |
public Entity inactivateEntity(String entityId) { |
268 | 0 | return getInnerIdentityService().inactivateEntity(entityId); |
269 | |
} |
270 | |
|
271 | |
|
272 | |
|
273 | |
|
274 | |
public Type getNameType(String code) { |
275 | 0 | return getInnerIdentityService().getNameType(code); |
276 | |
} |
277 | |
|
278 | |
|
279 | |
|
280 | |
|
281 | |
public EntityPrivacyPreferences getEntityPrivacyPreferences( |
282 | |
String entityId) { |
283 | 0 | return getInnerIdentityService().getEntityPrivacyPreferences(entityId); |
284 | |
} |
285 | |
|
286 | |
@Override |
287 | |
public EntityPrivacyPreferences addPrivacyPreferencesToEntity(EntityPrivacyPreferences privacyPreferences) { |
288 | 0 | return getInnerIdentityService().addPrivacyPreferencesToEntity(privacyPreferences); |
289 | |
} |
290 | |
|
291 | |
@Override |
292 | |
public EntityPrivacyPreferences updatePrivacyPreferences(EntityPrivacyPreferences privacyPreferences) { |
293 | 0 | return getInnerIdentityService().updatePrivacyPreferences(privacyPreferences); |
294 | |
} |
295 | |
|
296 | |
@Override |
297 | |
public EntityCitizenship addCitizenshipToEntity(EntityCitizenship citizenship) { |
298 | 0 | return getInnerIdentityService().addCitizenshipToEntity(citizenship); |
299 | |
} |
300 | |
|
301 | |
@Override |
302 | |
public EntityCitizenship updateCitizenship(EntityCitizenship citizenship) { |
303 | 0 | return getInnerIdentityService().updateCitizenship(citizenship); |
304 | |
} |
305 | |
|
306 | |
@Override |
307 | |
public EntityCitizenship inactivateCitizenship(String id) { |
308 | 0 | return getInnerIdentityService().inactivateCitizenship(id); |
309 | |
} |
310 | |
|
311 | |
@Override |
312 | |
public EntityEthnicity addEthnicityToEntity(EntityEthnicity ethnicity) { |
313 | 0 | return getInnerIdentityService().addEthnicityToEntity(ethnicity); |
314 | |
} |
315 | |
|
316 | |
@Override |
317 | |
public EntityEthnicity updateEthnicity(EntityEthnicity ethnicity) { |
318 | 0 | return getInnerIdentityService().updateEthnicity(ethnicity); |
319 | |
} |
320 | |
|
321 | |
@Override |
322 | |
public EntityResidency addResidencyToEntity(EntityResidency residency) { |
323 | 0 | return getInnerIdentityService().addResidencyToEntity(residency); |
324 | |
} |
325 | |
|
326 | |
@Override |
327 | |
public EntityResidency updateResidency(EntityResidency residency) { |
328 | 0 | return getInnerIdentityService().updateResidency(residency); |
329 | |
} |
330 | |
|
331 | |
@Override |
332 | |
public EntityVisa addVisaToEntity(EntityVisa visa) { |
333 | 0 | return getInnerIdentityService().addVisaToEntity(visa); |
334 | |
} |
335 | |
|
336 | |
@Override |
337 | |
public EntityVisa updateVisa(EntityVisa visa) { |
338 | 0 | return getInnerIdentityService().updateVisa(visa); |
339 | |
} |
340 | |
|
341 | |
|
342 | |
|
343 | |
|
344 | |
public Type getEntityType(String code) { |
345 | 0 | return getInnerIdentityService().getEntityType(code); |
346 | |
} |
347 | |
|
348 | |
|
349 | |
|
350 | |
|
351 | |
public EntityExternalIdentifierType getExternalIdentifierType(String code) { |
352 | 0 | return getInnerIdentityService().getExternalIdentifierType(code); |
353 | |
} |
354 | |
|
355 | |
|
356 | |
|
357 | |
|
358 | |
|
359 | |
public Type getPhoneType(String code) { |
360 | 0 | return getInnerIdentityService().getPhoneType(code); |
361 | |
} |
362 | |
|
363 | |
|
364 | |
|
365 | |
|
366 | |
public Principal getPrincipal(String principalId) { |
367 | 0 | return getInnerIdentityService().getPrincipal(principalId); |
368 | |
} |
369 | |
|
370 | |
|
371 | |
|
372 | |
|
373 | |
public Principal getPrincipalByPrincipalName(String principalName) { |
374 | 0 | return getInnerIdentityService().getPrincipalByPrincipalName(principalName); |
375 | |
} |
376 | |
|
377 | |
|
378 | |
|
379 | |
|
380 | |
public Principal getPrincipalByPrincipalNameAndPassword( |
381 | |
String principalName, String password) { |
382 | 0 | return getInnerIdentityService().getPrincipalByPrincipalNameAndPassword( |
383 | |
principalName, password); |
384 | |
} |
385 | |
|
386 | |
@Override |
387 | |
public Principal addPrincipalToEntity(Principal principal) { |
388 | 0 | return getInnerIdentityService().addPrincipalToEntity(principal); |
389 | |
} |
390 | |
|
391 | |
@Override |
392 | |
public Principal updatePrincipal(Principal principal) { |
393 | 0 | return getInnerIdentityService().updatePrincipal(principal); |
394 | |
} |
395 | |
|
396 | |
@Override |
397 | |
public Principal inactivatePrincipal(String principalId) { |
398 | 0 | return getInnerIdentityService().inactivatePrincipal(principalId); |
399 | |
} |
400 | |
|
401 | |
@Override |
402 | |
public Principal inactivatePrincipalByName(String principalName) { |
403 | 0 | return getInnerIdentityService().inactivatePrincipalByName(principalName); |
404 | |
} |
405 | |
|
406 | |
@Override |
407 | |
public EntityTypeData addEntityTypeDataToEntity(EntityTypeData entityTypeData) { |
408 | 0 | return getInnerIdentityService().addEntityTypeDataToEntity(entityTypeData); |
409 | |
} |
410 | |
|
411 | |
@Override |
412 | |
public EntityTypeData updateEntityTypeData(EntityTypeData entityTypeData) { |
413 | 0 | return getInnerIdentityService().updateEntityTypeData(entityTypeData); |
414 | |
} |
415 | |
|
416 | |
@Override |
417 | |
public EntityTypeData inactivateEntityTypeData(String entityId, String entityTypeCode) { |
418 | 0 | return getInnerIdentityService().inactivateEntityTypeData(entityId, entityTypeCode); |
419 | |
} |
420 | |
|
421 | |
@Override |
422 | |
public EntityAddress addAddressToEntity(EntityAddress address) { |
423 | 0 | return getInnerIdentityService().addAddressToEntity(address); |
424 | |
} |
425 | |
|
426 | |
@Override |
427 | |
public EntityAddress updateAddress(EntityAddress address) { |
428 | 0 | return getInnerIdentityService().updateAddress(address); |
429 | |
} |
430 | |
|
431 | |
@Override |
432 | |
public EntityAddress inactivateAddress(String addressId) { |
433 | 0 | return getInnerIdentityService().inactivateAddress(addressId); |
434 | |
} |
435 | |
|
436 | |
@Override |
437 | |
public EntityEmail addEmailToEntity(EntityEmail email) { |
438 | 0 | return getInnerIdentityService().addEmailToEntity(email); |
439 | |
} |
440 | |
|
441 | |
@Override |
442 | |
public EntityEmail updateEmail(EntityEmail email) { |
443 | 0 | return getInnerIdentityService().updateEmail(email); |
444 | |
} |
445 | |
|
446 | |
@Override |
447 | |
public EntityEmail inactivateEmail(String emailId) { |
448 | 0 | return getInnerIdentityService().inactivateEmail(emailId); |
449 | |
} |
450 | |
|
451 | |
@Override |
452 | |
public EntityPhone addPhoneToEntity(EntityPhone phone) { |
453 | 0 | return getInnerIdentityService().addPhoneToEntity(phone); |
454 | |
} |
455 | |
|
456 | |
@Override |
457 | |
public EntityPhone updatePhone(EntityPhone phone) { |
458 | 0 | return getInnerIdentityService().updatePhone(phone); |
459 | |
} |
460 | |
|
461 | |
@Override |
462 | |
public EntityPhone inactivatePhone(String phoneId) { |
463 | 0 | return getInnerIdentityService().inactivatePhone(phoneId); |
464 | |
} |
465 | |
|
466 | |
@Override |
467 | |
public EntityExternalIdentifier addExternalIdentifierToEntity(EntityExternalIdentifier externalId) { |
468 | 0 | return getInnerIdentityService().addExternalIdentifierToEntity(externalId); |
469 | |
} |
470 | |
|
471 | |
@Override |
472 | |
public EntityExternalIdentifier updateExternalIdentifier(EntityExternalIdentifier externalId) { |
473 | 0 | return getInnerIdentityService().updateExternalIdentifier(externalId); |
474 | |
} |
475 | |
|
476 | |
@Override |
477 | |
public EntityAffiliation addAffiliationToEntity(EntityAffiliation affiliation) { |
478 | 0 | return getInnerIdentityService().addAffiliationToEntity(affiliation); |
479 | |
} |
480 | |
|
481 | |
@Override |
482 | |
public EntityAffiliation updateAffiliation(EntityAffiliation affiliation) { |
483 | 0 | return getInnerIdentityService().updateAffiliation(affiliation); |
484 | |
} |
485 | |
|
486 | |
@Override |
487 | |
public EntityAffiliation inactivateAffiliation(String id) { |
488 | 0 | return getInnerIdentityService().inactivateAffiliation(id); |
489 | |
} |
490 | |
|
491 | |
|
492 | |
private IdentityService getInnerIdentityService() { |
493 | 0 | return innerIdentityService; |
494 | |
} |
495 | |
|
496 | |
private IdentityArchiveService getIdentityArchiveService() { |
497 | 0 | return identityArchiveService; |
498 | |
} |
499 | |
|
500 | |
} |