@Override public net.floodlightcontroller.core.IListener.Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) { switch(msg.getType()) { case STATS_REQUEST: buffer.add(new SwitchMessagePair(sw, msg)); break; case PACKET_IN: buffer.add(new SwitchMessagePair(sw, msg)); break; case ECHO_REQUEST: buffer.add(new SwitchMessagePair(sw, msg)); logger.info("ECHO_REQUEST"); break; case ECHO_REPLY: buffer.add(new SwitchMessagePair(sw, msg)); logger.info("ECHO_REPLY"); break; default: break; } return Command.CONTINUE; }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); buffer = new ConcurrentCircularBuffer<SwitchMessagePair>(SwitchMessagePair.class, 100); restApi = context.getServiceImpl(IRestApiService.class); logger=LoggerFactory.getLogger(PktInHistory.class); }
@Get("json") public List<SwitchMessagePair> retrieve() { IPktinHistoryService pihr = (IPktinHistoryService)getContext().getAttributes() .get(IPktinHistoryService.class.getCanonicalName()); List<SwitchMessagePair> l = new ArrayList<SwitchMessagePair>(); l.addAll(java.util.Arrays.asList(pihr.getBuffer().snapshot())); return l; }
@Override public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) { switch(msg.getType()) { case PACKET_IN: buffer.add(new SwitchMessagePair(sw, msg)); break; default: break; } return Command.CONTINUE; }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); restApi = context.getServiceImpl(IRestApiService.class); buffer = new ConcurrentCircularBuffer<SwitchMessagePair>(SwitchMessagePair.class, 100); }
@Get("json") public List<SwitchMessagePair> retrieve() { IPktinHistoryService pihr = (IPktinHistoryService)getContext().getAttributes().get(IPktinHistoryService.class.getCanonicalName()); List<SwitchMessagePair> l = new ArrayList<SwitchMessagePair>(); l.addAll(java.util.Arrays.asList(pihr.getBuffer().snapshot())); return l; }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); restApi = context.getServiceImpl(IRestApiService.class); buffer = new ConcurrentCircularBuffer<SwitchMessagePair>(SwitchMessagePair.class, 100); logger = LoggerFactory.getLogger(QueuePusher.class); }
public ConcurrentCircularBuffer<SwitchMessagePair> getBuffer() { return buffer; }
@Override public ConcurrentCircularBuffer<SwitchMessagePair> getBuffer() { return buffer; }
public ConcurrentCircularBuffer<SwitchMessagePair> getBuffer();