agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobEventProcessor.java
/**
     * Constructs message content and sends message for the execution system on
     * which a job event occurs.
     * @param eventName the name of the event being raised
     * @param jsonJob the json representation of the job
     * @return true if sent, false otherwise
     */
Constructs message content and sends message for the execution system on
which a job event occurs.
@param eventName the name of the event being raised
@param jsonJob the json representation of the job
@return true if sent, false otherwise
Constructs message content and sends message for the execution system on which a job event occurs . @param eventName the name of the event being raised @param jsonJob the json representation of the job @return true if sent false otherwise
protected boolean processJobExecutionSystemEvent(String eventName, JsonNode jsonJob) 
    {
    	ObjectMapper mapper = new ObjectMapper();
    	ObjectNode jsonContent = mapper.createObjectNode();
    	ExecutionSystem executionSystem = null;
        try 
    	{
            executionSystem = (ExecutionSystem) new SystemDao().findActiveAndInactiveSystemBySystemId(getEvent().getJob().getSystem());
            if (executionSystem == null) {
            	throw new SystemUnknownException("Job execution system "
                        + getEvent().getJob().getSystem() + " is not currently available");
            }
            jsonContent.set("job", jsonJob);
        	jsonContent.set("system", mapper.readTree(executionSystem.toJSON()));
            processSingleJobEvent(executionSystem.getUuid(), eventName, getEvent().getCreatedBy(), jsonContent.toString());
            return true;
        } 
        catch (JsonProcessingException e) {
        	log.error("Unable to serialize system " + getEvent().getJob().getSystem() 
    				+ " while processing a " + eventName + " event for job " + getEvent().getJob().getUuid(), e);
        	if (jsonContent.has("system")) {
        		jsonContent.remove("system");
        	}
        	jsonContent.set("job", jsonJob);
            processSingleJobEvent(executionSystem.getUuid(), eventName, getEvent().getCreatedBy(), jsonContent.toString());
        }
        catch (SystemUnknownException e) {
            log.error("Unable to process " + eventName + " event for system " + getEvent().getJob().getSystem()
            		 + " by job " + getEvent().getJob().getUuid() + ". Unable to resolve system id", e);
        }
    	catch (Exception e) {
    		log.error("Unable to process " + eventName + " event for system " + getEvent().getJob().getSystem() 
    				+ " by job " + getEvent().getJob().getUuid(), e);
    	}
        return false;
    }
protected boolean processJobExecutionSystemEvent ( String eventName , JsonNode jsonJob ) { ObjectMapper mapper = new ObjectMapper ( ) ; ObjectNode jsonContent = mapper . createObjectNode ( ) ; ExecutionSystem executionSystem = null ; try { executionSystem = ( ExecutionSystem ) new SystemDao ( ) . findActiveAndInactiveSystemBySystemId ( getEvent ( ) . getJob ( ) . getSystem ( ) ) ; if ( executionSystem == null ) { throw new SystemUnknownException ( "Job execution system " + getEvent ( ) . getJob ( ) . getSystem ( ) + " is not currently available" ) ; } jsonContent . set ( "job" , jsonJob ) ; jsonContent . set ( "system" , mapper . readTree ( executionSystem . toJSON ( ) ) ) ; processSingleJobEvent ( executionSystem . getUuid ( ) , eventName , getEvent ( ) . getCreatedBy ( ) , jsonContent . toString ( ) ) ; return true ; } catch ( JsonProcessingException e ) { log . error ( "Unable to serialize system " + getEvent ( ) . getJob ( ) . getSystem ( ) + " while processing a " + eventName + " event for job " + getEvent ( ) . getJob ( ) . getUuid ( ) , e ) ; if ( jsonContent . has ( "system" ) ) { jsonContent . remove ( "system" ) ; } jsonContent . set ( "job" , jsonJob ) ; processSingleJobEvent ( executionSystem . getUuid ( ) , eventName , getEvent ( ) . getCreatedBy ( ) , jsonContent . toString ( ) ) ; } catch ( SystemUnknownException e ) { log . error ( "Unable to process " + eventName + " event for system " + getEvent ( ) . getJob ( ) . getSystem ( ) + " by job " + getEvent ( ) . getJob ( ) . getUuid ( ) + ". Unable to resolve system id" , e ) ; } catch ( Exception e ) { log . error ( "Unable to process " + eventName + " event for system " + getEvent ( ) . getJob ( ) . getSystem ( ) + " by job " + getEvent ( ) . getJob ( ) . getUuid ( ) , e ) ; } return false ; }
Constructs message content and sends message for the execution system on
 which a job event occurs.
Constructs message content and sends message for the execution system on which a job event occurs .