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

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

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

Event.setTime介绍

[英]Sets the value of field 'time'. The field 'time' has the following description: The time at which this event was generated. The time is in the format generated by the java.text.DateFormat using the DateFormat.FULL style for the default locale. For example: "Monday, February 18, 2002 3:01:58 PM EST"
[中]设置字段“时间”的值。“时间”字段具有以下描述:生成此事件的时间。时间采用java生成的格式。文本DateFormat使用DateFormat。默认区域设置的完整样式。例如:“2002年2月18日星期一美国东部时间下午3:01:58”

代码示例

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

/**
 * <p>setTime</p>
 *
 * @param date a {@link java.util.Date} object.
 * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object.
 */
public EventBuilder setTime(final Date date) {
  m_event.setTime(date);
  return this;
}

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

/**
 * <p>setEventTime</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 * @param date a {@link java.util.Date} object.
 */
public static void setEventTime(Event event, Date date) {
  event.setTime(date);
}

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

/**
 * <p>getEvent</p>
 *
 * @return a {@link org.opennms.netmgt.xml.event.Event} object.
 */
public Event getEvent() {
  if (m_event.getTime() == null && zonedDateTimeBuilder != null) {
    ZonedDateTime time = zonedDateTimeBuilder.build();
    m_event.setTime(Date.from(time.toInstant()));
  }
  if (m_event.getCreationTime() == null) {
    // The creation time has been used as the time when the event
    // is stored in the database so update it right before we return
    // the event object.
    m_event.setCreationTime(new Date());
  }
  return m_event;
}

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

@Override
public void processRow(ResultSet rs) throws SQLException {
  event.setDbid(rs.getInt("eventid"));
  event.setUei(rs.getString("eventuei"));
  event.setNodeid(rs.getLong("nodeid"));
  event.setTime(rs.getDate("eventtime"));
  event.setHost(rs.getString("eventhost"));
  event.setInterface(rs.getString("ipaddr"));
  event.setSnmphost(rs.getString("eventsnmphost"));
  event.setService(getServiceName(rs.getInt("serviceid")));
  event.setCreationTime(rs.getDate("eventcreatetime"));
  event.setSeverity(rs.getString("eventseverity"));
  event.setPathoutage(rs.getString("eventpathoutage"));
  Tticket tticket = new Tticket();
  tticket.setContent(rs.getString("eventtticket"));
  tticket.setState(rs.getString("eventtticketstate"));
  event.setTticket(tticket);
  event.setSource(rs.getString("eventsource"));
}

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

event.setTime(alarm.getLastEventTime());

相关文章