本文整理汇总了Java中net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource类的典型用法代码示例。如果您正苦于以下问题:Java EventInfoResource类的具体用法?Java EventInfoResource怎么用?Java EventInfoResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventInfoResource类属于net.floodlightcontroller.debugevent.DebugEventResource包,在下文中一共展示了EventInfoResource类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllEventHistory
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
@Override
public List<EventInfoResource> getAllEventHistory() {
List<EventInfoResource> moduleEventList = new ArrayList<EventInfoResource>();
for (Map<String, Integer> modev : moduleEvents.values()) {
for (int eventId : modev.values()) {
if (allEvents.containsKey(eventId)) {
DebugEventHistory de = allEvents.get(eventId);
List<EventResource> eventData = new ArrayList<EventResource>();
// take snapshot and iterate
Iterator<Event> iter = de.circularEventBuffer.descendingIterator();
while (iter.hasNext()) {
Event e = iter.next();
eventData.add(e.getFormattedEvent(de.einfo.eventClass,
de.einfo.moduleEventName));
}
moduleEventList.add(new EventInfoResource(de.einfo,
eventData));
}
}
}
traceLogDebugHistory(moduleEventList);
return moduleEventList;
}
示例2: getModuleEventHistory
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
@Override
public List<EventInfoResource> getModuleEventHistory(String moduleName) {
if (!moduleEvents.containsKey(moduleName))
return Collections.emptyList();
List<EventInfoResource> moduleEventList = new ArrayList<EventInfoResource>();
for (int eventId : moduleEvents.get(moduleName).values()) {
if (allEvents.containsKey(eventId)) {
DebugEventHistory de = allEvents.get(eventId);
List<EventResource> eventData = new ArrayList<EventResource>();
// take snapshot and iterate
Iterator<Event> iter = de.circularEventBuffer.descendingIterator();
while (iter.hasNext()) {
Event e = iter.next();
eventData.add(e.getFormattedEvent(de.einfo.eventClass,
de.einfo.moduleEventName));
}
moduleEventList.add(new EventInfoResource(de.einfo,
eventData));
}
}
traceLogDebugHistory(moduleEventList);
return moduleEventList;
}
示例3: testAckEvent
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
@Test
public void testAckEvent() throws Exception{
IEventCategory<IntEvent> ev = null;
ev = debugEvent.buildEvent(IntEvent.class)
.setModuleName("test")
.setEventName("ack")
.setEventDescription("just a test")
.setEventType(EventType.ALWAYS_LOG)
.setBufferCapacity(20)
.setAckable(false)
.register();
//create a single event
IntEvent e = new IntEvent(10);
ev.newEventWithFlush(e);
EventInfoResource dei = debugEvent.getSingleEventHistory("test","ack", 1);
debugEvent.setAck(dei.getEventId(),
dei.getEvents().get(0).getEventInstanceId(),
true);
dei = debugEvent.getSingleEventHistory("test","ack", 1);
assertTrue(dei.getEvents().get(0).isAcked());
}
示例4: getSingleEventHistory
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
@Override
public EventInfoResource getSingleEventHistory(String moduleName,
String eventName,
int numOfEvents) {
if (!moduleEvents.containsKey(moduleName)) return null;
Integer eventId = moduleEvents.get(moduleName).get(eventName);
if (eventId == null) return null;
if (!allEvents.containsKey(eventId)) return null;
DebugEventHistory de = allEvents.get(eventId);
if (numOfEvents == 0) numOfEvents = de.einfo.bufferCapacity;
de.einfo.numOfEvents = numOfEvents;
int num = 1;
List<EventResource> eventData = new ArrayList<EventResource>();
// take snapshot and iterate
Iterator<Event> iter = de.circularEventBuffer.descendingIterator();
while (iter.hasNext()) {
Event e = iter.next();
if (num > numOfEvents) break;
eventData.add(e.getFormattedEvent(de.einfo.eventClass,
de.einfo.moduleEventName));
num++;
}
EventInfoResource ret = new EventInfoResource(de.einfo, eventData);
traceLogDebugHistory(Collections.singletonList(ret));
return ret;
}
示例5: traceLogDebugHistory
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
private void traceLogDebugHistory(List<EventInfoResource> l) {
if (!log.isTraceEnabled()) {
return;
}
for (EventInfoResource eir: l) {
for (EventResource der: eir.getEvents()) {
log.trace("{}", der);
}
}
}
示例6: floodlightIsShuttingDown
import net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource; //导入依赖的package包/类
@Override
public void floodlightIsShuttingDown() {
for (EventInfoResource eir: getAllEventHistory()) {
for (EventResource der: eir.getEvents()) {
log.info("{}", der);
}
}
}