agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/events/NotificationAttemptProcessor.java
/**
	 * Handles cleanup after a successful {@link NotificationAttempt}.
	 * 
	 * @throws NotificationPolicyViolationException
	 * @throws NotificationException
	 */
Handles cleanup after a successful  NotificationAttempt.


Handles cleanup after a successful NotificationAttempt .
protected void handleSuccess() 
	{	
		try {
			getAttempt().setScheduledTime(null);
			getAttempt().setAttemptNumber(getAttempt().getAttemptNumber()+1);
			if (!getNotification().isPersistent()) {
				if (NotificationStatusType.ACTIVE == getNotification().getStatus()) {
					getNotification().setStatus(NotificationStatusType.COMPLETE);
					NotificationManager.updateStatus(getAttempt().getNotificationId(), 
							NotificationStatusType.COMPLETE);
				}
				else {
				}
			}
		} 
		catch (Exception e) {
			log.error("Failed to update parent notification upon successful delivery of attempt " + attempt.getUuid(), e);
		}
	}
protected void handleSuccess ( ) { try { getAttempt ( ) . setScheduledTime ( null ) ; getAttempt ( ) . setAttemptNumber ( getAttempt ( ) . getAttemptNumber ( ) + 1 ) ; if ( ! getNotification ( ) . isPersistent ( ) ) { if ( NotificationStatusType . ACTIVE == getNotification ( ) . getStatus ( ) ) { getNotification ( ) . setStatus ( NotificationStatusType . COMPLETE ) ; NotificationManager . updateStatus ( getAttempt ( ) . getNotificationId ( ) , NotificationStatusType . COMPLETE ) ; } else { } } } catch ( Exception e ) { log . error ( "Failed to update parent notification upon successful delivery of attempt " + attempt . getUuid ( ) , e ) ; } }
Handles cleanup after a successful {@link NotificationAttempt}.
Handles cleanup after a successful { @link NotificationAttempt } .
// remove the scheduled time. // increment the attempt count // we need to lookup the parent notification and retire it if not persistent // if it's active, then set it to completed // if not, then we're just going to retire the attempt. the notification // was updated during the notificatino processing, so we'll ignore it // carry on // now delete the attempt since we're done with it //naDAO.delete(attempt);