Package pl.net.bluesoft.rnd.pt.ext.bpmnotifications.service

Examples of pl.net.bluesoft.rnd.pt.ext.bpmnotifications.service.NotificationHistoryEntry


  public synchronized void notificationSent(BpmNotification notification) {
    getEntry(notification).setSendDate(new Date());
  }

  public synchronized void errorWhileSendingNotification(BpmNotification notification, Exception e) {
    NotificationHistoryEntry entry = getEntry(notification);
    entry.setSendDate(new Date());
    entry.setSendingException(e);
  }
View Full Code Here


  public synchronized List<NotificationHistoryEntry> getRecentEntries() {
    return new ArrayList<NotificationHistoryEntry>(entries);
  }

  private NotificationHistoryEntry getEntry(BpmNotification notification) {
    NotificationHistoryEntry entry = entriesByNotificationId.get(notification.getId());
    if (entry != null) {
      return entry;
    }
    entry = new NotificationHistoryEntry();
    entry.setBpmNotificationId(notification.getId());
    entry.setSender(notification.getSender());
    entry.setRecipient(notification.getRecipient());
    entry.setSubject(notification.getSubject());
    entry.setBody(notification.getBody());
    entry.setAsHtml(notification.getSendAsHtml());
    entries.add(entry);
    entriesByNotificationId.put(notification.getId(), entry);
    if (maxEntries > 0 && entries.size() > maxEntries) {
      NotificationHistoryEntry removedEntry = entries.removeFirst();
      entriesByNotificationId.remove(removedEntry.getBpmNotificationId());
    }
    return entry;
  }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.pt.ext.bpmnotifications.service.NotificationHistoryEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.