agave-systems/systems-core/src/main/java/org/iplantc/service/systems/events/RemoteSystemEventProcessor.java
/**
	 * Propagates change of public/private scope to associated objects and 
	 * writes an event to the system history. The events thrown here
	 * are rather broad since taking a system offline may impact active
	 * transfers, jobs, apps, monitors, scheduled tasks, files, etc. 
	 *
	 * @param system the system receiving the event
	 * @param eventType the type of the event
	 * @param createdBy the owner of the permission event
	 * @return a SystemHistoryEvent recording the event
	 */
Propagates change of public/private scope to associated objects and
writes an event to the system history. The events thrown here
are rather broad since taking a system offline may impact active
transfers, jobs, apps, monitors, scheduled tasks, files, etc.

@param system the system receiving the event
@param eventType the type of the event
@param createdBy the owner of the permission event
@return a SystemHistoryEvent recording the event
Propagates change of public / private scope to associated objects and writes an event to the system history . The events thrown here are rather broad since taking a system offline may impact active transfers jobs apps monitors scheduled tasks files etc . @param system the system receiving the event @param eventType the type of the event @param createdBy the owner of the permission event @return a SystemHistoryEvent recording the event
public SystemHistoryEvent processPublishEvent(RemoteSystem system, SystemEventType eventType, String createdBy) {
		SystemHistoryEvent event = null;
		try {
			if (system == null) {
				throw new EntityEventProcessingException("Valid system must be provided to process event.");
			}
			if (eventType == null) {
				throw new EntityEventProcessingException("Valid system event type must be provided to process event.");
			}
			ObjectNode json = null;
			try {
			    json = mapper.createObjectNode();
			    json.set("system", mapper.readTree(system.toJSON()));
			} catch (Throwable e) {
			    log.error(String.format("Failed to serialize system "
			            + "%s to json for %s event notification", 
			            system.getUuid(), eventType.name()), e);
			    json = null;
			}
			event = new SystemHistoryEvent(system.getUuid(), eventType, eventType.getDescription(), createdBy);
			getEntityEventDao().persist(event);
			fireNotification(system.getUuid(), eventType.name(), createdBy, json);
			doSoftwareEvents(system, eventType.name(), createdBy, json);
		}
		catch (EntityEventProcessingException e) {
			log.error(e.getMessage());
		}
		catch (EntityEventPersistenceException e) {
			log.error("Failed to persist history event for system " + system.getUuid(), e);
		}
		return event;
	}
public SystemHistoryEvent processPublishEvent ( RemoteSystem system , SystemEventType eventType , String createdBy ) { SystemHistoryEvent event = null ; try { if ( system == null ) { throw new EntityEventProcessingException ( "Valid system must be provided to process event." ) ; } if ( eventType == null ) { throw new EntityEventProcessingException ( "Valid system event type must be provided to process event." ) ; } ObjectNode json = null ; try { json = mapper . createObjectNode ( ) ; json . set ( "system" , mapper . readTree ( system . toJSON ( ) ) ) ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to serialize system " + "%s to json for %s event notification" , system . getUuid ( ) , eventType . name ( ) ) , e ) ; json = null ; } event = new SystemHistoryEvent ( system . getUuid ( ) , eventType , eventType . getDescription ( ) , createdBy ) ; getEntityEventDao ( ) . persist ( event ) ; fireNotification ( system . getUuid ( ) , eventType . name ( ) , createdBy , json ) ; doSoftwareEvents ( system , eventType . name ( ) , createdBy , json ) ; } catch ( EntityEventProcessingException e ) { log . error ( e . getMessage ( ) ) ; } catch ( EntityEventPersistenceException e ) { log . error ( "Failed to persist history event for system " + system . getUuid ( ) , e ) ; } return event ; }
Propagates change of public/private scope to associated objects and
 writes an event to the system history.
Propagates change of public / private scope to associated objects and writes an event to the system history .
// process the primary object event // process software tied to the system. we don't take action here. we simply give users the info they need // to decide what they want their policy to be. // TODO: a separate process should disable public apps when the system is unpublished // process the content change events tied to the status field changing. Queues should know when a system goes down //			processBatchQueueEvents(system, systemStatus, createdBy); // process jobs tied to the system. //			doJobEvents(system, systemStatus, createdBy, json); // process transfers tied to the system. //			doTransferEvents(system, systemStatus, createdBy, json);