agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobRequestProcessor.java
/**
	 * Validates the callbackUrl parameter into a notification. This is only supported on job request form submissions
	 * which do not support structured data.
	 * @param jobRequestMap the job request form
	 * @param job the current job object
	 * @throws JobProcessingException if the url is invalid or cannot be generated.
	 */
Validates the callbackUrl parameter into a notification. This is only supported on job request form submissions
which do not support structured data.
@param jobRequestMap the job request form
@param job the current job object
@throws JobProcessingException if the url is invalid or cannot be generated.
Validates the callbackUrl parameter into a notification . This is only supported on job request form submissions which do not support structured data . @param jobRequestMap the job request form @param job the current job object @throws JobProcessingException if the url is invalid or cannot be generated .
public void processCallbackUrlRequest(Map<String, Object> jobRequestMap, Job job) throws JobProcessingException
	{
		String defaultNotificationCallback = null;
		if (jobRequestMap.containsKey("callbackUrl")) {
			defaultNotificationCallback = (String)jobRequestMap.get("callbackUrl");
		} else if (jobRequestMap.containsKey("callbackURL")) {
			defaultNotificationCallback = (String)jobRequestMap.get("callbackURL");
		} else if (jobRequestMap.containsKey("notifications")) {
			defaultNotificationCallback = (String)jobRequestMap.get("notifications");
		}
		try {
			setNotificationProcessor(new JobRequestNotificationProcessor(getUsername(), job));
			if (StringUtils.isEmpty(defaultNotificationCallback)) {
			}
			else {
				if (StringUtils.startsWithAny(defaultNotificationCallback,  new String[]{ "{", "[" })) {
					ObjectMapper mapper = new ObjectMapper();
					getNotificationProcessor().process(mapper.readTree(defaultNotificationCallback));
				}
				else {
					getNotificationProcessor().process(defaultNotificationCallback);
				}
				for (Notification n: getNotificationProcessor().getNotifications()) {
	                job.addNotification(n);
	            }
			}
		}
		catch (NotificationException e) {
            throw new JobProcessingException(500, "Failed to assign notification to job", e);
        } catch (IOException e) {
        	throw new JobProcessingException(400, "Unable to parse notification address provided in callbackUrl", e);
		}
	}
public void processCallbackUrlRequest ( Map < String , Object > jobRequestMap , Job job ) throws JobProcessingException { String defaultNotificationCallback = null ; if ( jobRequestMap . containsKey ( "callbackUrl" ) ) { defaultNotificationCallback = ( String ) jobRequestMap . get ( "callbackUrl" ) ; } else if ( jobRequestMap . containsKey ( "callbackURL" ) ) { defaultNotificationCallback = ( String ) jobRequestMap . get ( "callbackURL" ) ; } else if ( jobRequestMap . containsKey ( "notifications" ) ) { defaultNotificationCallback = ( String ) jobRequestMap . get ( "notifications" ) ; } try { setNotificationProcessor ( new JobRequestNotificationProcessor ( getUsername ( ) , job ) ) ; if ( StringUtils . isEmpty ( defaultNotificationCallback ) ) { } else { if ( StringUtils . startsWithAny ( defaultNotificationCallback , new String [ ] { "{" , "[" } ) ) { ObjectMapper mapper = new ObjectMapper ( ) ; getNotificationProcessor ( ) . process ( mapper . readTree ( defaultNotificationCallback ) ) ; } else { getNotificationProcessor ( ) . process ( defaultNotificationCallback ) ; } for ( Notification n : getNotificationProcessor ( ) . getNotifications ( ) ) { job . addNotification ( n ) ; } } } catch ( NotificationException e ) { throw new JobProcessingException ( 500 , "Failed to assign notification to job" , e ) ; } catch ( IOException e ) { throw new JobProcessingException ( 400 , "Unable to parse notification address provided in callbackUrl" , e ) ; } }
Validates the callbackUrl parameter into a notification.
Validates the callbackUrl parameter into a notification .
// nothing to do here. continue on