Search in sources :

Example 6 with FloodlightContext

use of net.floodlightcontroller.core.FloodlightContext in project open-kilda by telstra.

the class MockFloodlightProvider method handleOutgoingMessage.

@Override
public void handleOutgoingMessage(IOFSwitch sw, OFMessage m) {
    FloodlightContext bc = new FloodlightContext();
    List<IOFMessageListener> msgListeners = null;
    if (listeners.containsKey(m.getType())) {
        msgListeners = listeners.get(m.getType()).getOrderedListeners();
    }
    if (msgListeners != null) {
        for (IOFMessageListener listener : msgListeners) {
            if (Command.STOP.equals(listener.receive(sw, m, bc))) {
                break;
            }
        }
    }
}
Also used : IOFMessageListener(net.floodlightcontroller.core.IOFMessageListener) FloodlightContext(net.floodlightcontroller.core.FloodlightContext)

Aggregations

FloodlightContext (net.floodlightcontroller.core.FloodlightContext)6 Before (org.junit.Before)5 FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)4 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)3 OFPacketIn (org.projectfloodlight.openflow.protocol.OFPacketIn)3 OFPortDesc (org.projectfloodlight.openflow.protocol.OFPortDesc)3 InetSocketAddress (java.net.InetSocketAddress)2 SwitchDescription (net.floodlightcontroller.core.SwitchDescription)2 HashMap (java.util.HashMap)1 IOFMessageListener (net.floodlightcontroller.core.IOFMessageListener)1 Ethernet (net.floodlightcontroller.packet.Ethernet)1 IPacket (net.floodlightcontroller.packet.IPacket)1 OFPacketOut (org.projectfloodlight.openflow.protocol.OFPacketOut)1 Match (org.projectfloodlight.openflow.protocol.match.Match)1 DatapathId (org.projectfloodlight.openflow.types.DatapathId)1