View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15   
16  package org.kuali.mobility.notification.service;
17  
18  import org.kuali.mobility.notification.dao.NotificationDao;
19  import org.kuali.mobility.notification.entity.Notification;
20  import org.kuali.mobility.notification.entity.UserNotification;
21  import org.springframework.beans.factory.annotation.Autowired;
22  import org.springframework.stereotype.Service;
23  import org.springframework.transaction.annotation.Transactional;
24  
25  import java.util.Date;
26  import java.util.List;
27  
28  @Service
29  public class NotificationServiceImpl implements NotificationService {
30  
31  	@Autowired
32  	private NotificationDao notificationDao;	
33  
34  	@Override
35  	@Transactional
36  	public Notification findNotificationById(Long id) {
37  		return getNotificationDao().findNotificationById(id);
38  	}
39  
40  	@Override
41  	@Transactional
42  	public List<Notification> findAllNotifications() {
43  		return getNotificationDao().findAllNotifications();
44  	}
45  
46  	@Override
47  	@Transactional
48  	public List<Notification> findAllValidNotifications(Date date) {
49  		return getNotificationDao().findAllValidNotifications(date);
50  	}
51  
52  	@Override
53  	@Transactional
54  	public Long saveNotification(Notification notification) {
55  		return getNotificationDao().saveNotification(notification);
56  	}
57  
58  	@Override
59  	@Transactional
60  	public void deleteNotificationById(Long id) {
61  		getNotificationDao().deleteNotificationById(id);
62  	}
63  
64  	@Override
65  	@Transactional
66  	public UserNotification findUserNotificationById(Long id) {
67  		return getNotificationDao().findUserNotificationById(id);
68  	}
69  
70  	@Override
71  	@Transactional
72  	public UserNotification findUserNotificationByNotificationId(Long id) {
73  		return getNotificationDao().findUserNotificationByNotificationId(id);
74  	}
75  
76  	@Override
77  	@Transactional
78  	public Long saveUserNotification(UserNotification userNotification) {
79  		return getNotificationDao().saveUserNotification(userNotification);
80  	}
81  
82  	@Override
83  	@Transactional
84  	public void deleteUserNotificationById(Long id) {
85  		getNotificationDao().deleteUserNotificationById(id);
86  	}
87  
88  	@Override
89  	@Transactional
90  	public List<UserNotification> findAllUserNotificationsByDeviceId(String id) {
91  		return getNotificationDao().findAllUserNotificationsByDeviceId(id);
92  	}
93  
94  	@Override
95  	@Transactional
96  	public List<UserNotification> findAllUserNotificationsByPersonId(Long id) {
97  		return getNotificationDao().findAllUserNotificationsByPersonId(id);
98  	}
99  
100 	public NotificationDao getNotificationDao() {
101 		return notificationDao;
102 	}
103 
104 	public void setNotificationDao(NotificationDao notificationDao) {
105 		this.notificationDao = notificationDao;
106 	}
107 }