agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobRequestNotificationProcessor.java
/**
	 * Processes a {@link ArrayNode} of notification subscriptions represented as {@link ObjectNode}.
	 *
	 * @param jsonNotifications a JSON array of json notification objects
	 * @throws NotificationException if the notification cannot be validated
	 */
Processes a  ArrayNode of notification subscriptions represented as  ObjectNode.
@param jsonNotifications a JSON array of json notification objects
@throws NotificationException if the notification cannot be validated
Processes a ArrayNode of notification subscriptions represented as ObjectNode . @param jsonNotifications a JSON array of json notification objects @throws NotificationException if the notification cannot be validated
public void process(ArrayNode jsonNotifications) throws NotificationException {
		getNotifications().clear();
		if (jsonNotifications == null) return;
		for (int i=0; i<jsonNotifications.size(); i++)
		{
			JsonNode jsonNotif = jsonNotifications.get(i);
			if (!jsonNotif.isObject())
			{
				throw new NotificationException("Invalid notifications["+i+"] value given. "
					+ "Each notification object should specify a "
					+ "valid url, event, and an optional boolean persistence attribute.");
			}
			else
			{
				try {
					addNotification(((ObjectNode)jsonNotif).put("associatedUuid", getJob().getUuid()));
				}
				catch (NotificationException e) {
					throw e;
				}
				catch (Throwable e) {
					throw new NotificationException("Unable to process notification ["+i+"]" , e);
				}
			}
		}
	}
public void process ( ArrayNode jsonNotifications ) throws NotificationException { getNotifications ( ) . clear ( ) ; if ( jsonNotifications == null ) return ; for ( int i = 0 ; i < jsonNotifications . size ( ) ; i ++ ) { JsonNode jsonNotif = jsonNotifications . get ( i ) ; if ( ! jsonNotif . isObject ( ) ) { throw new NotificationException ( "Invalid notifications[" + i + "] value given. " + "Each notification object should specify a " + "valid url, event, and an optional boolean persistence attribute." ) ; } else { try { addNotification ( ( ( ObjectNode ) jsonNotif ) . put ( "associatedUuid" , getJob ( ) . getUuid ( ) ) ) ; } catch ( NotificationException e ) { throw e ; } catch ( Throwable e ) { throw new NotificationException ( "Unable to process notification [" + i + "]" , e ) ; } } } }
Processes a {@link ArrayNode} of notification subscriptions represented as {@link ObjectNode}.
Processes a { @link ArrayNode } of notification subscriptions represented as { @link ObjectNode } .
// here we reuse the validation built into the {@link Notification} model // itself to validate the embedded job notification subscriptions.