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