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