1 | |
package org.kuali.rice.kim.api.services; |
2 | |
|
3 | |
import org.apache.log4j.Logger; |
4 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
5 | |
import org.kuali.rice.kim.api.group.GroupUpdateService; |
6 | |
import org.kuali.rice.kim.api.responsibility.ResponsibilityService; |
7 | |
import org.kuali.rice.kim.api.role.RoleService; |
8 | |
import org.kuali.rice.kim.api.role.RoleUpdateService; |
9 | |
import org.kuali.rice.kim.api.type.KimTypeInfoService; |
10 | |
import org.kuali.rice.kim.service.IdentityUpdateService; |
11 | |
import org.kuali.rice.kim.service.PermissionService; |
12 | |
import org.kuali.rice.kim.service.PermissionUpdateService; |
13 | |
import org.kuali.rice.kim.service.PersonService; |
14 | |
|
15 | 0 | public class KimApiServiceLocator { |
16 | 0 | private static final Logger LOG = Logger.getLogger(KimApiServiceLocator.class); |
17 | |
|
18 | |
public static final String KIM_GROUP_SERVICE = "kimGroupService"; |
19 | |
public static final String KIM_IDENTITY_SERVICE = "kimIdentityService"; |
20 | |
public static final String KIM_PERMISSION_SERVICE = "kimPermissionService"; |
21 | |
public static final String KIM_RESPONSIBILITY_SERVICE = "kimResponsibilityService"; |
22 | |
public static final String KIM_ROLE_SERVICE = "kimRoleService"; |
23 | |
public static final String KIM_PERSON_SERVICE = "personService"; |
24 | |
|
25 | |
public static final String KIM_IDENTITY_UPDATE_SERVICE = "kimIdentityUpdateService"; |
26 | |
public static final String KIM_GROUP_UPDATE_SERVICE = "kimGroupUpdateService"; |
27 | |
public static final String KIM_ROLE_UPDATE_SERVICE = "kimRoleUpdateService"; |
28 | |
public static final String KIM_PERMISSION_UPDATE_SERVICE = "kimPermissionUpdateService"; |
29 | |
public static final String KIM_TYPE_INFO_SERVICE = "kimTypeInfoService"; |
30 | |
|
31 | |
static <T> T getService(String serviceName) { |
32 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
33 | |
} |
34 | |
|
35 | |
public static KimTypeInfoService getKimTypeInfoService() { |
36 | 0 | return getService(KIM_TYPE_INFO_SERVICE); |
37 | |
} |
38 | |
|
39 | |
public static PersonService getPersonService() { |
40 | 0 | if (LOG.isDebugEnabled()) { |
41 | 0 | LOG.debug("Fetching service " + KIM_PERSON_SERVICE); |
42 | |
} |
43 | 0 | return getService(KIM_PERSON_SERVICE); |
44 | |
} |
45 | |
|
46 | |
public static RoleService getRoleService() { |
47 | 0 | return getService(KIM_ROLE_SERVICE); |
48 | |
} |
49 | |
|
50 | |
public static org.kuali.rice.kim.api.group.GroupService getGroupService() { |
51 | 0 | return getService(KIM_GROUP_SERVICE); |
52 | |
} |
53 | |
|
54 | |
public static IdentityService getIdentityService() { |
55 | 0 | return getService(KIM_IDENTITY_SERVICE); |
56 | |
} |
57 | |
public static PermissionService getPermissionService() { |
58 | 0 | return getService(KIM_PERMISSION_SERVICE); |
59 | |
} |
60 | |
public static ResponsibilityService getResponsibilityService() { |
61 | 0 | return getService(KIM_RESPONSIBILITY_SERVICE); |
62 | |
} |
63 | |
|
64 | |
public static IdentityUpdateService getIdentityUpdateService() { |
65 | 0 | return getService(KIM_IDENTITY_UPDATE_SERVICE); |
66 | |
} |
67 | |
|
68 | |
public static GroupUpdateService getGroupUpdateService() { |
69 | 0 | return getService(KIM_GROUP_UPDATE_SERVICE); |
70 | |
} |
71 | |
|
72 | |
public static RoleUpdateService getRoleUpdateService() { |
73 | 0 | return getService(KIM_ROLE_UPDATE_SERVICE); |
74 | |
} |
75 | |
|
76 | |
|
77 | |
public static PermissionUpdateService getPermissionUpdateService() { |
78 | 0 | return getService(KIM_PERMISSION_UPDATE_SERVICE); |
79 | |
} |
80 | |
} |