Search in sources :

Example 26 with MessageContext

use of org.openkilda.messaging.MessageContext 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)

Example 27 with MessageContext

use of org.openkilda.messaging.MessageContext in project open-kilda by telstra.

the class EgressFlowSegmentInstallCommandTest method makeCommand.

protected EgressFlowSegmentInstallCommand makeCommand(FlowEndpoint endpoint, FlowEndpoint ingressEndpoint, FlowTransitEncapsulation encapsulation, FlowSegmentMetadata metadata) {
    MessageContext messageContext = new MessageContext();
    UUID commandId = UUID.randomUUID();
    int islPort = 6;
    return new EgressFlowSegmentInstallCommand(messageContext, commandId, metadata, endpoint, ingressEndpoint, islPort, encapsulation, null);
}
Also used : MessageContext(org.openkilda.messaging.MessageContext) UUID(java.util.UUID) FlowEndpoint(org.openkilda.model.FlowEndpoint)

Example 28 with MessageContext

use of org.openkilda.messaging.MessageContext in project open-kilda by telstra.

the class EgressFlowSegmentRemoveCommandTest method makeCommand.

@Override
protected EgressFlowSegmentRemoveCommand makeCommand(FlowEndpoint endpoint, FlowEndpoint ingressEndpoint, FlowTransitEncapsulation encapsulation) {
    MessageContext messageContext = new MessageContext();
    UUID commandId = UUID.randomUUID();
    FlowSegmentMetadata metadata = new FlowSegmentMetadata("egress-flow-segment-remove-flow-id", new Cookie(101), false);
    int islPort = 8;
    return new EgressFlowSegmentRemoveCommand(messageContext, commandId, metadata, endpoint, ingressEndpoint, islPort, encapsulation, null);
}
Also used : Cookie(org.openkilda.model.cookie.Cookie) MessageContext(org.openkilda.messaging.MessageContext) UUID(java.util.UUID) FlowSegmentMetadata(org.openkilda.floodlight.model.FlowSegmentMetadata) FlowEndpoint(org.openkilda.model.FlowEndpoint)

Aggregations

MessageContext (org.openkilda.messaging.MessageContext)28 UUID (java.util.UUID)13 FlowSegmentMetadata (org.openkilda.floodlight.model.FlowSegmentMetadata)9 SwitchId (org.openkilda.model.SwitchId)9 ArrayList (java.util.ArrayList)7 Cookie (org.openkilda.model.cookie.Cookie)6 EgressFlowSegmentRequestFactory (org.openkilda.floodlight.api.request.factory.EgressFlowSegmentRequestFactory)5 InfoMessage (org.openkilda.messaging.info.InfoMessage)5 FlowEndpoint (org.openkilda.model.FlowEndpoint)5 MirrorConfig (org.openkilda.model.MirrorConfig)5 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)5 Session (org.openkilda.floodlight.service.session.Session)4 MeterConfig (org.openkilda.model.MeterConfig)4 MeterId (org.openkilda.model.MeterId)4 List (java.util.List)3 Optional (java.util.Optional)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 EgressMirrorFlowSegmentRequestFactory (org.openkilda.floodlight.api.request.factory.EgressMirrorFlowSegmentRequestFactory)3 FlowSegmentRequestFactory (org.openkilda.floodlight.api.request.factory.FlowSegmentRequestFactory)3 IngressFlowSegmentRequestFactory (org.openkilda.floodlight.api.request.factory.IngressFlowSegmentRequestFactory)3