1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.push.service;
17
18 import java.util.List;
19
20 import org.kuali.mobility.push.dao.PreferenceDao;
21 import org.kuali.mobility.push.entity.Preference;
22 import org.kuali.mobility.push.entity.Sender;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.stereotype.Service;
25 import org.springframework.transaction.annotation.Transactional;
26
27
28
29
30
31
32
33 @Service
34 public class PreferenceServiceImpl implements PreferenceService{
35
36
37 @Autowired
38 private PreferenceDao preferenceDao;
39
40
41
42
43
44 @Transactional
45 public List<Preference> findPreferencesByUsername(String username){
46 return preferenceDao.findPreferencesByUsername(username);
47 }
48
49
50
51
52
53 @Transactional
54 public Preference findPreference(String username, String shortName){
55 return preferenceDao.findPreference(username, shortName);
56 }
57
58
59
60
61
62 @Transactional
63 public Preference findPreference(String username, Sender sender){
64 return preferenceDao.findPreference(username, sender);
65 }
66
67
68
69
70
71 @Transactional
72 public Preference findPreference(long id){
73 return preferenceDao.findPreference(id);
74 }
75
76
77
78
79
80 @Transactional
81 public void savePreference(Preference preference){
82 preferenceDao.savePreference(preference);
83 }
84
85
86
87
88
89 @Transactional
90 public boolean removePreference(Preference preference){
91 return preferenceDao.removePreference(preference);
92 }
93
94
95
96
97
98
99 @Override
100 @Transactional
101 public void setPreference(Preference preference, boolean enabled ){
102 preferenceDao.setPreference(preference, enabled);
103 }
104
105
106
107
108
109 public PreferenceDao getPreferenceDao() {
110 return preferenceDao;
111 }
112
113
114
115
116
117 @Autowired
118 public void setPreferenceDao(PreferenceDao preferenceDao) {
119 this.preferenceDao = preferenceDao;
120 }
121
122
123
124 }