Search in sources :

Example 6 with PacketService

use of org.onosproject.net.packet.PacketService 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

PacketService (org.onosproject.net.packet.PacketService)6 DeviceService (org.onosproject.net.device.DeviceService)2 FlowRuleService (org.onosproject.net.flow.FlowRuleService)2 TrafficSelector (org.onosproject.net.flow.TrafficSelector)2 PacketPriority (org.onosproject.net.packet.PacketPriority)2 OFSwitch (org.onosproject.ofagent.api.OFSwitch)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 Before (org.junit.Before)1 ComponentContextAdapter (org.onlab.osgi.ComponentContextAdapter)1 TestApplicationId (org.onosproject.TestApplicationId)1 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)1 ApplicationId (org.onosproject.core.ApplicationId)1 CoreService (org.onosproject.core.CoreService)1 VirtualNetworkService (org.onosproject.incubator.net.virtual.VirtualNetworkService)1 DeviceId (org.onosproject.net.DeviceId)1 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)1