agave-apps/apps-core/src/main/java/org/iplantc/service/apps/managers/SoftwareEventProcessor.java
/**
	 * Generates notification events for content-related changes to a 
	 * {@link RemoteSystem}. This could be a CRUD operation or a change
	 * to the credentials.
	 * 
	 * @param software the software upon which the event was created
	 * @param eventType the event type to create
	 * @param description the textual description of the event
	 * @param createdBy the principal who generated the event
	 * @return the {@link SoftwareEvent} updated with the association to the {@link Software}
	 */
Generates notification events for content-related changes to a
RemoteSystem. This could be a CRUD operation or a change
to the credentials.


Generates notification events for content - related changes to a RemoteSystem . This could be a CRUD operation or a change to the credentials .
public SoftwareEvent processSoftwareContentEvent(Software software, SoftwareEventType eventType, String description, String createdBy) {
		SoftwareEvent event = null;
		try {
			if (software == null) {
				throw new EntityEventProcessingException("Valid app must be provided to process event.");
			}
			if (eventType == null) {
				throw new EntityEventProcessingException("Valid app event type must be provided to process event.");
			}
			ObjectNode json = mapper.createObjectNode();
			try {
			    json.set("app", mapper.readTree(software.toJSON()));
			} catch (Throwable e) {
			    log.error(String.format("Failed to serialize app "
			            + "%s to json for %s event notification", 
			            software.getUniqueName(), eventType.name()), e);
			}
			event = new SoftwareEvent(software, eventType, description, createdBy);
			getEntityEventDao().persist(event);
			fireNotification(software.getUuid(), event.getStatus(), event.getCreatedBy(), json);
			if (eventType.isStatusEvent()) {
				doSystemEvents(software, event.getStatus(), event.getCreatedBy(), json);
			}
		}
		catch (EntityEventProcessingException e) {
			log.error(e.getMessage());
		}
		catch (SoftwareEventPersistenceException e) {
			log.error("Failed to persist history event for software " + software.getUuid(), e);
		}
		return event;	
	}
public SoftwareEvent processSoftwareContentEvent ( Software software , SoftwareEventType eventType , String description , String createdBy ) { SoftwareEvent event = null ; try { if ( software == null ) { throw new EntityEventProcessingException ( "Valid app must be provided to process event." ) ; } if ( eventType == null ) { throw new EntityEventProcessingException ( "Valid app event type must be provided to process event." ) ; } ObjectNode json = mapper . createObjectNode ( ) ; try { json . set ( "app" , mapper . readTree ( software . toJSON ( ) ) ) ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to serialize app " + "%s to json for %s event notification" , software . getUniqueName ( ) , eventType . name ( ) ) , e ) ; } event = new SoftwareEvent ( software , eventType , description , createdBy ) ; getEntityEventDao ( ) . persist ( event ) ; fireNotification ( software . getUuid ( ) , event . getStatus ( ) , event . getCreatedBy ( ) , json ) ; if ( eventType . isStatusEvent ( ) ) { doSystemEvents ( software , event . getStatus ( ) , event . getCreatedBy ( ) , json ) ; } } catch ( EntityEventProcessingException e ) { log . error ( e . getMessage ( ) ) ; } catch ( SoftwareEventPersistenceException e ) { log . error ( "Failed to persist history event for software " + software . getUuid ( ) , e ) ; } return event ; }
Generates notification events for content-related changes to a
 {@link RemoteSystem}.
Generates notification events for content - related changes to a { @link RemoteSystem } .