/** * Add an event - add to the 'EventKey' map using the event mask by default. * If the event has snmp information, add using the snmp EID * * @param event * the org.opennms.netmgt.xml.eventconf.Event */ public synchronized void put(org.opennms.netmgt.xml.eventconf.Event event) { // the event key EventKey eventKey = new EventKey(event); // add to the configevent map first m_eventMap.put(eventKey, event); // add to the uei to key list map updateUeiToKeyListMap(eventKey, event); // if event has snmp information, add to the snmp map final org.opennms.netmgt.xml.eventconf.Snmp eventSnmp = event.getSnmp(); if (eventSnmp != null) { String eventEID = eventSnmp.getId(); if (eventEID != null) { EventKey snmpKey = new EventKey(); snmpKey.put(EventKey.TAG_SNMP_EID, new EventMaskValueList(eventEID)); m_eventMap.put(snmpKey, event); // add to the uei to key list map updateUeiToKeyListMap(snmpKey, event); } } }
/** * This method is used to transform an SNMP event configuration instance * into an SNMP event instance. This is used when the incoming event does * not have any SNMP information and the information from the configuration * object is copied. * * @param src * The configuration source to transform. * * @return The transformed SNMP information. * */ private org.opennms.netmgt.xml.event.Snmp transform(org.opennms.netmgt.xml.eventconf.Snmp src) { org.opennms.netmgt.xml.event.Snmp dest = new org.opennms.netmgt.xml.event.Snmp(); dest.setId(src.getId()); dest.setIdtext(src.getIdtext()); dest.setVersion(src.getVersion()); dest.setCommunity(src.getCommunity()); dest.setGeneric(src.getGeneric()); dest.setSpecific(src.getSpecific()); return dest; }
/** * This method is used to transform an SNMP event configuration instance * into an SNMP event instance. This is used when the incoming event does * not have any SNMP information and the information from the configuration * object is copied. * * @param src * The configuration source to transform. * * @return The transformed SNMP information. * */ private org.opennms.netmgt.xml.event.Snmp transform(org.opennms.netmgt.xml.eventconf.Snmp src) { org.opennms.netmgt.xml.event.Snmp dest = new org.opennms.netmgt.xml.event.Snmp(); dest.setId(src.getId()); dest.setIdtext(src.getIdtext()); dest.setVersion(src.getVersion()); dest.setCommunity(src.getCommunity()); dest.setGeneric(src.getGeneric()); dest.setSpecific(src.getSpecific()); return dest; }