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());
}
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());
}
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);
});
}
Aggregations