agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/events/NotificationAttemptProcessor.java
/**
	 * Handles the processing and cleanup of a {@link NotificationAttempt}. A 
	 * {@link NotificationAttempt} will either be placed back into the retry message
	 * queue, or failed to the notification failure queue or abandonded if 
	 * {@link NotificationPolicy#isSaveOnFailure()} is false for the parent 
	 * {@link Notification}.
	 * 
	 * @return true if the attempt was successfully delivered, false otherwise.
	 */
Handles the processing and cleanup of a  NotificationAttempt. A
NotificationAttempt will either be placed back into the retry message
queue, or failed to the notification failure queue or abandonded if
NotificationPolicy#isSaveOnFailure() is false for the parent
Notification.

@return true if the attempt was successfully delivered, false otherwise.
Handles the processing and cleanup of a NotificationAttempt . A NotificationAttempt will either be placed back into the retry message queue or failed to the notification failure queue or abandonded if NotificationPolicy#isSaveOnFailure () is false for the parent Notification . @return true if the attempt was successfully delivered false otherwise .
public boolean fire() 
	{
		try {
			if (!isNotificationStillActive()) {
				throw new DisabledNotificationException("Notification is not longer valid");
			}
			getAttempt().setStartTime(Instant.now());
			NotificationAttemptResponse response = getNotificationAttemptProvider().publish();
			getAttempt().setEndTime(Instant.now());
			getAttempt().setResponse(response);
			if (getAttempt().isSuccess()) {
				handleSuccess();
				return true;
			} 
			else if (getAttempt().getAttemptNumber() == 0) {
				getAttempt().setAttemptNumber(1);
				return fire();
			} 
			else {
				handleFailure(getAttempt());
				return false;
			}
		}
		catch (DisabledNotificationException e) {
			handleCancelledNotification(null, getAttempt());
			return false;
		}
		catch (NotImplementedException e) {
			handlePolicyViolation(null, getAttempt());
			return false;
		}
		catch (Throwable e) {
			handleFailure(getAttempt());
			return false;
		}
	}
public boolean fire ( ) { try { if ( ! isNotificationStillActive ( ) ) { throw new DisabledNotificationException ( "Notification is not longer valid" ) ; } getAttempt ( ) . setStartTime ( Instant . now ( ) ) ; NotificationAttemptResponse response = getNotificationAttemptProvider ( ) . publish ( ) ; getAttempt ( ) . setEndTime ( Instant . now ( ) ) ; getAttempt ( ) . setResponse ( response ) ; if ( getAttempt ( ) . isSuccess ( ) ) { handleSuccess ( ) ; return true ; } else if ( getAttempt ( ) . getAttemptNumber ( ) == 0 ) { getAttempt ( ) . setAttemptNumber ( 1 ) ; return fire ( ) ; } else { handleFailure ( getAttempt ( ) ) ; return false ; } } catch ( DisabledNotificationException e ) { handleCancelledNotification ( null , getAttempt ( ) ) ; return false ; } catch ( NotImplementedException e ) { handlePolicyViolation ( null , getAttempt ( ) ) ; return false ; } catch ( Throwable e ) { handleFailure ( getAttempt ( ) ) ; return false ; } }
Handles the processing and cleanup of a {@link NotificationAttempt}.
Handles the processing and cleanup of a { @link NotificationAttempt } .
// process the attempt and save the timestamps // save the response for the decision making step // if there was a non-critical failure, retry immediately // if this is the first attempt at satisfying the attempt // if this is not the first attempt and the delivery failed, // then handle the failure according to the notification policy. // can't process the notification due to unsupported provider fail immediately // failed to publish due to a system exception of some sort.  // we don't want to retry right away because this is something  // more than just a blip.