public void updateEntry(QueueEntry entry) { Boolean delete = entry.getDeleteWhenExecuted(); if (delete) { logger.info("deleting entry:" + entry); entryDao.delete(entry); } else { entryDao.save(entry); logger.info("update entry:" + entry); } }
public Integer deleteQueueAndEntries(Integer queueId) { Integer entries = 0; ProcessingQueue queue = queueDao.getQueueById(queueId); List<QueueEntry> list = entryDao.getQueueEntryByQueueRef(queue); for (QueueEntry entry : list) { entryDao.delete(entry); entries++; } queueDao.delete(queue); return entries; }
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED) public List<QueueEntry> getEntriesByQueueId(Integer queueId) { ProcessingQueue queue = queueDao.getQueueById(queueId); List<QueueEntry> list = entryDao.getQueueEntryByQueueRef(queue); return list; }
public QueueEntry addEntry( ProcessingQueue queue, String targetClass, String targetMethod, String arguments) { QueueEntry entry = QueueEntry.newQueueEntry(queue, targetClass, targetMethod, arguments); entryDao.save(entry); return entry; }
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED) public Page<QueueEntry> getEntriesByPage(Integer queueId, Integer page, Integer limit) { page = page > 0 ? page - 1 : page; Pageable pageable = new PageRequest(page, limit); Page<QueueEntry> entries = entryDao.findAll(pageable); return entries; }
public QueueEntry addEntry( String queueName, String targetClass, String targetMethod, String arguments) { ProcessingQueue queue = getOrCreateQueue(queueName); QueueEntry entry = QueueEntry.newQueueEntry(queue, targetClass, targetMethod, arguments); entryDao.save(entry); return entry; }
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED) public List<ProcessingQueue> getAllQueue() { List<ProcessingQueue> queues = (List<ProcessingQueue>) queueDao.findAll(); logger.debug("getAllQueue,queue size: " + queues.size()); for (ProcessingQueue queue : queues) { Long entryCount = entryDao.getQueueEntryCountByQueueRef(queue); queue.setEntryCount(entryCount); } return queues; }
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED) public List<QueueEntry> getEntriesByEntryState(ProcessingQueue queue, String entryState) { return entryDao.getEntriesByEntryState(queue, entryState); }
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED) public Long getEntryCount(ProcessingQueue queue) { return entryDao.getQueueEntryCountByQueueRef(queue); }