1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.location.api.services;
17
18 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
19 import org.kuali.rice.location.api.campus.CampusService;
20 import org.kuali.rice.location.api.country.CountryService;
21 import org.kuali.rice.location.api.county.CountyService;
22 import org.kuali.rice.location.api.postalcode.PostalCodeService;
23 import org.kuali.rice.location.api.state.StateService;
24
25
26
27
28
29
30 public class LocationApiServiceLocator {
31
32 public static final String COUNTRY_SERVICE = "countryService";
33
34 public static final String CAMPUS_SERVICE = "campusService";
35
36 public static final String STATE_SERVICE = "stateService";
37
38 public static final String COUNTY_SERVICE = "countyService";
39
40 public static final String POSTAL_CODE_SERVICE = "postalCodeService";
41
42 static <T> T getService(String serviceName) {
43 return GlobalResourceLoader.<T>getService(serviceName);
44 }
45
46 public static CountryService getCountryService() {
47 return getService(COUNTRY_SERVICE);
48 }
49
50 public static CampusService getCampusService() {
51 return getService(CAMPUS_SERVICE);
52 }
53
54 public static StateService getStateService() {
55 return getService(STATE_SERVICE);
56 }
57
58 public static CountyService getCountyService() {
59 return (CountyService) getService(COUNTY_SERVICE);
60 }
61
62 public static PostalCodeService getPostalCodeService() {
63 return (PostalCodeService) getService(POSTAL_CODE_SERVICE);
64 }
65
66 }