1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.api.services;
17
18 import org.apache.log4j.Logger;
19 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20 import org.kuali.rice.kim.api.group.GroupService;
21 import org.kuali.rice.kim.api.identity.IdentityService;
22 import org.kuali.rice.kim.api.identity.PersonService;
23 import org.kuali.rice.kim.api.permission.PermissionService;
24 import org.kuali.rice.kim.api.responsibility.ResponsibilityService;
25 import org.kuali.rice.kim.api.role.RoleService;
26 import org.kuali.rice.kim.api.type.KimTypeInfoService;
27
28 public class KimApiServiceLocator {
29
30 private static final Logger LOG = Logger.getLogger(KimApiServiceLocator.class);
31
32 public static final String KIM_GROUP_SERVICE = "kimGroupService";
33 public static final String KIM_IDENTITY_SERVICE = "kimIdentityService";
34 public static final String KIM_PERMISSION_SERVICE = "kimPermissionService";
35 public static final String KIM_RESPONSIBILITY_SERVICE = "kimResponsibilityService";
36 public static final String KIM_ROLE_SERVICE = "kimRoleService";
37 public static final String KIM_PERSON_SERVICE = "personService";
38 public static final String KIM_TYPE_INFO_SERVICE = "kimTypeInfoService";
39
40 static <T> T getService(String serviceName) {
41 return GlobalResourceLoader.<T>getService(serviceName);
42 }
43
44 public static KimTypeInfoService getKimTypeInfoService() {
45 return getService(KIM_TYPE_INFO_SERVICE);
46 }
47
48 public static PersonService getPersonService() {
49 return getService(KIM_PERSON_SERVICE);
50 }
51
52 public static RoleService getRoleService() {
53 return getService(KIM_ROLE_SERVICE);
54 }
55
56 public static GroupService getGroupService() {
57 return getService(KIM_GROUP_SERVICE);
58 }
59
60 public static IdentityService getIdentityService() {
61 return getService(KIM_IDENTITY_SERVICE);
62 }
63 public static PermissionService getPermissionService() {
64 return getService(KIM_PERMISSION_SERVICE);
65 }
66 public static ResponsibilityService getResponsibilityService() {
67 return getService(KIM_RESPONSIBILITY_SERVICE);
68 }
69
70 }