Search in sources :

Example 1 with FlowUpdateService

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

the class YFlowUpdateHubBolt 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);
    basicFlowUpdateService = new FlowUpdateService(new FlowUpdateHubCarrierIsolatingResponsesAndLifecycleEvents(this), persistenceManager, pathComputer, resourcesManager, flowUpdateConfig.getPathAllocationRetriesLimit(), flowUpdateConfig.getPathAllocationRetryDelay(), flowUpdateConfig.getResourceAllocationRetriesLimit(), flowUpdateConfig.getSpeakerCommandRetriesLimit());
    yflowUpdateService = new YFlowUpdateService(this, persistenceManager, pathComputer, resourcesManager, ruleManager, basicFlowUpdateService, yflowUpdateConfig.getResourceAllocationRetriesLimit(), yflowUpdateConfig.getSpeakerCommandRetriesLimit(), yflowUpdateConfig.getPrefixForGeneratedYFlowId(), yflowUpdateConfig.getPrefixForGeneratedSubFlowId());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) RuleManager(org.openkilda.rulemanager.RuleManager) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) YFlowUpdateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowUpdateService) FlowUpdateService(org.openkilda.wfm.topology.flowhs.service.FlowUpdateService) YFlowUpdateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowUpdateService) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl)

Example 2 with FlowUpdateService

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

the class FlowUpdateHubBolt 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 FlowUpdateService(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) FlowUpdateService(org.openkilda.wfm.topology.flowhs.service.FlowUpdateService)

Example 3 with FlowUpdateService

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

the class YFlowUpdateServiceTest method processUpdateRequestAndSpeakerCommands.

private void processUpdateRequestAndSpeakerCommands(YFlowRequest request, FlowStatus expectedStatus, FlowStatus expectedFirstSubFlowStatus, FlowStatus expectedSecondSubFlowStatus) throws DuplicateKeyException {
    FlowUpdateService flowUpdateService = makeFlowUpdateService(0);
    YFlowUpdateService service = makeYFlowUpdateService(flowUpdateService, 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) FlowUpdateService(org.openkilda.wfm.topology.flowhs.service.FlowUpdateService)

Aggregations

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