View Javadoc

1   /**
2    * Copyright 2005-2012 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.api.identity;
17  
18  import org.kuali.rice.core.api.criteria.QueryByCriteria;
19  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
20  import org.kuali.rice.core.api.exception.RiceIllegalStateException;
21  import org.kuali.rice.kim.api.KimConstants;
22  import org.kuali.rice.kim.api.identity.address.EntityAddress;
23  import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation;
24  import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType;
25  import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship;
26  import org.kuali.rice.kim.api.identity.email.EntityEmail;
27  import org.kuali.rice.kim.api.identity.employment.EntityEmployment;
28  import org.kuali.rice.kim.api.identity.entity.Entity;
29  import org.kuali.rice.kim.api.identity.entity.EntityDefault;
30  import org.kuali.rice.kim.api.identity.entity.EntityDefaultQueryResults;
31  import org.kuali.rice.kim.api.identity.entity.EntityQueryResults;
32  import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier;
33  import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierType;
34  import org.kuali.rice.kim.api.identity.name.EntityName;
35  import org.kuali.rice.kim.api.identity.personal.EntityBioDemographics;
36  import org.kuali.rice.kim.api.identity.personal.EntityEthnicity;
37  import org.kuali.rice.kim.api.identity.phone.EntityPhone;
38  import org.kuali.rice.kim.api.identity.principal.EntityNamePrincipalName;
39  import org.kuali.rice.kim.api.identity.principal.Principal;
40  import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
41  import org.kuali.rice.kim.api.identity.residency.EntityResidency;
42  import org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo;
43  import org.kuali.rice.kim.api.identity.visa.EntityVisa;
44  import org.springframework.cache.annotation.CacheEvict;
45  import org.springframework.cache.annotation.Cacheable;
46  
47  import javax.jws.WebMethod;
48  import javax.jws.WebParam;
49  import javax.jws.WebResult;
50  import javax.jws.WebService;
51  import javax.jws.soap.SOAPBinding;
52  
53  /**
54   * This service provides operations to query for principal and identity data.
55   * 
56   * <p>A principal represents an identity that can authenticate.  In essence, a principal can be
57   * thought of as an "account" or as an identity's authentication credentials.  A principal has
58   * an id which is used to uniquely identify it.  It also has a name which represents the
59   * principal's username and is typically what is entered when authenticating.  All principals
60   * are associated with one and only one identity.
61   * 
62   * <p>An identity represents a person or system.  Additionally, other "types" of entities can
63   * be defined in KIM.  Information like name, phone number, etc. is associated with an identity.
64   * It is the representation of a concrete person or system.  While an identity will typically
65   * have a single principal associated with it, it is possible for an identity to have more than
66   * one principal or even no principals at all (in the case where the identity does not actually
67   * authenticate).
68   * 
69   * <p>This service also provides operations for querying various pieces of reference data, such as 
70   * address types, affiliation types, phone types, etc.
71   *
72   * 
73   * @author Kuali Rice Team (rice.collab@kuali.org)
74   *
75   */
76  @WebService(name = "identityService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0)
77  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
78  public interface IdentityService {
79  
80      /**
81       * This method finds EntityDefault data based on a query criteria.  The criteria cannot be null.
82       *
83       * @param query the criteria.  Cannot be null.
84       * @return query results.  will never return null.
85       * @throws IllegalArgumentException if the queryByCriteria is null
86       */
87      @WebMethod(operationName = "findEntityDefaults")
88      @WebResult(name = "results")
89  	EntityDefaultQueryResults findEntityDefaults(@WebParam(name = "query") QueryByCriteria query)  throws RiceIllegalArgumentException;
90  
91      /**
92       * This method finds Entities based on a query criteria.  The criteria cannot be null.
93       *
94       * @param query the criteria.  Cannot be null.
95       * @return query results.  will never return null.
96       * @throws IllegalArgumentException if the queryByCriteria is null
97       */
98      @WebMethod(operationName = "findEntities")
99      @WebResult(name = "results")
100 	EntityQueryResults findEntities(@WebParam(name = "query") QueryByCriteria query)  throws RiceIllegalArgumentException;
101 
102 	
103     /**
104      * Gets a {@link org.kuali.rice.kim.api.identity.entity.Entity} from an id.
105      *
106      * <p>
107      *   This method will return null if the Entity does not exist.
108      * </p>
109      *
110      * @param id the unique id to retrieve the entity by. cannot be null.
111      * @return a {@link org.kuali.rice.kim.api.identity.entity.Entity} or null
112      * @throws IllegalArgumentException if the id is blank
113      */
114     @WebMethod(operationName = "getEntity")
115     @WebResult(name = "entity")
116     @Cacheable(value= Entity.Cache.NAME, key="'id=' + #p0")
117 	Entity getEntity( @WebParam(name="id") String id )  throws RiceIllegalArgumentException;
118 
119 	/**
120      * Gets a {@link org.kuali.rice.kim.api.identity.entity.Entity} from a principalId.
121      *
122      * <p>
123      *   This method will return null if the Entity does not exist.
124      * </p>
125      *
126      * @param principalId the unique id to retrieve the entity by. cannot be null.
127      * @return a {@link org.kuali.rice.kim.api.identity.entity.Entity} or null
128      * @throws IllegalArgumentException if the principalId is blank
129      */
130     @WebMethod(operationName = "getEntityByPrincipalId")
131     @WebResult(name = "entity")
132     @Cacheable(value= Entity.Cache.NAME, key="'principalId=' + #p0")
133 	Entity getEntityByPrincipalId(@WebParam(name = "principalId") String principalId)  throws RiceIllegalArgumentException;
134 
135 	/**
136      * Gets a {@link org.kuali.rice.kim.api.identity.entity.Entity} from a principalName.
137      *
138      * <p>
139      *   This method will return null if the Entity does not exist.
140      * </p>
141      *
142      * @param principalName the unique id to retrieve the entity by. cannot be null.
143      * @return a {@link org.kuali.rice.kim.api.identity.entity.Entity} or null
144      * @throws IllegalArgumentException if the id is blank
145      */
146     @WebMethod(operationName = "getEntityByPrincipalName")
147     @WebResult(name = "entity")
148     @Cacheable(value= Entity.Cache.NAME, key="'principalName=' + #p0")
149 	Entity getEntityByPrincipalName(@WebParam(name = "principalName") String principalName)  throws RiceIllegalArgumentException;
150 
151     /**
152      * Gets a {@link org.kuali.rice.kim.api.identity.entity.Entity} from a employeeId.
153      *
154      * <p>
155      *   This method will return null if the Entity does not exist.
156      * </p>
157      *
158      * @param employeeId the unique id to retrieve the entity by. cannot be null.
159      * @return a {@link org.kuali.rice.kim.api.identity.entity.Entity} or null
160      * @throws IllegalArgumentException if the employeeId is blank
161      */
162     @WebMethod(operationName = "getEntityByEmployeeId")
163     @WebResult(name = "entity")
164     @Cacheable(value= Entity.Cache.NAME, key="'employeeId=' + #p0")
165     Entity getEntityByEmployeeId(@WebParam(name = "employeeId") String employeeId)  throws RiceIllegalArgumentException;
166 
167 
168     /**
169      * This will create a {@link org.kuali.rice.kim.api.identity.entity.Entity} exactly like the entity passed in.
170      *
171      * @param entity the entity to create
172      * @return the newly created Entity object.
173      * @throws IllegalArgumentException if the entity is null
174      * @throws IllegalStateException if the entity already exists in the system
175      */
176     @WebMethod(operationName="createEntity")
177     @WebResult(name = "entity")
178     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
179     Entity createEntity(@WebParam(name = "entity") Entity entity)
180         throws RiceIllegalArgumentException, RiceIllegalStateException;
181 
182     /**
183      * This will update a {@link org.kuali.rice.kim.api.identity.entity.Entity}.
184      *
185      * @param entity the entity to update
186      * @return the updated Entity object.
187      * @throws IllegalArgumentException if the entity is null
188      * @throws IllegalStateException if the entity does not already exist in the system
189      */
190     @WebMethod(operationName="updateEntity")
191     @WebResult(name = "entity")
192     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityNamePrincipalName.Cache.NAME}, allEntries = true)
193     Entity updateEntity(@WebParam(name = "entity") Entity entity)
194         throws RiceIllegalArgumentException, RiceIllegalStateException;
195 
196     /**
197      * This will inactivate a {@link org.kuali.rice.kim.api.identity.entity.Entity}.
198      *
199      * @param id the unique id of the entity to inactivate
200      * @return the inactivated Entity object.
201      * @throws IllegalArgumentException if the entity is null
202      * @throws IllegalStateException if the entity does not already exist in the system
203      */
204     @WebMethod(operationName="inactivateEntity")
205     @WebResult(name = "entity")
206     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
207     Entity inactivateEntity(@WebParam(name = "id") String id)
208         throws RiceIllegalArgumentException, RiceIllegalStateException;
209 
210     
211     
212     /**
213      * Gets a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} from an id.
214      * {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} is a condensed version of {@link org.kuali.rice.kim.api.identity.entity.Entity} that contains
215      * default values of its subclasses
216      *
217      * <p>
218      *   This method will return null if the Entity does not exist.
219      * </p>
220      *
221      * @param id the unique id to retrieve the entity by. cannot be null.
222      * @return a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} or null
223      * @throws IllegalArgumentException if the id is blank
224      */
225     @WebMethod(operationName = "getEntityDefault")
226     @WebResult(name = "entityDefault")
227     @Cacheable(value= EntityDefault.Cache.NAME, key="'id=' + #p0")
228 	EntityDefault getEntityDefault(@WebParam(name = "id") String id)  throws RiceIllegalArgumentException;
229 
230 	/**
231      * Gets a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} from an principalId.
232      * {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} is a condensed version of {@link org.kuali.rice.kim.api.identity.entity.Entity} that contains
233      * default values of its subclasses
234      *
235      * <p>
236      *   This method will return null if the Entity does not exist.
237      * </p>
238      *
239      * @param principalId the unique id to retrieve the entity by. cannot be null.
240      * @return a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} or null
241      * @throws IllegalArgumentException if the principalId is blank
242      */
243     @WebMethod(operationName = "getEntityDefaultByPrincipalId")
244     @WebResult(name = "entityDefault")
245     @Cacheable(value= EntityDefault.Cache.NAME, key="'principalId=' + #p0")
246 	EntityDefault getEntityDefaultByPrincipalId(@WebParam(name = "principalId") String principalId)  throws RiceIllegalArgumentException;
247 
248 	/**
249      * Gets a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} from an principalName.
250      * {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} is a condensed version of {@link org.kuali.rice.kim.api.identity.entity.Entity} that contains
251      * default values of its subclasses
252      *
253      * <p>
254      *   This method will return null if the Entity does not exist.
255      * </p>
256      *
257      * @param principalName the unique id to retrieve the entity by. cannot be null.
258      * @return a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} or null
259      * @throws IllegalArgumentException if the principalId is blank
260      */
261     @WebMethod(operationName = "getEntityDefaultByPrincipalName")
262     @WebResult(name = "entityDefault")
263     @Cacheable(value= EntityDefault.Cache.NAME, key="'principalName=' + #p0")
264 	EntityDefault getEntityDefaultByPrincipalName(@WebParam(name = "principalName") String principalName)  throws RiceIllegalArgumentException;
265     
266     /**
267      * Gets a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} from an employeeId.
268      * {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} is a condensed version of {@link org.kuali.rice.kim.api.identity.entity.Entity} that contains
269      * default values of its subclasses
270      *
271      * <p>
272      *   This method will return null if the Entity does not exist.
273      * </p>
274      *
275      * @param employeeId the unique id to retrieve the entity by. cannot be null.
276      * @return a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} or null
277      * @throws IllegalArgumentException if the employeeId is blank
278      */
279     @WebMethod(operationName = "getEntityDefaultByEmployeeId")
280     @WebResult(name = "entityDefault")
281     @Cacheable(value= EntityDefault.Cache.NAME, key="'employeeId=' + #p0")
282     EntityDefault getEntityDefaultByEmployeeId(@WebParam(name = "employeeId") String employeeId)  throws RiceIllegalArgumentException;
283     
284 
285     /**
286      * Gets a {@link org.kuali.rice.kim.api.identity.principal.Principal} from an principalId.
287      *
288      * <p>
289      *   This method will return null if the Principal does not exist.
290      * </p>
291      *
292      * @param principalId the unique id to retrieve the principal by. cannot be null.
293      * @return a {@link org.kuali.rice.kim.api.identity.principal.Principal} or null
294      * @throws IllegalArgumentException if the principalId is blank
295      */
296     @WebMethod(operationName = "getPrincipal")
297     @WebResult(name = "principal")
298     @Cacheable(value= Principal.Cache.NAME, key="'principalId=' + #p0")
299     Principal getPrincipal( @WebParam(name="principalId") String principalId )  throws RiceIllegalArgumentException;
300 
301     /**
302      * Gets a {@link org.kuali.rice.kim.api.identity.principal.Principal} from an principalName.
303      *
304      * <p>
305      *   This method will return null if the Principal does not exist.
306      * </p>
307      *
308      * @param principalName the unique id to retrieve the principal by. cannot be null.
309      * @return a {@link org.kuali.rice.kim.api.identity.principal.Principal} or null
310      * @throws IllegalArgumentException if the principalId is blank
311      */
312     @WebMethod(operationName = "getPrincipalByPrincipalName")
313     @WebResult(name = "principal")
314     @Cacheable(value= Principal.Cache.NAME, key="'principalName=' + #p0")
315     Principal getPrincipalByPrincipalName( @WebParam(name="principalName") String principalName )  throws RiceIllegalArgumentException;
316 
317     /**
318      * Gets a {@link org.kuali.rice.kim.api.identity.principal.Principal} from an principalName and password.
319      *
320      * <p>
321      *   This method will return null if the Principal does not exist or the password is incorrect.
322      * </p>
323      *
324      * @param principalName the unique id to retrieve the principal by. cannot be null.
325      * @param password the password for the principal
326      * @return a {@link org.kuali.rice.kim.api.identity.principal.Principal} or null
327      * @throws IllegalArgumentException if the principalName is blank
328      */
329     @WebMethod(operationName = "getPrincipalByPrincipalNameAndPassword")
330     @WebResult(name = "principal")
331     @Cacheable(value= Principal.Cache.NAME, key="'principalName=' + #p0 + '|' + 'password=' + #p1")
332     Principal getPrincipalByPrincipalNameAndPassword( @WebParam(name="principalName") String principalName,  @WebParam(name="password") String password )  throws RiceIllegalArgumentException;
333 
334     /**
335      * This will create a {@link org.kuali.rice.kim.api.identity.principal.Principal} exactly like the principal passed in.
336      *
337      * The principal object passed in must be populated with an entityId and a principalName
338      *
339      * @param principal the principal to create
340      * @return the newly created Principal object.
341      * @throws IllegalArgumentException if the principal is null
342      * @throws IllegalStateException if the principal already exists in the system or the principal object is not populated with entityId and principalName
343      */
344     @WebMethod(operationName="addPrincipalToEntity")
345     @WebResult(name = "principal")
346     @CacheEvict(value = {Principal.Cache.NAME, Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
347     Principal addPrincipalToEntity(@WebParam(name = "principal") Principal principal)
348         throws RiceIllegalArgumentException, RiceIllegalStateException;
349 
350     /**
351      * This will update a {@link org.kuali.rice.kim.api.identity.principal.Principal} exactly like the principal passed in.
352      *
353      *
354      * @param principal the principal to update
355      * @return the updated Principal object.
356      * @throws IllegalArgumentException if the principal is null
357      * @throws IllegalStateException if the principal does not exist in the system.
358      */
359     @WebMethod(operationName="updatePrincipal")
360     @WebResult(name = "principal")
361     @CacheEvict(value = {Principal.Cache.NAME, Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityNamePrincipalName.Cache.NAME}, allEntries = true)
362     Principal updatePrincipal(@WebParam(name = "principal") Principal principal)
363         throws RiceIllegalArgumentException, RiceIllegalStateException;
364 
365     /**
366      * This will inactivate a {@link org.kuali.rice.kim.api.identity.principal.Principal}.
367      *
368      *
369      * @param principalId the unique id of the principal to inactivate
370      * @return the inactivated Principal object.
371      * @throws IllegalArgumentException if the principal is null
372      * @throws IllegalStateException if the principal does not exist in the system.
373      */
374     @WebMethod(operationName="inactivatePrincipal")
375     @WebResult(name = "principal")
376     @CacheEvict(value = {Principal.Cache.NAME, Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
377     Principal inactivatePrincipal(@WebParam(name = "principalId") String principalId)
378         throws RiceIllegalArgumentException, RiceIllegalStateException;
379 
380     /**
381      * This will inactivate a {@link org.kuali.rice.kim.api.identity.principal.Principal}.
382      *
383      *
384      * @param principalName the unique principalName of the principal to inactivate
385      * @return the inactivated Principal object.
386      * @throws IllegalArgumentException if the principal is null
387      * @throws IllegalStateException if the principal does not exist in the system.
388      */
389     @WebMethod(operationName="inactivatePrincipalByName")
390     @WebResult(name = "principal")
391     @CacheEvict(value = {Principal.Cache.NAME, Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
392     Principal inactivatePrincipalByName(@WebParam(name = "principalName") String principalName)
393         throws RiceIllegalArgumentException, RiceIllegalStateException;
394 
395 
396     /**
397      * This will create a {@link org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo} exactly like the entityTypeContactInfo passed in.
398      *
399      * The EntityTypeContactInfo object passed in must be populated with an entityId and a entityTypeCode
400      *
401      * @param entityTypeContactInfo the EntityTypeContactInfo to create
402      * @return the newly created EntityTypeContactInfo object.
403      * @throws IllegalArgumentException if the entityTypeContactInfo is null
404      * @throws IllegalStateException if the entityTypeContactInfo already exists in the system or the EntityTypeContactInfo object is not populated with entityId and entityTypeCode
405      */
406     @WebMethod(operationName="addEntityTypeContactInfoToEntity")
407     @WebResult(name = "entityTypeContactInfo")
408     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
409     EntityTypeContactInfo addEntityTypeContactInfoToEntity(
410             @WebParam(name = "entityTypeContactInfo") EntityTypeContactInfo entityTypeContactInfo)
411         throws RiceIllegalArgumentException, RiceIllegalStateException;
412 
413     /**
414      * This will update a {@link org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo} exactly like the entityTypeContactInfo passed in.
415      *
416      *
417      * @param entityTypeContactInfo the EntityTypeContactInfo to update
418      * @return the updated EntityTypeContactInfo object.
419      * @throws IllegalArgumentException if the entityTypeContactInfo is null
420      * @throws IllegalStateException if the entityTypeContactInfo does not exist in the system.
421      */
422     @WebMethod(operationName="updateEntityTypeContactInfo")
423     @WebResult(name = "entityTypeContactInfo")
424     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
425     EntityTypeContactInfo updateEntityTypeContactInfo(@WebParam(name = "entityTypeContactInfo") EntityTypeContactInfo entityTypeContactInfo)
426         throws RiceIllegalArgumentException, RiceIllegalStateException;
427 
428     /**
429      * This will inactivate a {@link org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo} with the passed in parameters.
430      *
431      *
432      * @param entityId the entityId of the EntityTypeContactInfo to inactivate
433      * @param entityTypeCode the entityTypeCode of the EntityTypeContactInfo to inactivate
434      * @return the inactivated EntityTypeContactInfo object.
435      * @throws IllegalArgumentException if the entityId or entityTypeCode passed in is null
436      * @throws IllegalStateException if the EntityTypeContactInfo does not exist in the system.
437      */
438     @WebMethod(operationName="inactivateEntityTypeContactInfo")
439     @WebResult(name = "entityTypeContactInfo")
440     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
441     EntityTypeContactInfo inactivateEntityTypeContactInfo(@WebParam(name = "entityId") String entityId,
442             @WebParam(name = "entityTypeCode") String entityTypeCode)
443         throws RiceIllegalArgumentException, RiceIllegalStateException;
444 
445     /**
446      * This will create a {@link org.kuali.rice.kim.api.identity.address.EntityAddress} exactly like the address passed in.
447      *
448      * The EntityAddress object passed in must be populated with an entityId and a entityTypeCode
449      *
450      * @param address the EntityAddress to create
451      * @return the newly created EntityAddress object.
452      * @throws IllegalArgumentException if the address is null
453      * @throws IllegalStateException if the address already exists in the system or address is not populated with entityId and entityTypeCode
454      */
455     @WebMethod(operationName="addAddressToEntity")
456     @WebResult(name = "address")
457     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
458     EntityAddress addAddressToEntity(@WebParam(name = "address") EntityAddress address)
459         throws RiceIllegalArgumentException, RiceIllegalStateException;
460 
461     /**
462      * This will update a {@link org.kuali.rice.kim.api.identity.address.EntityAddress} exactly like the address passed in.
463      *
464      *
465      * @param address the EntityAddress to update
466      * @return the updated EntityAddress object.
467      * @throws IllegalArgumentException if the address is null
468      * @throws IllegalStateException if the address does not exist in the system.
469      */
470     @WebMethod(operationName="updateAddress")
471     @WebResult(name = "address")
472     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
473     EntityAddress updateAddress(@WebParam(name = "address")EntityAddress address)
474         throws RiceIllegalArgumentException, RiceIllegalStateException;
475 
476     /**
477      * This will inactivate a {@link org.kuali.rice.kim.api.identity.address.EntityAddress} with the id passed in.
478      *
479      *
480      * @param id the unique id of the EntityAddress to inactivate
481      * @return the updated EntityAddress object.
482      * @throws IllegalArgumentException if the id is null
483      * @throws IllegalStateException if the address does not exist in the system.
484      */
485     @WebMethod(operationName="inactivateAddress")
486     @WebResult(name = "address")
487     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
488     EntityAddress inactivateAddress(@WebParam(name = "id") String id)
489         throws RiceIllegalArgumentException, RiceIllegalStateException;
490 
491     /**
492      * This will create a {@link org.kuali.rice.kim.api.identity.email.EntityEmail} exactly like the email passed in.
493      *
494      * The EntityEmail object passed in must be populated with an entityId and a entityTypeCode
495      *
496      * @param email the EntityEmail to create
497      * @return the newly created EntityEmail object.
498      * @throws IllegalArgumentException if the email is null
499      * @throws IllegalStateException if the email already exists in the system or email is not populated with entityId and entityTypeCode
500      */
501     @WebMethod(operationName="addEmailToEntity")
502     @WebResult(name = "email")
503     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
504     EntityEmail addEmailToEntity(@WebParam(name = "email") EntityEmail email)
505         throws RiceIllegalArgumentException, RiceIllegalStateException;
506 
507     /**
508      * This will update a {@link org.kuali.rice.kim.api.identity.email.EntityEmail} exactly like the email passed in.
509      *
510      *
511      * @param email the EntityEmail to update
512      * @return the updated EntityEmail object.
513      * @throws IllegalArgumentException if the email is null
514      * @throws IllegalStateException if the email does not exist in the system.
515      */
516     @WebMethod(operationName="updateEmail")
517     @WebResult(name = "email")
518     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
519     EntityEmail updateEmail(@WebParam(name = "email") EntityEmail email)
520         throws RiceIllegalArgumentException, RiceIllegalStateException;
521 
522     /**
523      * This will inactivate the {@link org.kuali.rice.kim.api.identity.email.EntityEmail} with the passed in id.
524      *
525      *
526      * @param id the unique id of the EntityEmail to inactivate
527      * @return the inactivated EntityEmail object.
528      * @throws IllegalArgumentException if the id is null
529      * @throws IllegalStateException if the email does not exist in the system.
530      */
531     @WebMethod(operationName="inactivateEmail")
532     @WebResult(name = "email")
533     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
534     EntityEmail inactivateEmail(@WebParam(name = "id") String id)
535         throws RiceIllegalArgumentException, RiceIllegalStateException;
536 
537     /**
538      * This will create a {@link org.kuali.rice.kim.api.identity.phone.EntityPhone} exactly like the phone passed in.
539      *
540      * The EntityPhone object passed in must be populated with an entityId and a entityTypeCode
541      *
542      * @param phone the EntityPhone to create
543      * @return the newly created EntityPhone object.
544      * @throws IllegalArgumentException if the phone is null
545      * @throws IllegalStateException if the phone already exists in the system or phone is not populated with entityId and entityTypeCode
546      */
547     @WebMethod(operationName="addPhoneToEntity")
548     @WebResult(name = "phone")
549     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
550     EntityPhone addPhoneToEntity(@WebParam(name = "phone") EntityPhone phone)
551         throws RiceIllegalArgumentException, RiceIllegalStateException;
552 
553     /**
554      * This will update a {@link org.kuali.rice.kim.api.identity.phone.EntityPhone} exactly like the phone passed in.
555      *
556      *
557      * @param phone the EntityPhone to update
558      * @return the updated EntityPhone object.
559      * @throws IllegalArgumentException if the phone is null
560      * @throws IllegalStateException if the phone does not exist in the system.
561      */
562     @WebMethod(operationName="updatePhone")
563     @WebResult(name = "phone")
564     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
565     EntityPhone updatePhone(@WebParam(name = "phone") EntityPhone phone)
566             throws RiceIllegalArgumentException, RiceIllegalStateException;
567 
568     /**
569      * This will inactivate the {@link org.kuali.rice.kim.api.identity.phone.EntityPhone} with the passed in id.
570      *
571      *
572      * @param id the unique id of the EntityPhone to inactivate
573      * @return the inactivated EntityPhone object.
574      * @throws IllegalArgumentException if the id is null
575      * @throws IllegalStateException if the phone does not exist in the system.
576      */
577     @WebMethod(operationName="inactivatePhone")
578     @WebResult(name = "phone")
579     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
580     EntityPhone inactivatePhone(@WebParam(name = "id") String id)
581         throws RiceIllegalArgumentException, RiceIllegalStateException;
582 
583 
584     /**
585      * This will create a {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier} exactly like the externalId passed in.
586      *
587      * The EntityExternalIdentifier object passed in must be populated with an entityId and a externalIdentifierTypeCode
588      *
589      * @param externalId the EntityExternalIdentifier to create
590      * @return the newly created EntityExternalIdentifier object.
591      * @throws IllegalArgumentException if the externalId is null
592      * @throws IllegalStateException if the externalId already exists in the system or externalId is not populated with entityId and externalIdentifierTypeCode
593      */
594     @WebMethod(operationName="addExternalIdentifierToEntity")
595     @WebResult(name = "externalId")
596     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
597     EntityExternalIdentifier addExternalIdentifierToEntity(@WebParam(name = "externalId") EntityExternalIdentifier externalId)
598         throws RiceIllegalArgumentException, RiceIllegalStateException;
599 
600     /**
601      * This will update a {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier} exactly like the externalId passed in.
602      *
603      *
604      * @param externalId the EntityExternalIdentifier to update
605      * @return the updated EntityExternalIdentifier object.
606      * @throws IllegalArgumentException if the externalId is null
607      * @throws IllegalStateException if the externalId does not exist in the system.
608      */
609     @WebMethod(operationName="updateExternalIdentifier")
610     @WebResult(name = "externalId")
611     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
612     EntityExternalIdentifier updateExternalIdentifier(@WebParam(name = "externalId") EntityExternalIdentifier externalId)
613         throws RiceIllegalArgumentException, RiceIllegalStateException;
614 
615     /**
616      * This will create a {@link org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation} exactly like the affiliation passed in.
617      *
618      * The EntityAffiliation object passed in must be populated with an entityId and a affiliationType
619      *
620      * @param affiliation the EntityAffiliation to create
621      * @return the newly created EntityAffiliation object.
622      * @throws IllegalArgumentException if the affiliation is null
623      * @throws IllegalStateException if the affiliation already exists in the system or affiliation is not populated with entityId and affiliationType
624      */
625     @WebMethod(operationName="addAffiliationToEntity")
626     @WebResult(name = "affiliation")
627     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
628     EntityAffiliation addAffiliationToEntity(@WebParam(name = "affiliation") EntityAffiliation affiliation)
629         throws RiceIllegalArgumentException, RiceIllegalStateException;
630 
631     /**
632      * This will update a {@link org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation} exactly like the affiliation passed in.
633      *
634      *
635      * @param affiliation the EntityAffiliation to update
636      * @return the updated EntityAffiliation object.
637      * @throws IllegalArgumentException if the affiliation is null
638      * @throws IllegalStateException if the affiliation does not exist in the system.
639      */
640     @WebMethod(operationName="updateAffiliation")
641     @WebResult(name = "affiliation")
642     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
643     EntityAffiliation updateAffiliation(@WebParam(name = "affiliation") EntityAffiliation affiliation)
644         throws RiceIllegalArgumentException, RiceIllegalStateException;
645 
646     /**
647      * This will inactivate a {@link org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation} with the id passed in.
648      *
649      *
650      * @param id the unique id of the  EntityAffiliation to inactivate
651      * @return the updated EntityAffiliation object.
652      * @throws IllegalArgumentException if the affiliation is null
653      * @throws IllegalStateException if the affiliation does not exist in the system.
654      */
655     @WebMethod(operationName="inactivateAffiliation")
656     @WebResult(name = "affiliation")
657     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
658     EntityAffiliation inactivateAffiliation(@WebParam(name = "id") String id)
659         throws RiceIllegalArgumentException, RiceIllegalStateException;
660     
661     /**
662      * This returns the display name information for the given principal
663      * without loading the full person object.
664      * 
665      * @param principalId The principal ID to find the name information for
666      * @return The default name information for the principal
667      */
668     @WebMethod(operationName="getDefaultNamesForPrincipalId")
669     @WebResult(name="entityNamePrincipalName")
670     @Cacheable(value = EntityNamePrincipalName.Cache.NAME, key = "'principalId=' + #p0")
671     public EntityNamePrincipalName getDefaultNamesForPrincipalId(@WebParam(name = "principalId") String principalId);
672 
673     /**
674      * This will create a {@link org.kuali.rice.kim.api.identity.name.EntityName} exactly like the name passed in.
675      *
676      * The EntityName object passed in must be populated with an entityId and a nameType
677      *
678      * @param name the EntityName to create
679      * @return the newly created EntityName object.
680      * @throws IllegalArgumentException if the name is null
681      * @throws IllegalStateException if the name already exists in the system or name is not populated with entityId and nameType
682      */
683     @WebMethod(operationName="addNameToEntity")
684     @WebResult(name = "name")
685     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityNamePrincipalName.Cache.NAME}, allEntries = true)
686     EntityName addNameToEntity(@WebParam(name = "name") EntityName name)
687         throws RiceIllegalArgumentException, RiceIllegalStateException;
688 
689     /**
690      * This will update a {@link org.kuali.rice.kim.api.identity.name.EntityName} exactly like the name passed in.
691      *
692      *
693      * @param name the EntityName to update
694      * @return the updated EntityName object.
695      * @throws IllegalArgumentException if the name is null
696      * @throws IllegalStateException if the name does not exist in the system.
697      */
698     @WebMethod(operationName="updateName")
699     @WebResult(name = "name")
700     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityNamePrincipalName.Cache.NAME}, allEntries = true)
701     EntityName updateName(@WebParam(name = "name") EntityName name)
702         throws RiceIllegalArgumentException, RiceIllegalStateException;
703 
704     /**
705      * This will inactivate a {@link org.kuali.rice.kim.api.identity.name.EntityName} with the passed in id.
706      *
707      *
708      * @param id the unique id of the EntityName to inactivate
709      * @return the inactivated EntityName object.
710      * @throws IllegalArgumentException if the id is null
711      * @throws IllegalStateException if the name with the id does not exist in the system.
712      */
713     @WebMethod(operationName="inactivateName")
714     @WebResult(name = "name")
715     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
716     EntityName inactivateName(@WebParam(name = "id") String id)
717         throws RiceIllegalArgumentException, RiceIllegalStateException;
718 
719     /**
720      * This will create a {@link org.kuali.rice.kim.api.identity.employment.EntityEmployment} exactly like the employment passed in.
721      *
722      * The EntityEmployment object passed in must be populated with an entityId and a employmentType
723      *
724      * @param employment the EntityEmployment to create
725      * @return the newly created EntityName object.
726      * @throws IllegalArgumentException if the employment is null
727      * @throws IllegalStateException if the employment already exists in the system or employment is not populated with entityId and employmentType
728      */
729     @WebMethod(operationName="addEmploymentToEntity")
730     @WebResult(name = "employment")
731     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
732     EntityEmployment addEmploymentToEntity(@WebParam(name = "employment") EntityEmployment employment)
733         throws RiceIllegalArgumentException, RiceIllegalStateException;
734 
735     /**
736      * This will update a {@link org.kuali.rice.kim.api.identity.employment.EntityEmployment} exactly like the employment passed in.
737      *
738      *
739      * @param employment the EntityEmployment to update
740      * @return the updated EntityEmployment object.
741      * @throws IllegalArgumentException if the employment is null
742      * @throws IllegalStateException if the employment does not exist in the system.
743      */
744     @WebMethod(operationName="updateEmployment")
745     @WebResult(name = "employment")
746     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
747     EntityEmployment updateEmployment(@WebParam(name = "employment") EntityEmployment employment)
748         throws RiceIllegalArgumentException, RiceIllegalStateException;
749 
750     /**
751      * This will inactivate a {@link org.kuali.rice.kim.api.identity.employment.EntityEmployment} with the passed in id.
752      *
753      *
754      * @param id the unique id of the EntityEmployment to inactivate
755      * @return the inactivated EntityEmployment object.
756      * @throws IllegalArgumentException if the id is null
757      * @throws IllegalStateException if the employment with the id does not exist in the system.
758      */
759     @WebMethod(operationName="inactivateEmployment")
760     @WebResult(name = "employment")
761     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
762     EntityEmployment inactivateEmployment(@WebParam(name = "id") String id)
763         throws RiceIllegalArgumentException, RiceIllegalStateException;
764 
765     /**
766      * This will create a {@link org.kuali.rice.kim.api.identity.personal.EntityBioDemographics} exactly like the bioDemographics passed in.
767      *
768      * The EntityBioDemographics object passed in must be populated with an entityId
769      *
770      * @param bioDemographics the EntityBioDemographics to create
771      * @return the newly created EntityBioDemographics object.
772      * @throws IllegalArgumentException if the bioDemographics is null
773      * @throws IllegalStateException if the bioDemographics already exists in the system or bioDemographics is not populated with entityId
774      */
775     @WebMethod(operationName="addBioDemographicsToEntity")
776     @WebResult(name = "bioDemographics")
777     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
778     EntityBioDemographics addBioDemographicsToEntity(@WebParam(name = "bioDemographics") EntityBioDemographics bioDemographics)
779         throws RiceIllegalArgumentException, RiceIllegalStateException;
780 
781     /**
782      * This will update a {@link org.kuali.rice.kim.api.identity.personal.EntityBioDemographics} exactly like the bioDemographics passed in.
783      *
784      *
785      * @param bioDemographics the EntityBioDemographics to update
786      * @return the updated EntityBioDemographics object.
787      * @throws IllegalArgumentException if the bioDemographics is null
788      * @throws IllegalStateException if the bioDemographics does not exist in the system.
789      */
790     @WebMethod(operationName="updateBioDemographics")
791     @WebResult(name = "bioDemographics")
792     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
793     EntityBioDemographics updateBioDemographics(@WebParam(name = "bioDemographics") EntityBioDemographics bioDemographics)
794         throws RiceIllegalArgumentException, RiceIllegalStateException;
795     
796     /**
797      * Gets a {@link org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences} for a given id.
798      *
799      * <p>
800      *   This method will return null if the EntityPrivacyPreferences does not exist.
801      * </p>
802      *
803      * @param id the unique id to retrieve the EntityPrivacyPreferences by. Cannot be null.
804      * @return a {@link org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences} or null
805      * @throws IllegalArgumentException if the entityId is blank
806      */
807     @WebMethod(operationName = "getEntityPrivacyPreferences")
808     @WebResult(name = "privacyPreferences")
809     @Cacheable(value= EntityPrivacyPreferences.Cache.NAME, key="'id=' + #p0")
810 	EntityPrivacyPreferences getEntityPrivacyPreferences( @WebParam(name="id") String id )  throws RiceIllegalArgumentException;
811 
812     /**
813      * This will create a {@link org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences} exactly like the privacyPreferences passed in.
814      *
815      * The EntityPrivacyPreferences object passed in must be populated with an entityId
816      *
817      * @param privacyPreferences the EntityPrivacyPreferences to create
818      * @return the newly created EntityPrivacyPreferences object.
819      * @throws IllegalArgumentException if the privacyPreferences is null
820      * @throws IllegalStateException if the privacyPreferences already exists in the system or privacyPreferences is not populated with entityId
821      */
822     @WebMethod(operationName="addPrivacyPreferencesToEntity")
823     @WebResult(name = "privacyPreferences")
824     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityPrivacyPreferences.Cache.NAME}, allEntries = true)
825     EntityPrivacyPreferences addPrivacyPreferencesToEntity(@WebParam(name = "privacyPreferences") EntityPrivacyPreferences privacyPreferences)
826         throws RiceIllegalArgumentException, RiceIllegalStateException;
827 
828     /**
829      * This will update a {@link org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences} exactly like the privacyPreferences passed in.
830      *
831      *
832      * @param privacyPreferences the EntityPrivacyPreferences to update
833      * @return the updated EntityPrivacyPreferences object.
834      * @throws IllegalArgumentException if the privacyPreferences is null
835      * @throws IllegalStateException if the privacyPreferences does not exist in the system.
836      */
837     @WebMethod(operationName="updatePrivacyPreferences")
838     @WebResult(name = "privacyPreferences")
839     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, EntityPrivacyPreferences.Cache.NAME}, allEntries = true)
840     EntityPrivacyPreferences updatePrivacyPreferences(@WebParam(name = "privacyPreferences") EntityPrivacyPreferences privacyPreferences)
841         throws RiceIllegalArgumentException, RiceIllegalStateException;
842 
843 
844     /**
845      * This will create a {@link org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship} exactly like the citizenship passed in.
846      *
847      * The EntityCitizenship object passed in must be populated with an entityId and a status
848      *
849      * @param citizenship the EntityCitizenship to create
850      * @return the newly created EntityCitizenship object.
851      * @throws IllegalArgumentException if the citizenship is null
852      * @throws IllegalStateException if the citizenship already exists in the system or citizenship is not populated with entityId and status
853      */
854     @WebMethod(operationName="addCitizenshipToEntity")
855     @WebResult(name = "citizenship")
856     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
857     EntityCitizenship addCitizenshipToEntity(@WebParam(name = "citizenship") EntityCitizenship citizenship)
858         throws RiceIllegalArgumentException, RiceIllegalStateException;
859 
860     /**
861      * This will update a {@link org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship} exactly like the citizenship passed in.
862      *
863      *
864      * @param citizenship the EntityCitizenship to update
865      * @return the updated EntityCitizenship object.
866      * @throws IllegalArgumentException if the citizenship is null
867      * @throws IllegalStateException if the citizenship does not exist in the system.
868      */
869     @WebMethod(operationName="updateCitizenship")
870     @WebResult(name = "citizenship")
871     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
872     EntityCitizenship updateCitizenship(@WebParam(name = "citizenship") EntityCitizenship citizenship)
873         throws RiceIllegalArgumentException, RiceIllegalStateException;
874 
875     /**
876      * This will inactivate a {@link org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship} with the unique id passed in.
877      *
878      *
879      * @param id the id of the EntityCitizenship to inactivate
880      * @return the inactivated EntityCitizenship object.
881      * @throws IllegalArgumentException if the citizenship is null
882      * @throws IllegalStateException if the citizenship does not exist in the system.
883      */
884     @WebMethod(operationName="inactivateCitizenship")
885     @WebResult(name = "citizenship")
886     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
887     EntityCitizenship inactivateCitizenship(@WebParam(name = "id") String id)
888         throws RiceIllegalArgumentException, RiceIllegalStateException;
889 
890     /**
891      * This will create a {@link EntityEthnicity} exactly like the ethnicity passed in.
892      *
893      * The EntityEthnicity object passed in must be populated with an entityId and a ethnicity code
894      *
895      * @param ethnicity the EntityEthnicity to create
896      * @return the newly created EntityEthnicity object.
897      * @throws IllegalArgumentException if the ethnicity is null
898      * @throws IllegalStateException if the ethnicity already exists in the system or ethnicity is not populated with entityId and ethnicity code
899      */
900     @WebMethod(operationName="addEthnicityToEntity")
901     @WebResult(name = "ethnicity")
902     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
903     EntityEthnicity addEthnicityToEntity(@WebParam(name = "ethnicity") EntityEthnicity ethnicity)
904         throws RiceIllegalArgumentException, RiceIllegalStateException;
905 
906     /**
907      * This will update a {@link EntityEthnicity} exactly like the ethnicity passed in.
908      *
909      *
910      * @param ethnicity the EntityEthnicity to update
911      * @return the updated EntityEthnicity object.
912      * @throws IllegalArgumentException if the ethnicity is null
913      * @throws IllegalStateException if the ethnicity does not exist in the system.
914      */
915     @WebMethod(operationName="updateEthnicity")
916     @WebResult(name = "ethnicity")
917     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
918     EntityEthnicity updateEthnicity(@WebParam(name = "ethnicity") EntityEthnicity ethnicity)
919         throws RiceIllegalArgumentException, RiceIllegalStateException;
920 
921     /**
922      * This will create a {@link org.kuali.rice.kim.api.identity.residency.EntityResidency} exactly like the residency passed in.
923      *
924      * The EntityResidency object passed in must be populated with an entityId
925      *
926      * @param residency the EntityResidency to create
927      * @return the newly created EntityResidency object.
928      * @throws IllegalArgumentException if the residency is null
929      * @throws IllegalStateException if the residency already exists in the system or residency is not populated with entityId
930      */
931     @WebMethod(operationName="addResidencyToEntity")
932     @WebResult(name = "residency")
933     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
934     EntityResidency addResidencyToEntity(@WebParam(name = "residency") EntityResidency residency)
935         throws RiceIllegalArgumentException, RiceIllegalStateException;
936 
937     /**
938      * This will update a {@link org.kuali.rice.kim.api.identity.residency.EntityResidency} exactly like the residency passed in.
939      *
940      *
941      * @param residency the EntityResidency to update
942      * @return the updated EntityResidency object.
943      * @throws IllegalArgumentException if the residency is null
944      * @throws IllegalStateException if the residency does not exist in the system.
945      */
946     @WebMethod(operationName="updateResidency")
947     @WebResult(name = "residency")
948     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
949     EntityResidency updateResidency(@WebParam(name = "residency") EntityResidency residency)
950         throws RiceIllegalArgumentException, RiceIllegalStateException;
951 
952 
953     /**
954      * This will create a {@link org.kuali.rice.kim.api.identity.visa.EntityVisa} exactly like the visa passed in.
955      *
956      * The EntityVisa object passed in must be populated with an entityId and a visaTypeKey
957      *
958      * @param visa the EntityVisa to create
959      * @return the newly created EntityVisa object.
960      * @throws IllegalArgumentException if the visa is null
961      * @throws IllegalStateException if the visa already exists in the system or visa is not populated with entityId and a visaTypeKey
962      */
963     @WebMethod(operationName="addVisaToEntity")
964     @WebResult(name = "visa")
965     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
966     EntityVisa addVisaToEntity(@WebParam(name = "visa") EntityVisa visa)
967         throws RiceIllegalArgumentException, RiceIllegalStateException;
968 
969     /**
970      * This will update a {@link org.kuali.rice.kim.api.identity.visa.EntityVisa} exactly like the visa passed in.
971      *
972      *
973      * @param visa the EntityVisa to update
974      * @return the updated EntityVisa object.
975      * @throws IllegalArgumentException if the visa is null
976      * @throws IllegalStateException if the visa does not exist in the system.
977      */
978     @WebMethod(operationName="updateVisa")
979     @WebResult(name = "visa")
980     @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME}, allEntries = true)
981     EntityVisa updateVisa(@WebParam(name = "visa") EntityVisa visa)
982         throws RiceIllegalArgumentException, RiceIllegalStateException;
983 
984     /**
985      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityType code.
986      *
987      * <p>
988      *   This method will return null if the code does not exist.
989      * </p>
990      *
991      * @param code the unique id to retrieve the Type by. Cannot be null.
992      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
993      * @throws IllegalArgumentException if the code is blank
994      */
995     @WebMethod(operationName = "getEntityType")
996     @WebResult(name = "type")
997     @Cacheable(value= CodedAttribute.Cache.NAME + "{EntityType}", key="'code=' + #p0")
998 	CodedAttribute getEntityType( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
999 
1000 
1001     /**
1002      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityAddressType code.
1003      *
1004      * <p>
1005      *   This method will return null if the code does not exist.
1006      * </p>
1007      *
1008      * @param code the unique id to retrieve the Type by. Cannot be null.
1009      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1010      * @throws IllegalArgumentException if the code is blank
1011      */
1012     @WebMethod(operationName = "getAddressType")
1013     @WebResult(name = "type")
1014     @Cacheable(value= CodedAttribute.Cache.NAME + "{AddressType}", key="'code=' + #p0")
1015 	CodedAttribute getAddressType( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1016 
1017     /**
1018      * Gets the {@link org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType} for a given EntityAffiliationType code.
1019      *
1020      * <p>
1021      *   This method will return null if the code does not exist.
1022      * </p>
1023      *
1024      * @param code the unique id to retrieve the EntityAffiliationType by. Cannot be null.
1025      * @return a {@link org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType} or null
1026      * @throws IllegalArgumentException if the code is blank
1027      */
1028     @WebMethod(operationName = "getAffiliationType")
1029     @WebResult(name = "affiliationType")
1030     @Cacheable(value= CodedAttribute.Cache.NAME + "{AffiliationType}", key="'code=' + #p0")
1031 	EntityAffiliationType getAffiliationType( @WebParam(name="code") String code )  throws RiceIllegalArgumentException;
1032 
1033     /**
1034      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityCitizenship status code.
1035      *
1036      * <p>
1037      *   This method will return null if the code does not exist.
1038      * </p>
1039      *
1040      * @param code the unique id to retrieve the Type by. Cannot be null.
1041      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1042      * @throws IllegalArgumentException if the code is blank
1043      */
1044     @WebMethod(operationName = "getCitizenshipStatus")
1045     @WebResult(name = "type")
1046     @Cacheable(value= CodedAttribute.Cache.NAME + "{CitizenshipStatus}", key="'code=' + #p0")
1047 	CodedAttribute getCitizenshipStatus( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1048 
1049     /**
1050      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityEmployment type code.
1051      *
1052      * <p>
1053      *   This method will return null if the code does not exist.
1054      * </p>
1055      *
1056      * @param code the unique id to retrieve the Type by. Cannot be null.
1057      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1058      * @throws IllegalArgumentException if the code is blank
1059      */
1060     @WebMethod(operationName = "getEmploymentType")
1061     @WebResult(name = "type")
1062     @Cacheable(value= CodedAttribute.Cache.NAME + "{EmploymentType}", key="'code=' + #p0")
1063 	CodedAttribute getEmploymentType( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1064     
1065     /**
1066      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityEmployment status code.
1067      *
1068      * <p>
1069      *   This method will return null if the code does not exist.
1070      * </p>
1071      *
1072      * @param code the unique id to retrieve the Type by. Cannot be null.
1073      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1074      * @throws IllegalArgumentException if the code is blank
1075      */
1076     @WebMethod(operationName = "getEmploymentStatus")
1077     @WebResult(name = "type")
1078     @Cacheable(value= CodedAttribute.Cache.NAME + "{EmploymentStatus}", key="'code=' + #p0")
1079 	CodedAttribute getEmploymentStatus( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1080     
1081     /**
1082      * Gets the {@link org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierType} for a given type code.
1083      *
1084      * <p>
1085      *   This method will return null if the code does not exist.
1086      * </p>
1087      *
1088      * @param code the unique id to retrieve the EntityExternalIdentifierType by. Cannot be null.
1089      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1090      * @throws IllegalArgumentException if the code is blank
1091      */
1092     @WebMethod(operationName = "getExternalIdentifierType")
1093     @WebResult(name = "type")
1094     @Cacheable(value= CodedAttribute.Cache.NAME + "{ExternalIdentifierType}", key="'code=' + #p0")
1095 	EntityExternalIdentifierType getExternalIdentifierType( @WebParam(name="code") String code )  throws RiceIllegalArgumentException;
1096     
1097     /**
1098      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityName type code.
1099      *
1100      * <p>
1101      *   This method will return null if the code does not exist.
1102      * </p>
1103      *
1104      * @param code the unique id to retrieve the Type by. Cannot be null.
1105      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1106      * @throws IllegalArgumentException if the code is blank
1107      */
1108     @WebMethod(operationName = "getNameType")
1109     @WebResult(name = "type")
1110     @Cacheable(value= CodedAttribute.Cache.NAME + "{NameType}", key="'code=' + #p0")
1111 	CodedAttribute getNameType(@WebParam(name = "code") String code) throws RiceIllegalArgumentException;
1112     
1113     /**
1114      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityPhone type code.
1115      *
1116      * <p>
1117      *   This method will return null if the code does not exist.
1118      * </p>
1119      *
1120      * @param code the unique id to retrieve the Type by. Cannot be null.
1121      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1122      * @throws IllegalArgumentException if the code is blank
1123      */
1124     @WebMethod(operationName = "getPhoneType")
1125     @WebResult(name = "type")
1126     @Cacheable(value= CodedAttribute.Cache.NAME + "{PhoneType}", key="'code=' + #p0")
1127 	CodedAttribute getPhoneType( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1128     
1129     /**
1130      * Gets the {@link org.kuali.rice.kim.api.identity.CodedAttribute} for a given EntityEmail type code.
1131      *
1132      * <p>
1133      *   This method will return null if the code does not exist.
1134      * </p>
1135      *
1136      * @param code the unique id to retrieve the Type by. Cannot be null.
1137      * @return a {@link org.kuali.rice.kim.api.identity.CodedAttribute} or null
1138      * @throws IllegalArgumentException if the code is blank
1139      */
1140     @WebMethod(operationName = "getEmailType")
1141     @WebResult(name = "type")
1142     @Cacheable(value= CodedAttribute.Cache.NAME + "{EmailType}", key="'code=' + #p0")
1143 	CodedAttribute getEmailType( @WebParam(name="code") String code ) throws RiceIllegalArgumentException;
1144 
1145 }