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