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

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

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

Event.getDbid介绍

[英]Returns the value of field 'dbid'. The field 'dbid' has the following description: The event database id
[中]返回字段“dbid”的值。字段“dbid”具有以下描述:事件数据库id

代码示例

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

/**
 * <p>getEventId</p>
 *
 * @return a int.
 */
@Override
public int getEventId() {
  return m_event.getDbid();
}

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

/**
 * @param e
 */
public void acknowledgeNoticesForEvent(Event e) {
  update("update notifications set respondTime = ? where eventID = ? and respondTime is null",
      new Timestamp(System.currentTimeMillis()), e.getDbid());
}

代码示例来源:origin: org.opennms.core.test-api/org.opennms.core.test-api.db

/**
 * @param e
 */
public void acknowledgeNoticesForEvent(Event e) {
  update("update notifications set respondTime = ? where eventID = ? and respondTime is null",
      new Timestamp(System.currentTimeMillis()), e.getDbid());
}

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

@Override
  public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
    if (event.hasDbid()) {
      return Integer.toString(event.getDbid());
    } else {
      return "eventid-unknown";
    }
  }
},

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

@Override
  public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
    if (event.hasDbid()) {
      return Integer.toString(event.getDbid());
    } else {
      return "eventid-unknown";
    }
  }
},

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

public String toString() {
  return m_event+", uei: "+m_event.getUei()+", id: "+m_event.getDbid()+", isPending: "+m_pending.get()+", list size: "+m_pendingOutages.size();
}

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

/**
 * @param event
 * @return
 */
public Collection<Integer> findNoticesForEvent(Event event) {
  final List<Integer> notifyIds = new LinkedList<>();
  Querier loadExisting = new Querier(this, "select notifyId from notifications where eventID = ?") {
    @Override
    public void processRow(ResultSet rs) throws SQLException {
      notifyIds.add(rs.getInt(1));
    }
  };
  loadExisting.execute(Integer.valueOf(event.getDbid()));
  return notifyIds;
}

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

/** {@inheritDoc} */
@Override
public synchronized void correlate(final Event e) {
  LOG.debug("Begin correlation for Event {} uei: {}", e.getDbid(), e.getUei());
  m_kieSession.insert(e);
  try {
    if (!m_isStreaming) m_kieSession.fireAllRules();
  } catch (Exception e1) {
    LOG.error("Exception while firing rules ", e1);
  }
  m_eventsMeter.mark();
  LOG.debug("End correlation for Event {} uei: {}", e.getDbid(), e.getUei());
}

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

private Integer getRegainedEventId() {
    if (m_regainedSvcEvent == null)
      return null;
    return Integer.valueOf(m_regainedSvcEvent.getDbid());
  }
}

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

private Integer getRegainedEventId() {
    if (m_regainedSvcEvent == null) {
      return null;
    }
    return Integer.valueOf(m_regainedSvcEvent.getDbid());
  }
}

代码示例来源:origin: org.opennms/drools-correlation-engine

/** {@inheritDoc} */
@Override
public synchronized void correlate(final Event e) {
  LOG.debug("Begin correlation for Event {} uei: {}", e.getDbid(), e.getUei());
  m_kieSession.insert(e);
  try {
    if (!m_isStreaming) m_kieSession.fireAllRules();
  } catch (Exception e1) {
    LOG.error("Exception while firing rules ", e1);
  }
  m_eventsMeter.mark();
  LOG.debug("End correlation for Event {} uei: {}", e.getDbid(), e.getUei());
}

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

public void createOutage(MockService svc, Event svcLostEvent) {
  createOutage(svc, svcLostEvent.getDbid(), new Timestamp(svcLostEvent.getTime().getTime()));
}

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

public void resolveOutage(MockService svc, Event svcRegainEvent) {
  resolveOutage(svc, svcRegainEvent.getDbid(), new Timestamp(svcRegainEvent.getTime().getTime()));
}

代码示例来源:origin: org.opennms.core.test-api/org.opennms.core.test-api.db

public void resolveOutage(MockService svc, Event svcRegainEvent) {
  resolveOutage(svc, svcRegainEvent.getDbid(), new Timestamp(svcRegainEvent.getTime().getTime()));
}

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

protected void closeOutagesForService(final Event event, final Long nodeId, final Date closeDate, final Service polledService) {
  getPoller().getQueryManager().closeOutagesForService(closeDate, event.getDbid(), nodeId.intValue(), polledService.getAddress(), polledService.getServiceName());
}

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

private synchronized void closeExpectedOutages(Event e, Outage pendingOutage) {
  for (Outage outage : m_expectedOutages) {
    if (pendingOutage.equals(outage)) {
      outage.setRegainedEvent(e.getDbid(), new Timestamp(e.getTime().getTime()));
    }
  }
}

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

@Override
public void processRow(ResultSet rs) throws SQLException {
  assertEquals(m_svc.getNodeId(), rs.getInt("nodeId"));
  assertEquals(m_svc.getIpAddr(), rs.getString("ipAddr"));
  assertEquals(m_svc.getSvcId(), rs.getInt("serviceId"));
  assertEquals(m_lostSvcEvent.getDbid(), Integer.valueOf(rs.getInt("svcLostEventId")));
  assertEquals(m_lostSvcTime, rs.getTimestamp("ifLostService"));
  assertEquals(getRegainedEventId(), rs
      .getObject("svcRegainedEventId"));
  assertEquals(m_regainedSvcTime, rs
      .getTimestamp("ifRegainedService"));
}

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

@Override
public void processRow(ResultSet rs) throws SQLException {
  assertEquals(m_svc.getNodeId(), rs.getInt("nodeId"));
  assertEquals(m_svc.getIpAddr(), rs.getString("ipAddr"));
  assertEquals(m_svc.getSvcId(), rs.getInt("serviceId"));
  assertEquals(m_lostSvcEvent.getDbid(), Integer.valueOf(rs.getInt("svcLostEventId")));
  assertEquals(m_lostSvcTime, rs.getTimestamp("ifLostService"));
  assertEquals(getRegainedEventId(), rs.getObject("svcRegainedEventId"));
  assertEquals(m_regainedSvcTime, rs.getTimestamp("ifRegainedService"));
}

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

@Override
public synchronized void onEvent(Event e) {
  for (Outage outage : getOutageList(m_pendingOpens, e)) {
    outage.setLostEvent(e.getDbid(), new Timestamp(e.getTime().getTime()));
    m_expectedOutages.add(outage);
  }
  clearOutageList(m_pendingOpens, e);
  
  for (Outage outage : getOutageList(m_pendingCloses, e)) {
    closeExpectedOutages(e, outage);
  }
  clearOutageList(m_pendingCloses, e);
}

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

private void assertElementHasCause(PollableElement element, Event causeEvent) {
  if (causeEvent == null) {
    assertElementHasNullCause(element);
  } else {
    if (element.getCause() == null || element.getCause().getEventId() != causeEvent.getDbid()) {
      failCause(element, causeEvent);
    }
  }
}

相关文章