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