Search in sources :

Example 11 with MonitorManager

use of nl.nn.adapterframework.monitoring.MonitorManager in project iaf by ibissource.

the class EditTriggerExecute method performAction.

public String performAction(DynaActionForm monitorForm, String action, int index, int triggerIndex, HttpServletResponse response) {
    MonitorManager mm = MonitorManager.getInstance();
    if (index >= 0 && triggerIndex >= 0) {
        Monitor monitor = mm.getMonitor(index);
        Trigger trigger = monitor.getTrigger(triggerIndex);
        Trigger formTrigger = (Trigger) monitorForm.get("trigger");
        log.debug("copying form trigger (" + formTrigger.hashCode() + ") values to trigger[" + triggerIndex + "] (" + trigger.hashCode() + ")");
        trigger.setType(formTrigger.getType());
        trigger.setEventCodes(formTrigger.getEventCodes());
        trigger.setSourceFiltering(formTrigger.getSourceFiltering());
        if (formTrigger.isFilterOnAdapters()) {
            log.debug("setting trigger.adapters from selAdapters");
            trigger.setAdapters((String[]) monitorForm.get("selAdapters"));
        }
        if (formTrigger.isFilterOnLowerLevelObjects()) {
            log.debug("setting trigger.sources from selSources");
            trigger.setSources((String[]) monitorForm.get("selSources"));
        }
        trigger.setFilterExclusive(formTrigger.isFilterExclusive());
        trigger.setSeverity(formTrigger.getSeverity());
        trigger.setThreshold(formTrigger.getThreshold());
        trigger.setPeriod(formTrigger.getPeriod());
    }
    String result;
    if (action.equals("OK")) {
        result = determineExitForward(monitorForm);
    } else {
        result = "self";
    }
    log.debug("determined forward [" + result + "] from action [" + action + "] monitorForm.return [" + monitorForm.get("return") + "]");
    return result;
}
Also used : MonitorManager(nl.nn.adapterframework.monitoring.MonitorManager) Monitor(nl.nn.adapterframework.monitoring.Monitor) Trigger(nl.nn.adapterframework.monitoring.Trigger)

Aggregations

MonitorManager (nl.nn.adapterframework.monitoring.MonitorManager)11 Monitor (nl.nn.adapterframework.monitoring.Monitor)10 ArrayList (java.util.ArrayList)4 RolesAllowed (javax.annotation.security.RolesAllowed)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 MonitorException (nl.nn.adapterframework.monitoring.MonitorException)4 Trigger (nl.nn.adapterframework.monitoring.Trigger)4 IOException (java.io.IOException)2 PrintWriter (java.io.PrintWriter)2 Date (java.util.Date)2 List (java.util.List)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 ServletException (javax.servlet.ServletException)1 Consumes (javax.ws.rs.Consumes)1 DELETE (javax.ws.rs.DELETE)1