Search in sources :

Example 1 with SelectSnmpTrapDialog

use of org.netxms.ui.eclipse.serverconfig.dialogs.SelectSnmpTrapDialog in project netxms by netxms.

the class ExportFileBuilder method addTraps.

/**
 * Add traps to list
 */
private void addTraps() {
    SelectSnmpTrapDialog dlg = new SelectSnmpTrapDialog(getSite().getShell(), snmpTrapCache);
    if (dlg.open() == Window.OK) {
        final Set<Long> eventCodes = new HashSet<Long>();
        for (SnmpTrap t : dlg.getSelection()) {
            traps.put(t.getId(), t);
            if (t.getEventCode() >= 100000) {
                eventCodes.add((long) t.getEventCode());
            }
        }
        trapViewer.setInput(traps.values().toArray());
        setModified();
        if (eventCodes.size() > 0) {
            for (EventObject o : session.findMultipleEventObjects(eventCodes.toArray(new Long[eventCodes.size()]))) {
                events.put(o.getCode(), o);
            }
            eventViewer.setInput(events.values().toArray());
        }
        ;
    }
}
Also used : SelectSnmpTrapDialog(org.netxms.ui.eclipse.serverconfig.dialogs.SelectSnmpTrapDialog) SnmpTrap(org.netxms.client.snmp.SnmpTrap) EventObject(org.netxms.client.events.EventObject) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 EventObject (org.netxms.client.events.EventObject)1 SnmpTrap (org.netxms.client.snmp.SnmpTrap)1 SelectSnmpTrapDialog (org.netxms.ui.eclipse.serverconfig.dialogs.SelectSnmpTrapDialog)1