Coverage Report - org.kuali.rice.ken.core.SpringNotificationServiceLocator
 
Classes in this File Line Coverage Branch Coverage Complexity
SpringNotificationServiceLocator
0%
0/17
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
  * NotificationServiceLocator backed by a Spring Bean Factory - responsible for returning instances of services instantiated by the Spring context loader.
 36  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 37  
  */
 38  
 public class SpringNotificationServiceLocator implements NotificationServiceLocator {
 39  
     // Spring bean names
 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  
      * Constructs a SpringNotificationServiceLocator.java.
 63  
      * @param beanFactory
 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  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationService()
 76  
      */
 77  
     public NotificationService getNotificationService() {
 78  0
         return (NotificationService) beanFactory.getBean(NOTIFICATION_SERVICE);
 79  
     }
 80  
 
 81  
     /**
 82  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationContentTypeService()
 83  
      */
 84  
     public NotificationContentTypeService getNotificationContentTypeService() {
 85  0
         return (NotificationContentTypeService) beanFactory.getBean(NOTIFICATION_CONTENT_TYPE_SERVICE);
 86  
     }
 87  
 
 88  
     /**
 89  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationMessageContentService()
 90  
      */
 91  
     public NotificationMessageContentService getNotificationMessageContentService() {
 92  0
         return (NotificationMessageContentService) beanFactory.getBean(MESSAGE_CONTENT_SERVICE);
 93  
     }
 94  
 
 95  
     /**
 96  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getGenericDao()
 97  
      */
 98  
     public GenericDao getGenericDao() {
 99  0
         return (GenericDao) beanFactory.getBean(GENERIC_DAO);
 100  
     }
 101  
 
 102  
     /**
 103  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationAuthorizationService()
 104  
      */
 105  
     public NotificationAuthorizationService getNotificationAuthorizationService() {
 106  0
         return (NotificationAuthorizationService) beanFactory.getBean(NOTIFICATION_AUTHORIZATION_SERVICE);
 107  
     }
 108  
     
 109  
     /**
 110  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationWorkflowDocumentService()
 111  
      */
 112  
     public NotificationWorkflowDocumentService getNotificationWorkflowDocumentService() {
 113  0
         return (NotificationWorkflowDocumentService) beanFactory.getBean(NOTIFICATION_WORKFLOW_DOCUMENT_SERVICE);
 114  
     }
 115  
     
 116  
     /**
 117  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationMessageDeliveryAutoRemovalService()
 118  
      */
 119  
     public NotificationMessageDeliveryAutoRemovalService getNotificationMessageDeliveryAutoRemovalService() {
 120  0
         return (NotificationMessageDeliveryAutoRemovalService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_AUTOREMOVAL_SERVICE);
 121  
     }
 122  
 
 123  
     /**
 124  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationMessageDeliveryResolverService()
 125  
      */
 126  
     public NotificationMessageDeliveryResolverService getNotificationMessageDeliveryResolverService() {
 127  0
         return (NotificationMessageDeliveryResolverService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_RESOLVER_SERVICE);
 128  
     }
 129  
     
 130  
     /**
 131  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationRecipientService()
 132  
      */
 133  
     public NotificationRecipientService getNotificationRecipientService() {
 134  0
         return (NotificationRecipientService) beanFactory.getBean(NOTIFICATION_RECIPIENT_SERVICE);
 135  
     }
 136  
     
 137  
     /**
 138  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationMessageDeliveryService()
 139  
      */
 140  
     public NotificationMessageDeliveryService getNotificationMessageDeliveryService() {
 141  0
         return (NotificationMessageDeliveryService) beanFactory.getBean(NOTIFICATION_MESSAGE_DELIVERY_SERVICE);
 142  
     }
 143  
     
 144  
     /**
 145  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getUserPreferenceService()
 146  
      */
 147  
     public UserPreferenceService getUserPreferenceService() {
 148  0
         return (UserPreferenceService) beanFactory.getBean(USER_PREFERENCE_SERVICE);
 149  
     }
 150  
     
 151  
     /**
 152  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getNotificationChannelService()
 153  
      */
 154  
     public NotificationChannelService getNotificationChannelService() {
 155  0
         return (NotificationChannelService) beanFactory.getBean(NOTIFICATION_CHANNEL_SERVICE);
 156  
     }
 157  
 
 158  
     /**
 159  
      * @see org.kuali.rice.ken.core.NotificationServiceLocator#getScheduler()
 160  
      */
 161  
     public Scheduler getScheduler() {
 162  0
         return (Scheduler) beanFactory.getBean(NOTIFICATION_SCHEDULER);
 163  
     }
 164  
 }