agave-monitors/monitors-core/src/main/java/org/iplantc/service/monitor/events/MonitorEventProcessor.java
/**
	 * Generates notification events for forced {@link MonitorCheck} outside of the  
	 * existing {@link Monitor} schedule.
	 * 
	 * @param monitor the {@link Monitor} on which the even is triggered
	 * @param createdBy the user who caused this event
	 * @return the {@link MonitorEvent} with the association to the {@link Monitor}
	 */
Generates notification events for forced  MonitorCheck outside of the
existing  Monitor schedule.

@param monitor the  Monitor on which the even is triggered
@param createdBy the user who caused this event
@return the  MonitorEvent with the association to the  Monitor
Generates notification events for forced MonitorCheck outside of the existing Monitor schedule . @param monitor the Monitor on which the even is triggered @param createdBy the user who caused this event @return the MonitorEvent with the association to the Monitor
public void processForceCheckEvent(Monitor monitor, String createdBy) {
		try {
			if (monitor == null) {
				throw new EntityEventProcessingException("Valid monitor must be provided to process event.");
			}
			if (StringUtils.isEmpty(createdBy)) {
				throw new EntityEventProcessingException("Valid monitor creator username must be provided to process event.");
			}
			String sJson = null;
			try {
				ObjectNode json = mapper.createObjectNode();
			    json.set("monitor", mapper.readTree(monitor.toJSON()));
			    json.set("system", mapper.readTree(monitor.getSystem().toJSON()));
			    sJson = json.toString();
			} catch (Throwable e) {
			    log.error(String.format("Failed to serialize monitor "
			            + "%s to json for %s event notification", 
			            monitor.getUuid(), MonitorEventType.FORCED_CHECK_REQUESTED.name()), e);
			}
			processNotification(monitor.getUuid(), MonitorEventType.FORCED_CHECK_REQUESTED.name(), createdBy, sJson);
			processNotification(monitor.getSystem().getUuid(), "MONITOR_" + MonitorEventType.FORCED_CHECK_REQUESTED.name(), createdBy, sJson);
		}
		catch (EntityEventProcessingException e) {
			log.error(e.getMessage());
		}
	}
public void processForceCheckEvent ( Monitor monitor , String createdBy ) { try { if ( monitor == null ) { throw new EntityEventProcessingException ( "Valid monitor must be provided to process event." ) ; } if ( StringUtils . isEmpty ( createdBy ) ) { throw new EntityEventProcessingException ( "Valid monitor creator username must be provided to process event." ) ; } String sJson = null ; try { ObjectNode json = mapper . createObjectNode ( ) ; json . set ( "monitor" , mapper . readTree ( monitor . toJSON ( ) ) ) ; json . set ( "system" , mapper . readTree ( monitor . getSystem ( ) . toJSON ( ) ) ) ; sJson = json . toString ( ) ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to serialize monitor " + "%s to json for %s event notification" , monitor . getUuid ( ) , MonitorEventType . FORCED_CHECK_REQUESTED . name ( ) ) , e ) ; } processNotification ( monitor . getUuid ( ) , MonitorEventType . FORCED_CHECK_REQUESTED . name ( ) , createdBy , sJson ) ; processNotification ( monitor . getSystem ( ) . getUuid ( ) , "MONITOR_" + MonitorEventType . FORCED_CHECK_REQUESTED . name ( ) , createdBy , sJson ) ; } catch ( EntityEventProcessingException e ) { log . error ( e . getMessage ( ) ) ; } }
Generates notification events for forced {@link MonitorCheck} outside of the
 existing {@link Monitor} schedule.
Generates notification events for forced { @link MonitorCheck } outside of the existing { @link Monitor } schedule .
// fire event on monitor // We fire delegated monitor chec events on the system being monitored.