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