agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/events/NotificationAttemptProcessor.java
/**
	 * Handles cleanup after a {@link NotificationAttempt} has failed enough
	 * times to violate the {@link NotificationPolicy} of the parent {@link Notification}
	 * 
	 * @param policy
	 * @param attempt
	 */
Handles cleanup after a  NotificationAttempt has failed enough
times to violate the  NotificationPolicy of the parent  Notification

@param policy
@param attempt
Handles cleanup after a NotificationAttempt has failed enough times to violate the NotificationPolicy of the parent Notification @param policy @param attempt
protected void handlePolicyViolation(NotificationPolicy policy, NotificationAttempt attempt) {
		log.debug("Notification attempts for " + attempt.getNotificationId() + " have exceeded the policy limits.");
		if (policy == null || policy.isSaveOnFailure()) {
			saveFailedAttempt(attempt);
		}
		else {
			log.debug("Skipping persistence of failed attempt " + attempt.getUuid() + 
					" due to notification " + attempt.getNotificationId() + " policy.");
		}
		if (NotificationStatusType.ACTIVE == getNotification().getStatus()) {
			try {
				getNotification().setStatus(NotificationStatusType.FAILED);
				getNotification().setLastUpdated(new Date());
				NotificationManager.updateStatus(getAttempt().getNotificationId(),
						NotificationStatusType.FAILED);
			} catch (NotificationException e) {
				log.error("Failed to update status of notification " + attempt.getNotificationId() +
						" after failure of attempt " + attempt.getUuid());
			}
		}
	}
protected void handlePolicyViolation ( NotificationPolicy policy , NotificationAttempt attempt ) { log . debug ( "Notification attempts for " + attempt . getNotificationId ( ) + " have exceeded the policy limits." ) ; if ( policy == null || policy . isSaveOnFailure ( ) ) { saveFailedAttempt ( attempt ) ; } else { log . debug ( "Skipping persistence of failed attempt " + attempt . getUuid ( ) + " due to notification " + attempt . getNotificationId ( ) + " policy." ) ; } if ( NotificationStatusType . ACTIVE == getNotification ( ) . getStatus ( ) ) { try { getNotification ( ) . setStatus ( NotificationStatusType . FAILED ) ; getNotification ( ) . setLastUpdated ( new Date ( ) ) ; NotificationManager . updateStatus ( getAttempt ( ) . getNotificationId ( ) , NotificationStatusType . FAILED ) ; } catch ( NotificationException e ) { log . error ( "Failed to update status of notification " + attempt . getNotificationId ( ) + " after failure of attempt " + attempt . getUuid ( ) ) ; } } }
Handles cleanup after a {@link NotificationAttempt} has failed enough
 times to violate the {@link NotificationPolicy} of the parent {@link Notification}
Handles cleanup after a { @link NotificationAttempt } has failed enough times to violate the { @link NotificationPolicy } of the parent { @link Notification }
// attempts have exceeded policy in some way // if it's active, then set it to completed