Search in sources :

Example 6 with OFSwitch

use of org.onosproject.ofagent.api.OFSwitch in project onos by opennetworkinglab.

the class OFSwitchManager method processOFAgentStopped.

private void processOFAgentStopped(OFAgent ofAgent) {
    devices(ofAgent.networkId()).forEach(deviceId -> {
        OFSwitch ofSwitch = ofSwitchMap.get(deviceId);
        if (ofSwitch != null) {
            disconnectController(ofSwitch, ofAgent.controllers());
        }
    });
    DeviceService deviceService = virtualNetService.get(ofAgent.networkId(), DeviceService.class);
    deviceService.removeListener(deviceListener);
    PacketService packetService = virtualNetService.get(ofAgent.networkId(), PacketService.class);
    packetService.removeProcessor(packetProcessor);
    FlowRuleService flowRuleService = virtualNetService.get(ofAgent.networkId(), FlowRuleService.class);
    flowRuleService.removeListener(flowRuleListener);
}
Also used : PacketService(org.onosproject.net.packet.PacketService) DeviceService(org.onosproject.net.device.DeviceService) OFSwitch(org.onosproject.ofagent.api.OFSwitch) FlowRuleService(org.onosproject.net.flow.FlowRuleService)

Aggregations

OFSwitch (org.onosproject.ofagent.api.OFSwitch)6 DeviceService (org.onosproject.net.device.DeviceService)2 FlowRuleService (org.onosproject.net.flow.FlowRuleService)2 PacketService (org.onosproject.net.packet.PacketService)2 ChannelOutboundInvoker (io.netty.channel.ChannelOutboundInvoker)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Argument (org.apache.karaf.shell.api.action.Argument)1 Command (org.apache.karaf.shell.api.action.Command)1 Service (org.apache.karaf.shell.api.action.lifecycle.Service)1 AbstractShellCommand (org.onosproject.cli.AbstractShellCommand)1 NetworkId (org.onosproject.incubator.net.virtual.NetworkId)1 ConnectPoint (org.onosproject.net.ConnectPoint)1 OFAgent (org.onosproject.ofagent.api.OFAgent)1 OFSwitchService (org.onosproject.ofagent.api.OFSwitchService)1 OFActionType (org.projectfloodlight.openflow.protocol.OFActionType)1 OFPacketOut (org.projectfloodlight.openflow.protocol.OFPacketOut)1 OFAction (org.projectfloodlight.openflow.protocol.action.OFAction)1 OFActionOutput (org.projectfloodlight.openflow.protocol.action.OFActionOutput)1 OFPort (org.projectfloodlight.openflow.types.OFPort)1