001 /**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.kim.api.services;
017
018 import org.apache.log4j.Logger;
019 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
020 import org.kuali.rice.kim.api.group.GroupService;
021 import org.kuali.rice.kim.api.identity.IdentityService;
022 import org.kuali.rice.kim.api.identity.PersonService;
023 import org.kuali.rice.kim.api.permission.PermissionService;
024 import org.kuali.rice.kim.api.responsibility.ResponsibilityService;
025 import org.kuali.rice.kim.api.role.RoleService;
026 import org.kuali.rice.kim.api.type.KimTypeInfoService;
027
028 public class KimApiServiceLocator {
029
030 private static final Logger LOG = Logger.getLogger(KimApiServiceLocator.class);
031
032 public static final String KIM_GROUP_SERVICE = "kimGroupService";
033 public static final String KIM_IDENTITY_SERVICE = "kimIdentityService";
034 public static final String KIM_PERMISSION_SERVICE = "kimPermissionService";
035 public static final String KIM_RESPONSIBILITY_SERVICE = "kimResponsibilityService";
036 public static final String KIM_ROLE_SERVICE = "kimRoleService";
037 public static final String KIM_PERSON_SERVICE = "personService";
038 public static final String KIM_TYPE_INFO_SERVICE = "kimTypeInfoService";
039
040 static <T> T getService(String serviceName) {
041 return GlobalResourceLoader.<T>getService(serviceName);
042 }
043
044 public static KimTypeInfoService getKimTypeInfoService() {
045 return getService(KIM_TYPE_INFO_SERVICE);
046 }
047
048 public static PersonService getPersonService() {
049 return getService(KIM_PERSON_SERVICE);
050 }
051
052 public static RoleService getRoleService() {
053 return getService(KIM_ROLE_SERVICE);
054 }
055
056 public static GroupService getGroupService() {
057 return getService(KIM_GROUP_SERVICE);
058 }
059
060 public static IdentityService getIdentityService() {
061 return getService(KIM_IDENTITY_SERVICE);
062 }
063 public static PermissionService getPermissionService() {
064 return getService(KIM_PERMISSION_SERVICE);
065 }
066 public static ResponsibilityService getResponsibilityService() {
067 return getService(KIM_RESPONSIBILITY_SERVICE);
068 }
069
070 }