View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   package org.kuali.student.kim.permission.mock;
6   
7   import org.kuali.rice.core.api.criteria.QueryByCriteria;
8   import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
9   import org.kuali.rice.core.api.exception.RiceIllegalStateException;
10  import org.kuali.rice.kim.api.identity.CodedAttribute;
11  import org.kuali.rice.kim.api.identity.IdentityService;
12  import org.kuali.rice.kim.api.identity.address.EntityAddress;
13  import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation;
14  import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType;
15  import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenship;
16  import org.kuali.rice.kim.api.identity.email.EntityEmail;
17  import org.kuali.rice.kim.api.identity.employment.EntityEmployment;
18  import org.kuali.rice.kim.api.identity.entity.Entity;
19  import org.kuali.rice.kim.api.identity.entity.EntityDefault;
20  import org.kuali.rice.kim.api.identity.entity.EntityDefaultQueryResults;
21  import org.kuali.rice.kim.api.identity.entity.EntityQueryResults;
22  import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifier;
23  import org.kuali.rice.kim.api.identity.external.EntityExternalIdentifierType;
24  import org.kuali.rice.kim.api.identity.name.EntityName;
25  import org.kuali.rice.kim.api.identity.personal.EntityBioDemographics;
26  import org.kuali.rice.kim.api.identity.personal.EntityEthnicity;
27  import org.kuali.rice.kim.api.identity.phone.EntityPhone;
28  import org.kuali.rice.kim.api.identity.principal.EntityNamePrincipalName;
29  import org.kuali.rice.kim.api.identity.principal.Principal;
30  import org.kuali.rice.kim.api.identity.principal.PrincipalQueryResults;
31  import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
32  import org.kuali.rice.kim.api.identity.residency.EntityResidency;
33  import org.kuali.rice.kim.api.identity.type.EntityTypeContactInfo;
34  import org.kuali.rice.kim.api.identity.visa.EntityVisa;
35  import org.kuali.student.common.mock.MockService;
36  
37  import javax.jws.WebParam;
38  import java.util.HashMap;
39  import java.util.List;
40  import java.util.Map;
41  
42  /**
43   *
44   * @author nwright
45   */
46  public class IdentityServiceMockImpl implements IdentityService, MockService {
47  
48      private Map<String, Entity> entities = new HashMap<String,Entity> ();
49      
50      
51      @Override
52  	public void clear() {
53      	this.entities.clear();
54  		
55  	}
56  
57  	@Override
58      public EntityAddress addAddressToEntity(EntityAddress ea) throws RiceIllegalArgumentException, RiceIllegalStateException {
59          throw new UnsupportedOperationException("Not supported yet.");
60      }
61  
62      @Override
63      public EntityAffiliation addAffiliationToEntity(EntityAffiliation ea) throws RiceIllegalArgumentException, RiceIllegalStateException {
64          throw new UnsupportedOperationException("Not supported yet.");
65      }
66  
67      @Override
68      public EntityBioDemographics addBioDemographicsToEntity(EntityBioDemographics ebd) throws RiceIllegalArgumentException, RiceIllegalStateException {
69          throw new UnsupportedOperationException("Not supported yet.");
70      }
71  
72      @Override
73      public EntityCitizenship addCitizenshipToEntity(EntityCitizenship ec) throws RiceIllegalArgumentException, RiceIllegalStateException {
74          throw new UnsupportedOperationException("Not supported yet.");
75      }
76  
77      @Override
78      public EntityEmail addEmailToEntity(EntityEmail ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
79          throw new UnsupportedOperationException("Not supported yet.");
80      }
81  
82      @Override
83      public EntityEmployment addEmploymentToEntity(EntityEmployment ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
84          throw new UnsupportedOperationException("Not supported yet.");
85      }
86  
87      @Override
88      public EntityTypeContactInfo addEntityTypeContactInfoToEntity(EntityTypeContactInfo etci) throws RiceIllegalArgumentException, RiceIllegalStateException {
89          throw new UnsupportedOperationException("Not supported yet.");
90      }
91  
92      @Override
93      public EntityEthnicity addEthnicityToEntity(EntityEthnicity ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
94          throw new UnsupportedOperationException("Not supported yet.");
95      }
96  
97      @Override
98      public EntityExternalIdentifier addExternalIdentifierToEntity(EntityExternalIdentifier eei) throws RiceIllegalArgumentException, RiceIllegalStateException {
99          throw new UnsupportedOperationException("Not supported yet.");
100     }
101 
102     @Override
103     public EntityName addNameToEntity(EntityName en) throws RiceIllegalArgumentException, RiceIllegalStateException {
104         throw new UnsupportedOperationException("Not supported yet.");
105     }
106 
107     @Override
108     public EntityPhone addPhoneToEntity(EntityPhone ep) throws RiceIllegalArgumentException, RiceIllegalStateException {
109         throw new UnsupportedOperationException("Not supported yet.");
110     }
111 
112     @Override
113     public Principal addPrincipalToEntity(Principal prncpl) throws RiceIllegalArgumentException, RiceIllegalStateException {
114         throw new UnsupportedOperationException("Not supported yet.");
115     }
116 
117     @Override
118     public EntityPrivacyPreferences addPrivacyPreferencesToEntity(EntityPrivacyPreferences epp) throws RiceIllegalArgumentException, RiceIllegalStateException {
119         throw new UnsupportedOperationException("Not supported yet.");
120     }
121 
122     @Override
123     public EntityResidency addResidencyToEntity(EntityResidency er) throws RiceIllegalArgumentException, RiceIllegalStateException {
124         throw new UnsupportedOperationException("Not supported yet.");
125     }
126 
127     @Override
128     public EntityVisa addVisaToEntity(EntityVisa ev) throws RiceIllegalArgumentException, RiceIllegalStateException {
129         throw new UnsupportedOperationException("Not supported yet.");
130     }
131 
132     @Override
133     public Entity createEntity(Entity entity) throws RiceIllegalArgumentException, RiceIllegalStateException {
134         Entity.Builder builder = Entity.Builder.create(entity);
135         if (builder.getId() == null) {
136             builder.setId(this.entities.size() + "");
137         }
138         Entity copy = builder.build();
139         this.entities.put(entity.getId(), copy);
140         return copy;
141     }
142 
143     @Override
144     public EntityQueryResults findEntities(QueryByCriteria qbc) throws RiceIllegalArgumentException {
145         throw new UnsupportedOperationException("Not supported yet.");
146     }
147 
148     @Override
149     public EntityDefaultQueryResults findEntityDefaults(QueryByCriteria qbc) throws RiceIllegalArgumentException {
150         throw new UnsupportedOperationException("Not supported yet.");
151     }
152 
153     @Override
154     public CodedAttribute getAddressType(String string) throws RiceIllegalArgumentException {
155         throw new UnsupportedOperationException("Not supported yet.");
156     }
157 
158     @Override
159     public List<CodedAttribute> findAllAddressTypes() {
160         throw new UnsupportedOperationException("Not supported yet.");
161     }
162 
163     @Override
164     public EntityAffiliationType getAffiliationType(String string) throws RiceIllegalArgumentException {
165         throw new UnsupportedOperationException("Not supported yet.");
166     }
167 
168     @Override
169     public List<EntityAffiliationType> findAllAffiliationTypes() {
170         throw new UnsupportedOperationException("Not supported yet.");
171     }
172 
173     @Override
174     public CodedAttribute getCitizenshipStatus(String string) throws RiceIllegalArgumentException {
175         throw new UnsupportedOperationException("Not supported yet.");
176     }
177 
178     @Override
179     public List<CodedAttribute> findAllCitizenshipStatuses() {
180         throw new UnsupportedOperationException("Not supported yet.");
181     }
182 
183     @Override
184     public CodedAttribute getEmailType(String string) throws RiceIllegalArgumentException {
185         throw new UnsupportedOperationException("Not supported yet.");
186     }
187 
188     @Override
189     public List<CodedAttribute> findAllEmailTypes() {
190         throw new UnsupportedOperationException("Not supported yet.");
191     }
192 
193     @Override
194     public PrincipalQueryResults findPrincipals(@WebParam(name = "query") QueryByCriteria query) throws RiceIllegalArgumentException {
195         throw new UnsupportedOperationException("Not supported yet.");
196     }
197 
198     @Override
199     public CodedAttribute getEmploymentStatus(String string) throws RiceIllegalArgumentException {
200         throw new UnsupportedOperationException("Not supported yet.");
201     }
202 
203     @Override
204     public List<CodedAttribute> findAllEmploymentStatuses() {
205         throw new UnsupportedOperationException("Not supported yet.");
206     }
207 
208     @Override
209     public CodedAttribute getEmploymentType(String string) throws RiceIllegalArgumentException {
210         throw new UnsupportedOperationException("Not supported yet.");
211     }
212 
213     @Override
214     public List<CodedAttribute> findAllEmploymentTypes() {
215         throw new UnsupportedOperationException("Not supported yet.");
216     }
217 
218     @Override
219     public Entity getEntity(String id) throws RiceIllegalArgumentException {
220         Entity entity = this.entities.get(id);
221         return entity;
222     }
223 
224     @Override
225     public Entity getEntityByPrincipalId(String string) throws RiceIllegalArgumentException {
226         throw new UnsupportedOperationException("Not supported yet.");
227     }
228 
229     @Override
230     public Entity getEntityByPrincipalName(String string) throws RiceIllegalArgumentException {
231         throw new UnsupportedOperationException("Not supported yet.");
232     }
233 
234     /**
235      * Gets a {@link Entity} from a employeeId.
236      * <p/>
237      * <p>
238      * This method will return null if the Entity does not exist.
239      * </p>
240      *
241      * @param employeeId the unique id to retrieve the entity by. cannot be null.
242      * @return a {@link Entity} or null
243      * @throws IllegalArgumentException if the employeeId is blank
244      */
245     @Override
246     public Entity getEntityByEmployeeId(@WebParam(name = "employeeId") String employeeId) throws RiceIllegalArgumentException {
247         throw new UnsupportedOperationException("Not supported yet.");
248     }
249 
250     @Override
251     public EntityDefault getEntityDefault(String string) throws RiceIllegalArgumentException {
252         throw new UnsupportedOperationException("Not supported yet.");
253     }
254 
255     @Override
256     public EntityDefault getEntityDefaultByPrincipalId(String string) throws RiceIllegalArgumentException {
257         throw new UnsupportedOperationException("Not supported yet.");
258     }
259 
260     @Override
261     public EntityDefault getEntityDefaultByPrincipalName(String string) throws RiceIllegalArgumentException {
262         throw new UnsupportedOperationException("Not supported yet.");
263     }
264 
265     /**
266      * Gets a {@link EntityDefault} from an employeeId.
267      * {@link EntityDefault} is a condensed version of {@link Entity} that contains
268      * default values of its subclasses
269      * <p/>
270      * <p>
271      * This method will return null if the Entity does not exist.
272      * </p>
273      *
274      * @param employeeId the unique id to retrieve the entity by. cannot be null.
275      * @return a {@link EntityDefault} or null
276      * @throws IllegalArgumentException if the employeeId is blank
277      */
278     @Override
279     public EntityDefault getEntityDefaultByEmployeeId(@WebParam(name = "employeeId") String employeeId) throws RiceIllegalArgumentException {
280         throw new UnsupportedOperationException("Not supported yet.");
281     }
282 
283     @Override
284     public EntityPrivacyPreferences getEntityPrivacyPreferences(String string) throws RiceIllegalArgumentException {
285         throw new UnsupportedOperationException("Not supported yet.");
286     }
287 
288     @Override
289     public CodedAttribute getEntityType(String string) throws RiceIllegalArgumentException {
290         throw new UnsupportedOperationException("Not supported yet.");
291     }
292 
293     @Override
294     public List<CodedAttribute> findAllEntityTypes() {
295         throw new UnsupportedOperationException("Not supported yet.");
296     }
297 
298     @Override
299     public EntityExternalIdentifierType getExternalIdentifierType(String string) throws RiceIllegalArgumentException {
300         throw new UnsupportedOperationException("Not supported yet.");
301     }
302 
303     @Override
304     public List<EntityExternalIdentifierType> findAllExternalIdendtifierTypes() {
305         throw new UnsupportedOperationException("Not supported yet.");
306     }
307 
308     @Override
309     public CodedAttribute getNameType(String string) throws RiceIllegalArgumentException {
310         throw new UnsupportedOperationException("Not supported yet.");
311     }
312 
313     @Override
314     public List<CodedAttribute> findAllNameTypes() {
315         throw new UnsupportedOperationException("Not supported yet.");
316     }
317 
318     @Override
319     public CodedAttribute getPhoneType(String string) throws RiceIllegalArgumentException {
320         throw new UnsupportedOperationException("Not supported yet.");
321     }
322 
323     @Override
324     public List<CodedAttribute> findAllPhoneTypes() {
325         throw new UnsupportedOperationException("Not supported yet.");
326     }
327 
328     @Override
329     public Principal getPrincipal(String string) throws RiceIllegalArgumentException {
330         throw new UnsupportedOperationException("Not supported yet.");
331     }
332 
333     @Override
334     public List<Principal> getPrincipals(@WebParam(name = "principalIds") List<String> strings) {
335         throw new UnsupportedOperationException("Not supported yet.");
336     }
337 
338     @Override
339     public Principal getPrincipalByPrincipalName(String string) throws RiceIllegalArgumentException {
340         throw new UnsupportedOperationException("Not supported yet.");
341     }
342 
343     @Override
344     public Principal getPrincipalByPrincipalNameAndPassword(String string, String string1) throws RiceIllegalArgumentException {
345         throw new UnsupportedOperationException("Not supported yet.");
346     }
347 
348     @Override
349     public EntityAddress inactivateAddress(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
350         throw new UnsupportedOperationException("Not supported yet.");
351     }
352 
353     @Override
354     public EntityAffiliation inactivateAffiliation(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
355         throw new UnsupportedOperationException("Not supported yet.");
356     }
357 
358     /**
359      * This returns the display name information for the given principal
360      * without loading the full person object.
361      *
362      * @param principalId The principal ID to find the name information for
363      * @return The default name information for the principal
364      */
365     @Override
366     public EntityNamePrincipalName getDefaultNamesForPrincipalId(@WebParam(name = "principalId") String principalId) {
367         throw new UnsupportedOperationException("Not supported yet.");
368     }
369 
370     @Override
371     public EntityCitizenship inactivateCitizenship(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
372         throw new UnsupportedOperationException("Not supported yet.");
373     }
374 
375     @Override
376     public EntityEmail inactivateEmail(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
377         throw new UnsupportedOperationException("Not supported yet.");
378     }
379 
380     @Override
381     public EntityEmployment inactivateEmployment(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
382         throw new UnsupportedOperationException("Not supported yet.");
383     }
384 
385     @Override
386     public Entity inactivateEntity(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
387         throw new UnsupportedOperationException("Not supported yet.");
388     }
389 
390     @Override
391     public EntityTypeContactInfo inactivateEntityTypeContactInfo(String string, String string1) throws RiceIllegalArgumentException, RiceIllegalStateException {
392         throw new UnsupportedOperationException("Not supported yet.");
393     }
394 
395     @Override
396     public EntityName inactivateName(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
397         throw new UnsupportedOperationException("Not supported yet.");
398     }
399 
400     @Override
401     public EntityPhone inactivatePhone(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
402         throw new UnsupportedOperationException("Not supported yet.");
403     }
404 
405     @Override
406     public Principal inactivatePrincipal(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
407         throw new UnsupportedOperationException("Not supported yet.");
408     }
409 
410     @Override
411     public Principal inactivatePrincipalByName(String string) throws RiceIllegalArgumentException, RiceIllegalStateException {
412         throw new UnsupportedOperationException("Not supported yet.");
413     }
414 
415     @Override
416     public EntityAddress updateAddress(EntityAddress ea) throws RiceIllegalArgumentException, RiceIllegalStateException {
417         throw new UnsupportedOperationException("Not supported yet.");
418     }
419 
420     @Override
421     public EntityAffiliation updateAffiliation(EntityAffiliation ea) throws RiceIllegalArgumentException, RiceIllegalStateException {
422         throw new UnsupportedOperationException("Not supported yet.");
423     }
424 
425     @Override
426     public EntityBioDemographics updateBioDemographics(EntityBioDemographics ebd) throws RiceIllegalArgumentException, RiceIllegalStateException {
427         throw new UnsupportedOperationException("Not supported yet.");
428     }
429 
430     @Override
431     public EntityCitizenship updateCitizenship(EntityCitizenship ec) throws RiceIllegalArgumentException, RiceIllegalStateException {
432         throw new UnsupportedOperationException("Not supported yet.");
433     }
434 
435     @Override
436     public EntityEmail updateEmail(EntityEmail ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
437         throw new UnsupportedOperationException("Not supported yet.");
438     }
439 
440     @Override
441     public EntityEmployment updateEmployment(EntityEmployment ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
442         throw new UnsupportedOperationException("Not supported yet.");
443     }
444 
445     @Override
446     public Entity updateEntity(Entity entity) throws RiceIllegalArgumentException, RiceIllegalStateException {
447         throw new UnsupportedOperationException("Not supported yet.");
448     }
449 
450     @Override
451     public EntityTypeContactInfo updateEntityTypeContactInfo(EntityTypeContactInfo etci) throws RiceIllegalArgumentException, RiceIllegalStateException {
452         throw new UnsupportedOperationException("Not supported yet.");
453     }
454 
455     @Override
456     public EntityEthnicity updateEthnicity(EntityEthnicity ee) throws RiceIllegalArgumentException, RiceIllegalStateException {
457         throw new UnsupportedOperationException("Not supported yet.");
458     }
459 
460     @Override
461     public EntityExternalIdentifier updateExternalIdentifier(EntityExternalIdentifier eei) throws RiceIllegalArgumentException, RiceIllegalStateException {
462         throw new UnsupportedOperationException("Not supported yet.");
463     }
464 
465     @Override
466     public EntityName updateName(EntityName en) throws RiceIllegalArgumentException, RiceIllegalStateException {
467         throw new UnsupportedOperationException("Not supported yet.");
468     }
469 
470     @Override
471     public EntityPhone updatePhone(EntityPhone ep) throws RiceIllegalArgumentException, RiceIllegalStateException {
472         throw new UnsupportedOperationException("Not supported yet.");
473     }
474 
475     @Override
476     public Principal updatePrincipal(Principal prncpl) throws RiceIllegalArgumentException, RiceIllegalStateException {
477         throw new UnsupportedOperationException("Not supported yet.");
478     }
479 
480     @Override
481     public EntityPrivacyPreferences updatePrivacyPreferences(EntityPrivacyPreferences epp) throws RiceIllegalArgumentException, RiceIllegalStateException {
482         throw new UnsupportedOperationException("Not supported yet.");
483     }
484 
485     @Override
486     public EntityResidency updateResidency(EntityResidency er) throws RiceIllegalArgumentException, RiceIllegalStateException {
487         throw new UnsupportedOperationException("Not supported yet.");
488     }
489 
490     @Override
491     public EntityVisa updateVisa(EntityVisa ev) throws RiceIllegalArgumentException, RiceIllegalStateException {
492         throw new UnsupportedOperationException("Not supported yet.");
493     }
494 
495 
496 }