View Javadoc
1   /**
2    * Copyright 2005-2014 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.kew.impl.mail;
17  
18  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
19  import org.kuali.rice.kew.api.action.ActionItem;
20  import org.kuali.rice.kew.api.mail.ImmediateEmailReminderQueue;
21  import org.kuali.rice.kew.mail.service.ActionListEmailService;
22  import org.kuali.rice.kew.service.KEWServiceLocator;
23  
24  /**
25   * Reference implementation of an {@code ImmediateEmailReminderQueue}.
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class ImmediateEmailReminderQueueImpl implements ImmediateEmailReminderQueue {
30  
31      private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
32              .getLogger(ImmediateEmailReminderQueueImpl.class);
33  
34      private ActionListEmailService actionListEmailService;
35  
36      public void sendReminder(ActionItem actionItem, Boolean skipOnApprovals) {
37          if (actionItem == null) {
38  			throw new RiceIllegalArgumentException("actionItem was null");
39  		}
40  
41          if (skipOnApprovals == null) {
42              skipOnApprovals = false;
43  		}
44  
45          getActionListEmailService().sendImmediateReminder(actionItem, skipOnApprovals);
46      }
47  
48      private ActionListEmailService getActionListEmailService() {
49          if (actionListEmailService == null)
50              actionListEmailService = (ActionListEmailService) KEWServiceLocator.getService(KEWServiceLocator.ACTION_LIST_EMAIL_SERVICE);
51      
52          return actionListEmailService;
53      }
54      
55      /**
56       * @param actionListEmailService the actionListEmailService to set
57       */
58      public void setActionListEmailService(ActionListEmailService actionListEmailService) {
59          this.actionListEmailService = actionListEmailService;
60      }
61      
62  }