Search in sources :

Example 6 with Session

use of org.openkilda.floodlight.service.session.Session in project open-kilda by telstra.

the class BfdCommand method call.

@Override
public Command call() throws Exception {
    try {
        IOFSwitch sw = switchManager.lookupSwitch(target);
        validate(sw);
        try (Session session = sessionService.open(new MessageContext(getContext().getCorrelationId()), sw)) {
            handle(session);
        }
    } catch (SwitchOperationException e) {
        handleError(e);
        // early error response
        sendResponse();
    }
    return null;
}
Also used : SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) IOFSwitch(net.floodlightcontroller.core.IOFSwitch) MessageContext(org.openkilda.messaging.MessageContext) Session(org.openkilda.floodlight.service.session.Session)

Aggregations

Session (org.openkilda.floodlight.service.session.Session)6 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)4 ArrayList (java.util.ArrayList)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 MessageContext (org.openkilda.messaging.MessageContext)2 OFFlowMod (org.projectfloodlight.openflow.protocol.OFFlowMod)2 OFMessage (org.projectfloodlight.openflow.protocol.OFMessage)2 Joiner (com.google.common.base.Joiner)1 String.format (java.lang.String.format)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 UUID (java.util.UUID)1 Function.identity (java.util.function.Function.identity)1 Collectors.counting (java.util.stream.Collectors.counting)1 Collectors.groupingBy (java.util.stream.Collectors.groupingBy)1 Builder (lombok.Builder)1 Slf4j (lombok.extern.slf4j.Slf4j)1 KafkaChannel (org.openkilda.floodlight.KafkaChannel)1