Search in sources :

Example 6 with NewCorrelationContextRequired

use of org.openkilda.floodlight.utils.NewCorrelationContextRequired in project open-kilda by telstra.

the class SwitchManager method receive.

/**
 * {@inheritDoc}
 */
@Override
@NewCorrelationContextRequired
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
    logger.debug("OF_ERROR: {}", msg);
    // TODO: track xid for flow id
    if (OFType.ERROR.equals(msg.getType())) {
        ErrorMessage error = new ErrorMessage(new ErrorData(ErrorType.INTERNAL_ERROR, ((OFErrorMsg) msg).getErrType().toString(), null), System.currentTimeMillis(), CorrelationContext.getId(), Destination.WFM_TRANSACTION);
        // TODO: Most/all commands are flow related, but not all. 'kilda.flow' might
        // not be the best place to send a generic error.
        producerService.sendMessageAndTrackWithZk("kilda.flow", error);
    }
    return Command.CONTINUE;
}
Also used : ErrorMessage(org.openkilda.messaging.error.ErrorMessage) ErrorData(org.openkilda.messaging.error.ErrorData) NewCorrelationContextRequired(org.openkilda.floodlight.utils.NewCorrelationContextRequired)

Aggregations

NewCorrelationContextRequired (org.openkilda.floodlight.utils.NewCorrelationContextRequired)6 ImmutableList (com.google.common.collect.ImmutableList)4 FutureCallback (com.google.common.util.concurrent.FutureCallback)4 Futures (com.google.common.util.concurrent.Futures)4 MoreExecutors.directExecutor (com.google.common.util.concurrent.MoreExecutors.directExecutor)4 String.format (java.lang.String.format)4 Collection (java.util.Collection)4 Collections (java.util.Collections)4 List (java.util.List)4 Map (java.util.Map)4 Set (java.util.Set)4 Function (java.util.function.Function)4 Collectors (java.util.stream.Collectors)4 IFloodlightProviderService (net.floodlightcontroller.core.IFloodlightProviderService)4 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)4 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)4 FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)4 IFloodlightModule (net.floodlightcontroller.core.module.IFloodlightModule)4 IFloodlightService (net.floodlightcontroller.core.module.IFloodlightService)4 IThreadPoolService (net.floodlightcontroller.threadpool.IThreadPoolService)4