View Javadoc

1   /**
2    * Copyright 2012 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   *
15   * Created by Li Pan on 5/7/12
16   */
17  package org.kuali.student.enrollment.class2.courseoffering.util;
18  
19  import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20  import org.kuali.student.enrollment.coursewaitlist.service.CourseWaitListService;
21  import org.kuali.student.enrollment.lui.service.LuiService;
22  import org.kuali.student.r2.common.util.constants.CourseWaitListServiceConstants;
23  import org.kuali.student.r2.common.util.constants.LuiServiceConstants;
24  import org.kuali.student.r2.core.acal.service.AcademicCalendarService;
25  import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService;
26  import org.kuali.student.enrollment.courseofferingset.service.CourseOfferingSetService;
27  import org.kuali.student.r2.common.constants.CommonServiceConstants;
28  import org.kuali.student.r2.core.constants.AcademicCalendarServiceConstants;
29  import org.kuali.student.r2.common.util.constants.CourseOfferingServiceConstants;
30  import org.kuali.student.r2.common.util.constants.CourseOfferingSetServiceConstants;
31  import org.kuali.student.r2.core.atp.service.AtpService;
32  import org.kuali.student.r2.core.class1.state.service.StateService;
33  import org.kuali.student.r2.core.class1.type.service.TypeService;
34  import org.kuali.student.r2.core.constants.AtpServiceConstants;
35  import org.kuali.student.r2.core.constants.RoomServiceConstants;
36  import org.kuali.student.r2.core.constants.StateServiceConstants;
37  import org.kuali.student.r2.core.constants.TypeServiceConstants;
38  import org.kuali.student.r2.core.room.service.RoomService;
39  import org.kuali.student.r2.core.scheduling.constants.SchedulingServiceConstants;
40  import org.kuali.student.r2.core.scheduling.service.SchedulingService;
41  import org.kuali.student.r2.lum.clu.service.CluService;
42  import org.kuali.student.r2.lum.course.service.CourseService;
43  import org.kuali.student.r2.lum.lrc.service.LRCService;
44  import org.kuali.student.r2.lum.util.constants.CluServiceConstants;
45  import org.kuali.student.r2.lum.util.constants.LrcServiceConstants;
46  
47  import javax.xml.namespace.QName;
48  
49  /**
50   * This class provides common accessor logic to the service bus for specific service instances
51   *
52   * @author Kuali Student Team
53   */
54  public class CourseOfferingResourceLoader {
55  
56      public static CourseWaitListService loadCourseWaitlistService(){
57          CourseWaitListService courseWaitListService = (CourseWaitListService) GlobalResourceLoader.getService(new QName(CourseWaitListServiceConstants.NAMESPACE, CourseWaitListServiceConstants.SERVICE_NAME_LOCAL_PART));
58          return  courseWaitListService;
59      }
60  
61      public static CourseOfferingService loadCourseOfferingService(){
62          CourseOfferingService courseOfferingService = (CourseOfferingService) GlobalResourceLoader.getService(new QName(CourseOfferingServiceConstants.NAMESPACE, CourseOfferingServiceConstants.SERVICE_NAME_LOCAL_PART));
63          return  courseOfferingService;
64      }
65  
66      public static CourseOfferingSetService loadCourseOfferingSetService(){
67          CourseOfferingSetService courseOfferingSetService = (CourseOfferingSetService) GlobalResourceLoader.getService(new QName(CourseOfferingSetServiceConstants.NAMESPACE, CourseOfferingSetServiceConstants.SERVICE_NAME_LOCAL_PART));
68          return  courseOfferingSetService;
69      }
70  
71      public static TypeService loadTypeService() {
72          TypeService typeService = (TypeService) GlobalResourceLoader.getService(new QName(TypeServiceConstants.NAMESPACE, TypeServiceConstants.SERVICE_NAME_LOCAL_PART));
73  
74          return typeService;
75      }
76  
77      public static StateService loadStateService() {
78          StateService stateService = (StateService) GlobalResourceLoader.getService(new QName(StateServiceConstants.NAMESPACE, StateServiceConstants.SERVICE_NAME_LOCAL_PART));
79          return stateService;
80      }
81  
82      public static CourseService loadCourseService() {
83          CourseService courseService = GlobalResourceLoader.getService(new QName(CommonServiceConstants.REF_OBJECT_URI_GLOBAL_PREFIX + "course", "CourseService"));
84          return courseService;
85      }
86  
87      public static CluService loadCluService() {
88          CluService cluService = (CluService)GlobalResourceLoader.getService(new QName(CluServiceConstants.CLU_NAMESPACE,CluServiceConstants.SERVICE_NAME_LOCAL_PART));
89          return cluService;
90      }
91  
92      public static AcademicCalendarService loadAcademicCalendarService() {
93          AcademicCalendarService acalService = (AcademicCalendarService)GlobalResourceLoader.getService(new QName(AcademicCalendarServiceConstants.NAMESPACE, AcademicCalendarServiceConstants.SERVICE_NAME_LOCAL_PART));
94          return acalService;
95      }
96  
97      public static LRCService loadLrcService() {
98          LRCService lrcService = (LRCService)GlobalResourceLoader.getService(new QName(LrcServiceConstants.NAMESPACE, LrcServiceConstants.SERVICE_NAME_LOCAL_PART));
99          return lrcService;
100     }
101     public static SchedulingService loadSchedulingService() {
102         SchedulingService schedulingService = (SchedulingService)GlobalResourceLoader.getService(new QName(SchedulingServiceConstants.NAMESPACE, SchedulingServiceConstants.SERVICE_NAME_LOCAL_PART));
103         return schedulingService;
104     }
105 
106     public static RoomService loadRoomService() {
107         RoomService roomService = (RoomService)GlobalResourceLoader.getService(new QName(RoomServiceConstants.NAMESPACE, RoomServiceConstants.SERVICE_NAME_LOCAL_PART));
108         return roomService;
109     }
110 
111     public static AtpService loadAtpService() {
112         AtpService atpService = (AtpService)GlobalResourceLoader.getService(new QName(AtpServiceConstants.NAMESPACE, AtpServiceConstants.SERVICE_NAME_LOCAL_PART));
113         return atpService;
114     }
115 
116     public static LuiService loadLuiService() {
117         LuiService luiService = (LuiService)GlobalResourceLoader.getService(new QName(LuiServiceConstants.NAMESPACE, LuiServiceConstants.SERVICE_NAME_LOCAL_PART));
118         return luiService;
119     }
120 
121     public static CourseOfferingSetService loadSocService() {
122         CourseOfferingSetService socService = (CourseOfferingSetService) GlobalResourceLoader.getService(new QName(CourseOfferingSetServiceConstants.NAMESPACE,
123                 CourseOfferingSetServiceConstants.SERVICE_NAME_LOCAL_PART));
124         return socService;
125     }
126 }