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