Search in sources :

Example 1 with FlowRerouteService

use of org.openkilda.wfm.topology.flowhs.service.FlowRerouteService in project open-kilda by telstra.

the class YFlowRerouteHubBolt method init.

@Override
protected void init() {
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    RuleManager ruleManager = new RuleManagerImpl(ruleManagerConfig);
    flowRerouteService = new FlowRerouteService(new FlowRerouteHubCarrierIsolatingResponsesAndLifecycleEvents(this), persistenceManager, pathComputer, resourcesManager, flowRerouteConfig.getPathAllocationRetriesLimit(), flowRerouteConfig.getPathAllocationRetryDelay(), flowRerouteConfig.getResourceAllocationRetriesLimit(), flowRerouteConfig.getSpeakerCommandRetriesLimit());
    yFlowRerouteService = new YFlowRerouteService(this, persistenceManager, pathComputer, resourcesManager, ruleManager, flowRerouteService, yFlowRerouteConfig.getResourceAllocationRetriesLimit(), yFlowRerouteConfig.getSpeakerCommandRetriesLimit());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) RuleManager(org.openkilda.rulemanager.RuleManager) YFlowRerouteService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowRerouteService) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl) YFlowRerouteService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowRerouteService) FlowRerouteService(org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)

Example 2 with FlowRerouteService

use of org.openkilda.wfm.topology.flowhs.service.FlowRerouteService in project open-kilda by telstra.

the class FlowRerouteHubBolt method init.

@Override
protected void init() {
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    service = new FlowRerouteService(this, persistenceManager, pathComputer, resourcesManager, config.getPathAllocationRetriesLimit(), config.getPathAllocationRetryDelay(), config.getResourceAllocationRetriesLimit(), config.getSpeakerCommandRetriesLimit());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) FlowRerouteService(org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)

Example 3 with FlowRerouteService

use of org.openkilda.wfm.topology.flowhs.service.FlowRerouteService in project open-kilda by telstra.

the class YFlowRerouteServiceTest method processRerouteRequestAndSpeakerCommands.

private void processRerouteRequestAndSpeakerCommands(YFlowRerouteRequest request) throws DuplicateKeyException {
    FlowRerouteService flowRerouteService = makeFlowRerouteService(0);
    YFlowRerouteService service = makeYFlowRerouteService(flowRerouteService, 0);
    service.handleRequest(request.getYFlowId(), new CommandContext(), request);
    verifyYFlowStatus(request.getYFlowId(), FlowStatus.IN_PROGRESS);
    handleSpeakerRequests(speakerRequest -> {
        SpeakerResponse commandResponse;
        if (speakerRequest instanceof FlowSegmentRequest) {
            FlowSegmentRequest flowSegmentRequest = (FlowSegmentRequest) speakerRequest;
            commandResponse = buildSuccessfulSpeakerResponse(flowSegmentRequest);
        } else {
            BaseSpeakerCommandsRequest speakerCommandsRequest = (BaseSpeakerCommandsRequest) speakerRequest;
            commandResponse = buildSuccessfulYFlowSpeakerResponse(speakerCommandsRequest);
        }
        handleAsyncResponse(service, request.getYFlowId(), commandResponse);
    });
}
Also used : CommandContext(org.openkilda.wfm.CommandContext) FlowSegmentRequest(org.openkilda.floodlight.api.request.FlowSegmentRequest) SpeakerResponse(org.openkilda.floodlight.api.response.SpeakerResponse) BaseSpeakerCommandsRequest(org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest) FlowRerouteService(org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)

Example 4 with FlowRerouteService

use of org.openkilda.wfm.topology.flowhs.service.FlowRerouteService in project open-kilda by telstra.

the class YFlowRerouteServiceTest method processRerouteRequestAndSpeakerCommands.

private void processRerouteRequestAndSpeakerCommands(YFlowRerouteRequest request, FlowStatus expectedStatus, FlowStatus expectedFirstSubFlowStatus, FlowStatus expectedSecondSubFlowStatus) throws DuplicateKeyException {
    FlowRerouteService flowRerouteService = makeFlowRerouteService(0);
    YFlowRerouteService service = makeYFlowRerouteService(flowRerouteService, 0);
    service.handleRequest(request.getYFlowId(), new CommandContext(), request);
    verifyYFlowStatus(request.getYFlowId(), expectedStatus, expectedFirstSubFlowStatus, expectedSecondSubFlowStatus);
    handleSpeakerRequests(speakerRequest -> {
        SpeakerResponse commandResponse;
        if (speakerRequest instanceof FlowSegmentRequest) {
            FlowSegmentRequest flowSegmentRequest = (FlowSegmentRequest) speakerRequest;
            commandResponse = buildSuccessfulSpeakerResponse(flowSegmentRequest);
        } else {
            BaseSpeakerCommandsRequest speakerCommandsRequest = (BaseSpeakerCommandsRequest) speakerRequest;
            commandResponse = buildSuccessfulYFlowSpeakerResponse(speakerCommandsRequest);
        }
        handleAsyncResponse(service, request.getYFlowId(), commandResponse);
    });
}
Also used : CommandContext(org.openkilda.wfm.CommandContext) FlowSegmentRequest(org.openkilda.floodlight.api.request.FlowSegmentRequest) SpeakerResponse(org.openkilda.floodlight.api.response.SpeakerResponse) BaseSpeakerCommandsRequest(org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest) FlowRerouteService(org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)

Aggregations

FlowRerouteService (org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)4 FlowSegmentRequest (org.openkilda.floodlight.api.request.FlowSegmentRequest)2 BaseSpeakerCommandsRequest (org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest)2 SpeakerResponse (org.openkilda.floodlight.api.response.SpeakerResponse)2 AvailableNetworkFactory (org.openkilda.pce.AvailableNetworkFactory)2 PathComputer (org.openkilda.pce.PathComputer)2 PathComputerFactory (org.openkilda.pce.PathComputerFactory)2 CommandContext (org.openkilda.wfm.CommandContext)2 FlowResourcesManager (org.openkilda.wfm.share.flow.resources.FlowResourcesManager)2 RuleManager (org.openkilda.rulemanager.RuleManager)1 RuleManagerImpl (org.openkilda.rulemanager.RuleManagerImpl)1 YFlowRerouteService (org.openkilda.wfm.topology.flowhs.service.yflow.YFlowRerouteService)1