org.opennms.netmgt.xml.event.Events.getEventCollection()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.opennms.netmgt.xml.event.Events.getEventCollection()方法的一些代码示例,展示了Events.getEventCollection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Events.getEventCollection()方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Events
类名称:Events
方法名:getEventCollection

Events.getEventCollection介绍

[英]Method getEventCollection.Returns a reference to '_eventList'. No type checking is performed on any modifications to the Vector.
[中]

代码示例

代码示例来源:origin: OpenNMS/opennms

public void addAllEvents(Events events) {
      if (events == null) {
        return;
      }
      final List<Event> eventCollection = events.getEventCollection();
      if (eventCollection != null) {
        for (final Event e : eventCollection) {
          this.addEvent(e);
        }
      }
    }
}

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.api

public void addAllEvents(Events events) {
      if (events == null) {
        return;
      }
      final List<Event> eventCollection = events.getEventCollection();
      if (eventCollection != null) {
        for (final Event e : eventCollection) {
          this.addEvent(e);
        }
      }
    }
}

代码示例来源:origin: OpenNMS/opennms

/**
 * Send the incoming {@link Log} message into the Camel route
 * specified by the {@link #m_endpointUri} property.
 */
@Override
public void sendNow(Log eventLog) {
  for (Event event : eventLog.getEvents().getEventCollection()) {
    m_proxy.sendNow(event);
  }
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>send</p>
 *
 * @param eventLog a {@link org.opennms.netmgt.xml.event.Log} object.
 * @throws org.opennms.netmgt.events.api.EventProxyException if any.
 */
@Override
public void send(Log eventLog) throws EventProxyException {
  for (Event e : eventLog.getEvents().getEventCollection()) {
    add(e);
  }
}

代码示例来源:origin: org.opennms.features.activemq/org.opennms.features.activemq.event-forwarder

/**
   * Send the incoming {@link Log} message into the Camel route
   * specified by the {@link #m_endpointUri} property.
   */
  @Override
  public void sendNow(Log eventLog) {
    for (Event event : eventLog.getEvents().getEventCollection()) {
      m_proxy.sendNow(event);
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public void sendNow(final Log eventLog) {
  for (final Event event : eventLog.getEvents().getEventCollection()) {
    sendNow(event);
  }
}

代码示例来源:origin: org.opennms/opennms-dao-mock

@Override
public void sendNow(final Log eventLog) {
  for (final Event event : eventLog.getEvents().getEventCollection()) {
    sendNow(event);
  }
}

代码示例来源:origin: org.opennms/opennms-dao-mock

@Override
public void sendNowSync(Log eventLog) {
  for (final Event event : eventLog.getEvents().getEventCollection()) {
    sendNow(event, true);
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public void sendNowSync(Log eventLog) {
  for (final Event event : eventLog.getEvents().getEventCollection()) {
    sendNow(event, true);
  }
}

代码示例来源:origin: org.opennms.features.amqp/org.opennms.features.amqp.event-forwarder

/**
 * Send the incoming {@link Log} message into the Camel route
 * specified by the {@link #m_endpointUri} property.
 */
@Override
public void sendNow(Log eventLog) {
  for (Event event : eventLog.getEvents().getEventCollection()) {
    m_proxy.sendNow(event);
  }
}

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon

@Override
public void process(Log eventLog) throws EventProcessorException {
  if (eventLog != null && eventLog.getEvents() != null) {
    final List<Event> eventsInLog = eventLog.getEvents().getEventCollection();

代码示例来源:origin: OpenNMS/opennms

@Override
public void sendNow(final Log log) {
  if (log != null && log.getEvents() != null && log.getEvents().getEventCount() > 0) {
    m_events.addAll(log.getEvents().getEventCollection());
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public void process(Log eventLog) throws EventProcessorException {
  if (eventLog != null && eventLog.getEvents() != null) {
    final List<Event> eventsInLog = eventLog.getEvents().getEventCollection();

代码示例来源:origin: org.opennms/opennms-provisiond

@Override
public void sendNow(final Log log) {
  if (log != null && log.getEvents() != null && log.getEvents().getEventCount() > 0) {
    m_events.addAll(log.getEvents().getEventCollection());
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public void handleMessage(TrapLogDTO messageLog) {
  try (Logging.MDCCloseable mdc = Logging.withPrefixCloseable(Trapd.LOG4J_CATEGORY)) {
    final Log eventLog = toLog(messageLog);
    eventForwarder.sendNowSync(eventLog);
    // If configured, also send events for new suspects
    if (config.getNewSuspectOnTrap()) {
      eventLog.getEvents().getEventCollection().stream()
          .filter(e -> !e.hasNodeid())
          .forEach(e -> {
            sendNewSuspectEvent(e.getInterface(), e.getDistPoller());
            LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface());
          });
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

private void broadcast(Log eventLog)  {
  if (LOG.isTraceEnabled())  {
    for (Event event : eventLog.getEvents().getEventCollection()) {
      LOG.trace("Processing a syslog to event dispatch", event.toString());
      String uuid = event.getUuid();
    eventLog.getEvents().getEventCollection().stream()
      .filter(e -> !e.hasNodeid())
      .forEach(e -> {

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.traps

@Override
public void handleMessage(TrapLogDTO messageLog) {
  try (Logging.MDCCloseable mdc = Logging.withPrefixCloseable(Trapd.LOG4J_CATEGORY)) {
    final Log eventLog = toLog(messageLog);
    eventForwarder.sendNowSync(eventLog);
    // If configured, also send events for new suspects
    if (config.getNewSuspectOnTrap()) {
      eventLog.getEvents().getEventCollection().stream()
          .filter(e -> !e.hasNodeid())
          .forEach(e -> {
            sendNewSuspectEvent(e.getInterface(), e.getDistPoller());
            LOG.debug("Sent newSuspectEvent for interface {}", e.getInterface());
          });
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public void run() {
  final RateLimiter rateLimiter = RateLimiter.create(eventsPerSecondPerThread);
  while (true) {
    Log log = new Log();
    log.setEvents(new Events());
    for (int i=0; i<batchSize; i++) {
      log.getEvents().getEventCollection().add(getNextEvent());
    }
    rateLimiter.acquire(batchSize);
    if (isSynchronous) {
      eventForwarder.sendNowSync(log);
    } else {
      eventForwarder.sendNow(log);
    }
    eventsGenerated.mark(batchSize);
    if (Thread.interrupted()) {
      break;
    }
  }
}

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon

for (final Event event : events.getEventCollection()) {
  if (event.getNodeid() == 0) {
    final Parm foreignSource = event.getParm("_foreignSource");

代码示例来源:origin: OpenNMS/opennms

for (final Event event : events.getEventCollection()) {
  if (event.getNodeid() == 0) {
    final Parm foreignSource = event.getParm("_foreignSource");

相关文章