org.opennms.netmgt.xml.event.Events类的使用及代码示例

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

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

Events介绍

[英]Class Events.
[中]班级活动。

代码示例

代码示例来源:origin: stackoverflow.com

// A unique dispatcher
final static Events events = new Events();

// Somewhere, an observer is interested by collision events 
CollisionListener observer = ...
events.listen( Collision.class, observer );

// there is some moving parts        
Spaceship aShip = ...
Meteor aMeteor = ...

// Later they collide => a collision event is notified trough the dispatcher
events.notify( new Collision( ship, meteor  ) );

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

@Override
public void sendNowSync(Event event) {
  Objects.requireNonNull(event);
  Events events = new Events();
  events.addEvent(event);
  Log eventLog = new Log();
  eventLog.setEvents(events);
  sendNowSync(eventLog);
}

代码示例来源: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

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

代码示例来源:origin: stackoverflow.com

for (int i=0;i<day1.length;i++)
 {
   Events event= new Events();
   event.setEvent(day1[i]);
   event.setVenue(day1venue[i]);
   event.setTime(timings[i]);
   event.setDetails("This is Pantheon 2016\n Play it safe and have a good time. Live long and prosper");
   event.setFavourite(false);
 }

代码示例来源:origin: stackoverflow.com

public Event getEvent(String tableClick) {
Events e = new Events();
try {
  pst = conn.prepareStatement("SELECT * FROM Event WHERE eventID='"+tableClick+"' ");
  rs = pst.executeQuery();
  while(rs.next()){      
  e.setEventName(rs.getString(2));
  System.out.println(rs.getString(2));
  e.setEventDate(rs.getDate(3));
  e.setEventTime(rs.getString(4));
  e.setEventVenue(rs.getString(5));
  e.setEventDetail(rs.getString(6));
  e.setEventOpportunity(rs.getString(7));
  e.setEventMoreDetails(rs.getString(8));
  e.setEndTime(rs.getString(9));
  rs.close();
  pst.close();
  return e;
  }
} catch(SQLException ex) {
  ex.printStackTrace();
  return null;
} 

} //end getEvent

代码示例来源: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: OpenNMS/opennms

private Log createLog(List<Event> eventList) {
  final Header header = new Header();
  header.setCreated(StringUtils.toStringEfficiently(new Date()));
  final Events events = new Events();
  events.setEvent(eventList);
  final Log log = new Log();
  log.setEvents(events);
  log.setHeader(header);
  return log;
}

代码示例来源: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: stackoverflow.com

protected ArrayList<Events> doInBackground(Void... params) {
  ArrayList<Events> events = new ArrayList<>();
  Events eventsLucky = new Events();
  eventsLucky.setId("1");
  eventsLucky.setTitleEvent("New Year CountDown Party");
  eventsLucky.setDateEvent("10/10/12");
  events.add(eventsLucky);
  Events eventsLucky1 = new Events();
  eventsLucky1.setId("2");
  eventsLucky1.setTitleEvent("Tiger Remix Concert 2016 ");
  eventsLucky1.setDateEvent("10/10/12");
  events.add(eventsLucky1);
  Events eventsLucky2 = new Events();
  eventsLucky2.setId("3");
  eventsLucky2.setTitleEvent("Tiger Remix Concert 2016 ");
  eventsLucky2.setDateEvent("10/10/1212");
  events.add(eventsLucky2);
  Events eventsLucky3 = new Events();
  eventsLucky3.setId("4");
  eventsLucky3.setTitleEvent("Tiger Remix Concert 2016 ");
  eventsLucky3.setDateEvent("10/10/1212");
  events.add(eventsLucky3);

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

@Override
public void process(Log eventLog) throws EventProcessorException {
  if (eventLog != null && eventLog.getEvents() != null && eventLog.getEvents().getEvent() != null) {
    try(Context ctx = expandTimer.time()) {
      for (Event event : eventLog.getEvents().getEvent()) {
        expandEvent(event);
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

Events events = new Events();
events.getEvents(11, 25).add("Christmas");
events.getEvents(0, 1).add("New years day");

代码示例来源:origin: stackoverflow.com

query.findInBackground(new FindCallback<ParseObject>() {
    public void done(List<ParseObject> eventList, ParseException e) {
      if (e == null) {
        Log.d("Events", "Retrieved " + eventList.size() + " Events");

      for (int i = 0; i < eventList.size(); i++) {
        Events events = new Events();
        events.setTitle((String) eventList.get(i).get("teststr"));
        events.setId(String.valueOf( eventList.get(i).get("id")));
        listEvents.add(events);
      }

      eventAdapter = new EventAdapter(this);
      eventAdapter.setEventList(listEvents);
      eventsList.setAdapter(eventAdapter);
    } else {
      Log.d("score", "Error: " + e.getMessage());
    }
  }
});

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

public void addEvent(final Event event) {
  assertEventsExists();
  this._events.addEvent(event);
}

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

eventsSent += log.getEvents().getEventCount();
eventOffset = eventOffset + events.size();

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

@Override
public void sendNowSync(Event event) {
  Objects.requireNonNull(event);
  Events events = new Events();
  events.addEvent(event);
  Log eventLog = new Log();
  eventLog.setEvents(events);
  sendNowSync(eventLog);
}

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

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

代码示例来源: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: 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: org.opennms.features/org.opennms.features.opennms-es-rest

private Log createLog(List<Event> eventList) {
  final Header header = new Header();
  header.setCreated(StringUtils.toStringEfficiently(new Date()));
  final Events events = new Events();
  events.setEvent(eventList);
  final Log log = new Log();
  log.setEvents(events);
  log.setHeader(header);
  return log;
}

相关文章