agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/managers/MetadataRequestNotificationProcessor.java
/**
	 * Processes a {@link JsonNode} passed in with a {@link MetadataItem} request as a notification configuration.
	 * Accepts an array of {@link Notification} request objects or a simple string.
	 *  
	 * @param jsonNotificationArray the array of json {@link Notification} objects to register to the new metadata item.
	 * @throws NotificationException if any of the notification objects are invalid
	 */
Processes a  JsonNode passed in with a  MetadataItem request as a notification configuration.
Accepts an array of  Notification request objects or a simple string.

@param jsonNotificationArray the array of json  Notification objects to register to the new metadata item.
@throws NotificationException if any of the notification objects are invalid
Processes a JsonNode passed in with a MetadataItem request as a notification configuration . Accepts an array of Notification request objects or a simple string . @param jsonNotificationArray the array of json Notification objects to register to the new metadata item . @throws NotificationException if any of the notification objects are invalid
public void process(ArrayNode jsonNotificationArray) throws NotificationException {
		getNotifications().clear();
		if (jsonNotificationArray != null && !jsonNotificationArray.isNull()) {
			for (int i=0; i<jsonNotificationArray.size(); i++)
			{
				JsonNode jsonNotif = jsonNotificationArray.get(i);
				if (!jsonNotif.isObject())
				{
					throw new NotificationException("Invalid notifications["+i+"] value given. "
						+ "Each notification objects should specify a "
						+ "valid url, event, and an optional boolean persistence attribute.");
				}
				else
				{
					Notification notification = new Notification();
					try {
						((ObjectNode)jsonNotif).put("associatedUuid", getUuid());
						notification = Notification.fromJSON(jsonNotif);
						notification.setOwner(getOwner());
					} 
					catch (NotificationException e) {
						throw e;
					} 
					catch (Throwable e) {
						throw new NotificationException("Unable to process notification.", e);
					}
					getDao().persist(notification);
					getNotifications().add(notification);
				}
			}
		}
	}
public void process ( ArrayNode jsonNotificationArray ) throws NotificationException { getNotifications ( ) . clear ( ) ; if ( jsonNotificationArray != null && ! jsonNotificationArray . isNull ( ) ) { for ( int i = 0 ; i < jsonNotificationArray . size ( ) ; i ++ ) { JsonNode jsonNotif = jsonNotificationArray . get ( i ) ; if ( ! jsonNotif . isObject ( ) ) { throw new NotificationException ( "Invalid notifications[" + i + "] value given. " + "Each notification objects should specify a " + "valid url, event, and an optional boolean persistence attribute." ) ; } else { Notification notification = new Notification ( ) ; try { ( ( ObjectNode ) jsonNotif ) . put ( "associatedUuid" , getUuid ( ) ) ; notification = Notification . fromJSON ( jsonNotif ) ; notification . setOwner ( getOwner ( ) ) ; } catch ( NotificationException e ) { throw e ; } catch ( Throwable e ) { throw new NotificationException ( "Unable to process notification." , e ) ; } getDao ( ) . persist ( notification ) ; getNotifications ( ) . add ( notification ) ; } } } }
Processes a {@link JsonNode} passed in with a {@link MetadataItem} request as a notification configuration.
Processes a { @link JsonNode } passed in with a { @link MetadataItem } request as a notification configuration .
// Here we reuse the validation built into the {@link Notification} model // itself to validate the embedded metadata schema notification subscriptions.