@Override public SinkModule<TrapInformationWrapper, TrapLogDTO> getModule() { return new TrapSinkModule(config, distPollerDao.whoami()); }
oe.setEventDescr(event.getDescr()); try { oe.setDistPoller(m_distPollerDao.get(event.getDistPoller())); } catch (final DataAccessException e) { throw new EventProcessorException(e);
private void updateSubObjects(final OnmsAlarm alarm) { // Assume that the system ID is the ID of an OpenNMS system // instead of a Minion or Remote Poller getDistPollerDao().save((OnmsDistPoller)alarm.getDistPoller()); getEventDao().save(alarm.getLastEvent()); getNodeDao().save(alarm.getNode()); getServiceTypeDao().save(alarm.getServiceType()); }
oe.setEventDescr(event.getDescr()); try { oe.setDistPoller(m_distPollerDao.get(event.getDistPoller())); } catch (final DataAccessException e) { throw new EventProcessorException(e);
private void updateSubObjects(final OnmsAlarm alarm) { // Assume that the system ID is the ID of an OpenNMS system // instead of a Minion or Remote Poller getDistPollerDao().save((OnmsDistPoller)alarm.getDistPoller()); getEventDao().save(alarm.getLastEvent()); getNodeDao().save(alarm.getNode()); getServiceTypeDao().save(alarm.getServiceType()); }
@Override public SinkModule<TrapInformationWrapper, TrapLogDTO> getModule() { return new TrapSinkModule(config, distPollerDao.whoami()); }
private AsyncDispatcher<TrapInformationWrapper> getMessageDispatcher() { if (m_dispatcher == null) { Objects.requireNonNull(m_messageDispatcherFactory); m_dispatcher = m_messageDispatcherFactory.createAsyncDispatcher(new TrapSinkModule(m_config, m_distPollerDao.whoami())); } return m_dispatcher; }
private AsyncDispatcher<TrapInformationWrapper> getMessageDispatcher() { if (m_dispatcher == null) { Objects.requireNonNull(m_messageDispatcherFactory); m_dispatcher = m_messageDispatcherFactory.createAsyncDispatcher(new TrapSinkModule(m_config, m_distPollerDao.whoami())); } return m_dispatcher; }
@Override public AggregationPolicy<TelemetryMessage, TelemetryProtos.TelemetryMessageLog, TelemetryProtos.TelemetryMessageLog.Builder> getAggregationPolicy() { final String systemId = distPollerDao.whoami().getId(); final String systemLocation = distPollerDao.whoami().getLocation(); return new AggregationPolicy<TelemetryMessage, TelemetryProtos.TelemetryMessageLog, TelemetryProtos.TelemetryMessageLog.Builder>() { @Override
/** * Used for testing. */ public SyslogMessageLogDTO toMessageLog(SyslogConnection... connections) { final String systemId = distPollerDao.whoami().getId(); final String systemLocation = distPollerDao.whoami().getLocation(); if (connections.length < 1) { throw new IllegalArgumentException("One or more connection are required."); } final SyslogMessageLogDTO messageLog = new SyslogMessageLogDTO(systemLocation, systemId, connections[0].getSource()); for (SyslogConnection connection : connections) { final SyslogMessageDTO messageDTO = new SyslogMessageDTO(connection.getBuffer()); messageLog.getMessages().add(messageDTO); } return messageLog; }
@Override public AggregationPolicy<SyslogConnection, SyslogMessageLogDTO, SyslogMessageLogDTO> getAggregationPolicy() { final String systemId = distPollerDao.whoami().getId(); final String systemLocation = distPollerDao.whoami().getLocation(); return new AggregationPolicy<SyslogConnection, SyslogMessageLogDTO, SyslogMessageLogDTO>() { @Override
private OnmsAlarm buildAlarm(final OnmsEvent event) { // TODO: Add reductionKey, suppressedTime, suppressedUntil to this object? final OnmsAlarm alarm = new OnmsAlarm(); alarm.setDistPoller(getDistPollerDao().whoami()); alarm.setUei(event.getEventUei()); alarm.setAlarmType(OnmsAlarm.PROBLEM_TYPE); alarm.setNode(m_node1); alarm.setDescription("This is a test alarm"); alarm.setLogMsg("this is a test alarm log message"); alarm.setCounter(1); alarm.setIpAddr(InetAddressUtils.getInetAddress("192.168.1.1")); alarm.setSeverity(OnmsSeverity.NORMAL); alarm.setFirstEventTime(event.getEventTime()); alarm.setLastEvent(event); alarm.setServiceType(m_serviceTypeDao.findByName("ICMP")); return alarm; }