agave-monitors/monitors-core/src/main/java/org/iplantc/service/monitor/managers/MonitorManager.java
/**
	 * Deletes the given {@link Monitor}, its {@link MonitorCheck}s, and {@link DomainEntityEvent} records from the db.
	 * @param monitor the monitor to delete
	 * @throws MonitorException if unable to clean up all monitor assets
	 */
Deletes the given  Monitor, its  MonitorChecks, and  DomainEntityEvent records from the db.
@param monitor the monitor to delete
@throws MonitorException if unable to clean up all monitor assets
Deletes the given Monitor its MonitorChecks and DomainEntityEvent records from the db . @param monitor the monitor to delete @throws MonitorException if unable to clean up all monitor assets
public void delete(Monitor monitor, String user) throws MonitorException {
		try {
			getMonitorCheckDao().deleteAllForMonitor(monitor);
			eventProcessor.processContentEvent(monitor, MonitorEventType.DELETED, user);
			DomainEntityEventDao eventDao = new DomainEntityEventDao();
			eventDao.deleteByEntityId(monitor.getUuid());
			try {
				getMonitorDao().delete(monitor);
			} catch (MonitorException e) {
				getMonitorDao().refresh(monitor);
				getMonitorDao().delete(monitor);
			}
		}
		catch (EntityEventPersistenceException e) {
			throw new MonitorException("Failed to delete monitor history.", e);
		}
    }
public void delete ( Monitor monitor , String user ) throws MonitorException { try { getMonitorCheckDao ( ) . deleteAllForMonitor ( monitor ) ; eventProcessor . processContentEvent ( monitor , MonitorEventType . DELETED , user ) ; DomainEntityEventDao eventDao = new DomainEntityEventDao ( ) ; eventDao . deleteByEntityId ( monitor . getUuid ( ) ) ; try { getMonitorDao ( ) . delete ( monitor ) ; } catch ( MonitorException e ) { getMonitorDao ( ) . refresh ( monitor ) ; getMonitorDao ( ) . delete ( monitor ) ; } } catch ( EntityEventPersistenceException e ) { throw new MonitorException ( "Failed to delete monitor history." , e ) ; } }
Deletes the given {@link Monitor}, its {@link MonitorCheck}s, and {@link DomainEntityEvent} records from the db.
Deletes the given { @link Monitor } its { @link MonitorCheck } s and { @link DomainEntityEvent } records from the db .
// clean up checks // clean up history // delete monitor // remove event // if a check is firing, a delete could occur, so we force the update here