agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobEventProcessor.java
/**
     * Processes the {@link JobEvent} associated with this instance.
     */
Processes the  JobEvent associated with this instance.
Processes the JobEvent associated with this instance .
public void process() {
        ObjectMapper mapper = new ObjectMapper();
    	JsonNode jsonJob = null;
        try {
        	jsonJob = mapper.readTree(getEvent().getJob().toJSON());
        } catch (Exception e) {
            log.error("Unable to generate job json for notification", e);
            try {
	            jsonJob = mapper.createObjectNode()
	            		.put("id", getEvent().getJob().getId())
	            		.put("name", getEvent().getJob().getName())
	            		.put("executionSystem", getEvent().getJob().getSystem())
	            		.put("appId", getEvent().getJob().getSoftwareName())
	            		.put("owner", getEvent().getJob().getOwner());
            } catch (Exception e1) {
            	jsonJob = mapper.createObjectNode();
            }
        }
        processSingleJobEvent(getEvent().getJob().getUuid(), getEvent().getStatus(), getEvent().getCreatedBy(), jsonJob.toString());
        ObjectNode jsonContent = mapper.createObjectNode();
        jsonContent.set("job", jsonJob);
        if (getEvent().getStatus().equalsIgnoreCase(JobStatusType.PENDING.name()))
        {
        	processJobExecutionSystemEvent("JOB_CREATED", jsonJob);
        	processJobSoftwareEvent("JOB_CREATED", jsonJob);
        }
        else if (getEvent().getStatus().equalsIgnoreCase(JobStatusType.QUEUED.name()))
        {
        	processJobExecutionSystemEvent("JOB_QUEUED", jsonJob);
        }
        else if (getEvent().getStatus().equalsIgnoreCase(JobStatusType.RUNNING.name()))
        {
        	processJobExecutionSystemEvent("JOB_RUNNING", jsonJob);
        }
        else if (getEvent().getStatus().equalsIgnoreCase(JobEventType.EMPTY_STATUS_RESPONSE.name()) ||
        		getEvent().getStatus().equalsIgnoreCase(JobEventType.UNKNOWN_TERMINATION.name()) ||
        		getEvent().getStatus().equalsIgnoreCase(JobEventType.REMOTE_STATUS_CHANGE.name()) ||
        		getEvent().getStatus().equalsIgnoreCase(JobStatusType.FINISHED.name()) ||
                getEvent().getStatus().equalsIgnoreCase(JobStatusType.FAILED.name()) ||
                getEvent().getStatus().equalsIgnoreCase(JobStatusType.STOPPED.name()) || 
                getEvent().getStatus().equalsIgnoreCase(JobStatusType.PAUSED.name()))
        {
        	processJobExecutionSystemEvent("JOB_" + getEvent().getStatus(), jsonJob);
        }        
    }
public void process ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; JsonNode jsonJob = null ; try { jsonJob = mapper . readTree ( getEvent ( ) . getJob ( ) . toJSON ( ) ) ; } catch ( Exception e ) { log . error ( "Unable to generate job json for notification" , e ) ; try { jsonJob = mapper . createObjectNode ( ) . put ( "id" , getEvent ( ) . getJob ( ) . getId ( ) ) . put ( "name" , getEvent ( ) . getJob ( ) . getName ( ) ) . put ( "executionSystem" , getEvent ( ) . getJob ( ) . getSystem ( ) ) . put ( "appId" , getEvent ( ) . getJob ( ) . getSoftwareName ( ) ) . put ( "owner" , getEvent ( ) . getJob ( ) . getOwner ( ) ) ; } catch ( Exception e1 ) { jsonJob = mapper . createObjectNode ( ) ; } } processSingleJobEvent ( getEvent ( ) . getJob ( ) . getUuid ( ) , getEvent ( ) . getStatus ( ) , getEvent ( ) . getCreatedBy ( ) , jsonJob . toString ( ) ) ; ObjectNode jsonContent = mapper . createObjectNode ( ) ; jsonContent . set ( "job" , jsonJob ) ; if ( getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . PENDING . name ( ) ) ) { processJobExecutionSystemEvent ( "JOB_CREATED" , jsonJob ) ; processJobSoftwareEvent ( "JOB_CREATED" , jsonJob ) ; } else if ( getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . QUEUED . name ( ) ) ) { processJobExecutionSystemEvent ( "JOB_QUEUED" , jsonJob ) ; } else if ( getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . RUNNING . name ( ) ) ) { processJobExecutionSystemEvent ( "JOB_RUNNING" , jsonJob ) ; } else if ( getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobEventType . EMPTY_STATUS_RESPONSE . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobEventType . UNKNOWN_TERMINATION . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobEventType . REMOTE_STATUS_CHANGE . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . FINISHED . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . FAILED . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . STOPPED . name ( ) ) || getEvent ( ) . getStatus ( ) . equalsIgnoreCase ( JobStatusType . PAUSED . name ( ) ) ) { processJobExecutionSystemEvent ( "JOB_" + getEvent ( ) . getStatus ( ) , jsonJob ) ; } }
Processes the {@link JobEvent} associated with this instance.
Processes the { @link JobEvent } associated with this instance .
// init an object so we're not completely empty // process job related events for systems and apps // NotificationManager.process(executionSystem.getQueue(getEvent().getJob().getBatchQueue()).getUuid(), "JOB_SUBMITTED", getEvent().getCreatedBy(), jsonJob); // NotificationManager.process(executionSystem.getQueue(getEvent().getJob().getBatchQueue()).getUuid(), "JOB_RUNNING", getEvent().getCreatedBy(), jsonJob); // NotificationManager.process(executionSystem.getQueue(getEvent().getJob().getBatchQueue()).getUuid(), "JOB_COMPLETED", getEvent().getCreatedBy(), jsonJob);