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 processJobSoftwareEvent(String eventName, JsonNode jsonJob) 
    {
    	Software software = null;
    	ObjectMapper mapper = new ObjectMapper();
    	ObjectNode jsonContent = mapper.createObjectNode();
        try 
    	{
        	software = SoftwareDao.getSoftwareByUniqueName(getEvent().getJob().getSoftwareName());
            jsonContent.set("job", jsonJob);
            if (software == null) {
            	throw new UnknownSoftwareException("No software found for id " + getEvent().getJob().getSoftwareName());
            }
            else {
            	jsonContent.set("software", mapper.readTree(software.toJSON()));
                processSingleJobEvent(software.getUuid(), eventName, getEvent().getCreatedBy(), jsonContent.toString());
                return true;
            }
        } 
        catch (JsonProcessingException e) {
        	log.error("Unable to serialize software " + getEvent().getJob().getSoftwareName() 
    				+ " while processing a " + eventName + " event for job " + getEvent().getJob().getUuid(), e);
        	jsonContent.set("job", jsonJob);
        	jsonContent.set("software", mapper.createObjectNode().put("id", getEvent().getJob().getSoftwareName()));
            processSingleJobEvent(software.getUuid(), eventName, getEvent().getCreatedBy(), jsonContent.toString());
        }
        catch (UnknownSoftwareException e) {
        	log.error("Unable to process " + eventName + " event for software " + getEvent().getJob().getSoftwareName()
    				+ " by job " + getEvent().getJob().getUuid() + ". Software has been deleted.");
        }
        catch (Exception e) {
        	log.error("Unable to process " + eventName + " event for software " + getEvent().getJob().getSoftwareName()
        				+ " by job " + getEvent().getJob().getUuid(), e);
        }
        return false;
    }
protected boolean processJobSoftwareEvent ( String eventName , JsonNode jsonJob ) { Software software = null ; ObjectMapper mapper = new ObjectMapper ( ) ; ObjectNode jsonContent = mapper . createObjectNode ( ) ; try { software = SoftwareDao . getSoftwareByUniqueName ( getEvent ( ) . getJob ( ) . getSoftwareName ( ) ) ; jsonContent . set ( "job" , jsonJob ) ; if ( software == null ) { throw new UnknownSoftwareException ( "No software found for id " + getEvent ( ) . getJob ( ) . getSoftwareName ( ) ) ; } else { jsonContent . set ( "software" , mapper . readTree ( software . toJSON ( ) ) ) ; processSingleJobEvent ( software . getUuid ( ) , eventName , getEvent ( ) . getCreatedBy ( ) , jsonContent . toString ( ) ) ; return true ; } } catch ( JsonProcessingException e ) { log . error ( "Unable to serialize software " + getEvent ( ) . getJob ( ) . getSoftwareName ( ) + " while processing a " + eventName + " event for job " + getEvent ( ) . getJob ( ) . getUuid ( ) , e ) ; jsonContent . set ( "job" , jsonJob ) ; jsonContent . set ( "software" , mapper . createObjectNode ( ) . put ( "id" , getEvent ( ) . getJob ( ) . getSoftwareName ( ) ) ) ; processSingleJobEvent ( software . getUuid ( ) , eventName , getEvent ( ) . getCreatedBy ( ) , jsonContent . toString ( ) ) ; } catch ( UnknownSoftwareException e ) { log . error ( "Unable to process " + eventName + " event for software " + getEvent ( ) . getJob ( ) . getSoftwareName ( ) + " by job " + getEvent ( ) . getJob ( ) . getUuid ( ) + ". Software has been deleted." ) ; } catch ( Exception e ) { log . error ( "Unable to process " + eventName + " event for software " + getEvent ( ) . getJob ( ) . getSoftwareName ( ) + " 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 .
// use this vs the JobManager#getJobSoftware(String) because we don't care if it's available // we just wnat to serialize it for the message. // software has been deleted // something is just wonky here