• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EventInfoResource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:DebugEventService.java


示例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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:DebugEventService.java


示例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());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:22,代码来源:DebugEventTest.java


示例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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:30,代码来源:DebugEventService.java


示例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);
        }
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:DebugEventService.java


示例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);
        }
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:9,代码来源:DebugEventService.java



注:本文中的net.floodlightcontroller.debugevent.DebugEventResource.EventInfoResource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IORToSocketInfo类代码示例发布时间:2022-05-22
下一篇:
Java IInvBasic类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap