1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ken.core;
17
18 import org.kuali.rice.ken.dao.NotificationDao;
19 import org.kuali.rice.ken.api.service.KENAPIService;
20 import org.kuali.rice.ken.dao.NotificationMessegeDeliveryDao;
21 import org.kuali.rice.ken.service.NotificationAuthorizationService;
22 import org.kuali.rice.ken.service.NotificationChannelService;
23 import org.kuali.rice.ken.service.NotificationContentTypeService;
24 import org.kuali.rice.ken.service.NotificationMessageContentService;
25 import org.kuali.rice.ken.service.NotificationMessageDeliveryAutoRemovalService;
26 import org.kuali.rice.ken.service.NotificationMessageDeliveryResolverService;
27 import org.kuali.rice.ken.service.NotificationMessageDeliveryService;
28 import org.kuali.rice.ken.service.NotificationRecipientService;
29 import org.kuali.rice.ken.service.NotificationService;
30 import org.kuali.rice.ken.service.NotificationWorkflowDocumentService;
31 import org.kuali.rice.ken.service.UserPreferenceService;
32 import org.quartz.Scheduler;
33 import org.springframework.beans.factory.BeanFactory;
34
35
36
37
38
39 public class SpringNotificationServiceLocator implements NotificationServiceLocator {
40
41 private static final String KENAPI_SERVICE = "kenApiService";
42 private static final String NOTIFICATION_SERVICE = "notificationService";
43 private static final String NOTIFICATION_CONTENT_TYPE_SERVICE = "notificationContentTypeService";
44 private static final String MESSAGE_CONTENT_SERVICE = "messageContentService";
45 private static final String NOTIFICATION_DAO = "kenNotificationDao";
46 private static final String NOTIFICATION_MESSEGE_DELIVERY_DAO = "kenNotificationMessegeDeliveryDao";
47
48 private static final String NOTIFICATION_AUTHORIZATION_SERVICE = "notificationAuthorizationService";
49 private static final String NOTIFICATION_WORKFLOW_DOCUMENT_SERVICE = "notificationWorkflowDocumentService";
50 private static final String NOTIFICATION_MESSAGE_DELIVERY_DISPATCH_SERVICE = "notificationMessageDeliveryDispatchService";
51 private static final String NOTIFICATION_MESSAGE_DELIVERY_RESOLVER_SERVICE = "notificationMessageDeliveryResolverService";
52 private static final String NOTIFICATION_MESSAGE_DELIVERY_AUTOREMOVAL_SERVICE = "notificationMessageDeliveryAutoRemovalService";
53 private static final String NOTIFICATION_RECIPIENT_SERVICE = "notificationRecipientService";
54 private static final String NOTIFICATION_MESSAGE_DELIVERY_SERVICE = "notificationMessageDeliveryService";
55 private static final String NOTIFICATION_MESSAGE_DELIVERER_REGISTRY_SERVICE = "notificationMessageDelivererRegistryService";
56 private static final String USER_PREFERENCE_SERVICE = "userPreferenceService";
57 private static final String NOTIFICATION_CHANNEL_SERVICE = "notificationChannelService";
58 private static final String NOTIFICATION_EMAIL_SERVICE = "notificationEmailService";
59 private static final String NOTIFICATION_CONFIG = "notificationConfig";
60 private static final String NOTIFICATION_SCHEDULER = "notificationScheduler";
61
62 private BeanFactory beanFactory;
63
64
65
66
67
68 public SpringNotificationServiceLocator(BeanFactory beanFactory) {
69 this.beanFactory = beanFactory;
70 }
71
72 public KENAPIService getKENAPIService() {
73 return (KENAPIService) beanFactory.getBean(KENAPI_SERVICE);
74 }
75
76
77
78
79
80 public NotificationService getNotificationService() {
81 return (NotificationService) beanFactory.getBean(NOTIFICATION_SERVICE);
82 }
83
84
85
86
87 public NotificationContentTypeService getNotificationContentTypeService() {
88 return (NotificationContentTypeService) beanFactory.getBean(NOTIFICATION_CONTENT_TYPE_SERVICE);
89 }
90
91
92
93
94 public NotificationMessageContentService getNotificationMessageContentService() {
95 return (NotificationMessageContentService) beanFactory.getBean(MESSAGE_CONTENT_SERVICE);
96 }
97
98 public NotificationDao getNotificationDao() {
99 return (NotificationDao) beanFactory.getBean(NOTIFICATION_DAO);
100 }
101
102 public NotificationMessegeDeliveryDao getNotificationMessegDeliveryDao() {
103 return (NotificationMessegeDeliveryDao) beanFactory.getBean(NOTIFICATION_MESSEGE_DELIVERY_DAO);
104 }
105
106
107
108
109 public NotificationAuthorizationService getNotificationAuthorizationService() {
110 return (NotificationAuthorizationService) beanFactory.getBean(NOTIFICATION_AUTHORIZATION_SERVICE);
111 }
112
113
114
115
116 public NotificationWorkflowDocumentService getNotificationWorkflowDocumentService() {
117 return (NotificationWorkflowDocumentService) beanFactory.getBean(NOTIFICATION_WORKFLOW_DOCUMENT_SERVICE);
118 }
119
120
121
122
123 public NotificationMessageDeliveryAutoRemovalService getNotificationMessageDeliveryAutoRemovalService() {
124 return (NotificationMessageDeliveryAutoRemovalService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_AUTOREMOVAL_SERVICE);
125 }
126
127
128
129
130 public NotificationMessageDeliveryResolverService getNotificationMessageDeliveryResolverService() {
131 return (NotificationMessageDeliveryResolverService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_RESOLVER_SERVICE);
132 }
133
134
135
136
137 public NotificationRecipientService getNotificationRecipientService() {
138 return (NotificationRecipientService) beanFactory.getBean(NOTIFICATION_RECIPIENT_SERVICE);
139 }
140
141
142
143
144 public NotificationMessageDeliveryService getNotificationMessageDeliveryService() {
145 return (NotificationMessageDeliveryService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_SERVICE);
146 }
147
148
149
150
151 public UserPreferenceService getUserPreferenceService() {
152 return (UserPreferenceService) beanFactory.getBean(USER_PREFERENCE_SERVICE);
153 }
154
155
156
157
158 public NotificationChannelService getNotificationChannelService() {
159 return (NotificationChannelService) beanFactory.getBean(NOTIFICATION_CHANNEL_SERVICE);
160 }
161
162
163
164
165 public Scheduler getScheduler() {
166 return (Scheduler) beanFactory.getBean(NOTIFICATION_SCHEDULER);
167 }
168 }