Ejemplo n.º 1
0
 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);
   }
 }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
  @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;
  }
Ejemplo n.º 4
0
  public QueueEntry addEntry(
      ProcessingQueue queue, String targetClass, String targetMethod, String arguments) {
    QueueEntry entry = QueueEntry.newQueueEntry(queue, targetClass, targetMethod, arguments);
    entryDao.save(entry);

    return entry;
  }
Ejemplo n.º 5
0
  @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;
  }
Ejemplo n.º 6
0
  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;
  }
Ejemplo n.º 7
0
  @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;
  }
Ejemplo n.º 8
0
 @Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
 public List<QueueEntry> getEntriesByEntryState(ProcessingQueue queue, String entryState) {
   return entryDao.getEntriesByEntryState(queue, entryState);
 }
Ejemplo n.º 9
0
 @Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
 public Long getEntryCount(ProcessingQueue queue) {
   return entryDao.getQueueEntryCountByQueueRef(queue);
 }