Interface OpenFlowController


  • public interface OpenFlowController
    Abstraction of an OpenFlow controller. Serves as a one stop shop for obtaining OpenFlow devices and (un)register listeners on OpenFlow events
    • Method Detail

      • getSwitches

        java.lang.Iterable<OpenFlowSwitch> getSwitches()
        Returns all switches known to this OF controller.
        Returns:
        Iterable of dpid elements
      • getMasterSwitches

        java.lang.Iterable<OpenFlowSwitch> getMasterSwitches()
        Returns all master switches known to this OF controller.
        Returns:
        Iterable of dpid elements
      • getEqualSwitches

        java.lang.Iterable<OpenFlowSwitch> getEqualSwitches()
        Returns all equal switches known to this OF controller.
        Returns:
        Iterable of dpid elements
      • getSwitch

        OpenFlowSwitch getSwitch​(Dpid dpid)
        Returns the actual switch for the given Dpid.
        Parameters:
        dpid - the switch to fetch
        Returns:
        the interface to this switch
      • getMasterSwitch

        OpenFlowSwitch getMasterSwitch​(Dpid dpid)
        Returns the actual master switch for the given Dpid, if one exists.
        Parameters:
        dpid - the switch to fetch
        Returns:
        the interface to this switch
      • getEqualSwitch

        OpenFlowSwitch getEqualSwitch​(Dpid dpid)
        Returns the actual equal switch for the given Dpid, if one exists.
        Parameters:
        dpid - the switch to fetch
        Returns:
        the interface to this switch
      • addListener

        void addListener​(OpenFlowSwitchListener listener)
        Register a listener for meta events that occur to OF devices.
        Parameters:
        listener - the listener to notify
      • removeListener

        void removeListener​(OpenFlowSwitchListener listener)
        Unregister a listener.
        Parameters:
        listener - the listener to unregister
      • addMessageListener

        void addMessageListener​(OpenFlowMessageListener listener)
        Register a listener for all OF msg types.
        Parameters:
        listener - the listener to notify
      • removeMessageListener

        void removeMessageListener​(OpenFlowMessageListener listener)
        Unregister a listener for all OF msg types.
        Parameters:
        listener - the listener to notify
      • addPacketListener

        void addPacketListener​(int priority,
                               PacketListener listener)
        Register a listener for packet events.
        Parameters:
        priority - the importance of this listener, lower values are more important
        listener - the listener to notify
      • removePacketListener

        void removePacketListener​(PacketListener listener)
        Unregister a listener.
        Parameters:
        listener - the listener to unregister
      • addEventListener

        void addEventListener​(OpenFlowEventListener listener)
        Register a listener for OF msg events.
        Parameters:
        listener - the listener to notify
      • removeEventListener

        void removeEventListener​(OpenFlowEventListener listener)
        Unregister a listener.
        Parameters:
        listener - the listener to unregister
      • write

        void write​(Dpid dpid,
                   org.projectfloodlight.openflow.protocol.OFMessage msg)
        Send a message to a particular switch.
        Parameters:
        dpid - the switch to send to.
        msg - the message to send
      • writeResponse

        java.util.concurrent.CompletableFuture<org.projectfloodlight.openflow.protocol.OFMessage> writeResponse​(Dpid dpid,
                                                                                                                org.projectfloodlight.openflow.protocol.OFMessage msg)
        Send a message to a particular switch and return the future response.
        Parameters:
        dpid - the switch to send to
        msg - the message to send
        Returns:
        future for response message
      • processPacket

        void processPacket​(Dpid dpid,
                           org.projectfloodlight.openflow.protocol.OFMessage msg)
        Process a message and notify the appropriate listeners.
        Parameters:
        dpid - the dpid the message arrived on
        msg - the message to process.
      • setRole

        void setRole​(Dpid dpid,
                     RoleState role)
        Sets the role for a given switch.
        Parameters:
        role - the desired role
        dpid - the switch to set the role for.
      • removeClassifierListener

        void removeClassifierListener​(OpenFlowClassifierListener listener)
        Remove OpenFlow classifier listener from runtime store of classifiers listener.
        Parameters:
        listener - the OpenFlow classifier to remove
      • addClassifierListener

        void addClassifierListener​(OpenFlowClassifierListener listener)
        Add OpenFlow classifier listener to runtime store of classifiers listener.
        Parameters:
        listener - the OpenFlow classifier listener