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.push.service;
17
18 import java.util.List;
19
20 import org.kuali.mobility.push.dao.PushDeviceTupleDao;
21 import org.kuali.mobility.push.entity.Push;
22 import org.kuali.mobility.push.entity.PushDeviceTuple;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.stereotype.Service;
25 import org.springframework.transaction.annotation.Transactional;
26
27 /**
28 * Implementation of the <code>PushDeviceTupleService</code>
29 *
30 * @author Kuali Mobility Team (mobility.dev@kuali.org)
31 * @since 2.1.0
32 */
33 @Service
34 public class PushDeviceTupleServiceImpl implements PushDeviceTupleService{
35
36 /** Reference to the <code>PushDeviceTupleDao</code> */
37 @Autowired
38 private PushDeviceTupleDao pdtDao;
39
40 /*
41 * (non-Javadoc)
42 * @see org.kuali.mobility.push.service.PushDeviceTupleService#markTupleAsSent(org.kuali.mobility.push.entity.PushDeviceTuple)
43 */
44 @Override
45 @Transactional
46 public void markTupleAsSent(PushDeviceTuple tuple){
47 pdtDao.markTupleAsSent(tuple);
48 }
49
50 /*
51 * (non-Javadoc)
52 * @see org.kuali.mobility.push.service.PushDeviceTupleService#saveTuple(org.kuali.mobility.push.entity.PushDeviceTuple)
53 */
54 @Override
55 @Transactional
56 public void saveTuple(PushDeviceTuple tuple){
57 pdtDao.saveTuple(tuple);
58 }
59
60 /*
61 * (non-Javadoc)
62 * @see org.kuali.mobility.push.service.PushDeviceTupleService#findUnsentTuples()
63 */
64 @Override
65 @Transactional
66 public List<PushDeviceTuple> findUnsentTuples(){
67 return pdtDao.findUnsentTuples();
68 }
69
70 /**
71 * Set the reference to the <code>PushDeviceTupleDao</code>
72 * @param dao
73 */
74 public void setPushDeviceTupleDao(PushDeviceTupleDao dao) {
75 this.pdtDao = dao;
76 }
77
78 /**
79 * Get the reference to the <code>PushDeviceTupleDao</code>
80 * @return dao
81 */
82 public PushDeviceTupleDao getPushDeviceTupleDao() {
83 return pdtDao;
84 }
85
86 /*
87 * (non-Javadoc)
88 * @see org.kuali.mobility.push.service.PushDeviceTupleService#findTuplesForPush(org.kuali.mobility.push.entity.Push)
89 */
90 public List<PushDeviceTuple> findTuplesForPush(Push push){
91 return pdtDao.findTuplesForPush(push);
92 }
93
94 /*
95 * (non-Javadoc)
96 * @see org.kuali.mobility.push.service.PushDeviceTupleService#removeTuplesForPush(org.kuali.mobility.push.entity.Push)
97 */
98 @Transactional
99 public int removeTuplesForPush(Push push){
100 return pdtDao.removeTuplesForPush(push);
101 }
102 }