use of org.openkilda.floodlight.api.request.rulemanager.OfCommand in project open-kilda by telstra.
the class UpdateYFlowRulesAction method buildYFlowDeleteRequest.
protected DeleteSpeakerCommandsRequest buildYFlowDeleteRequest(SwitchId switchId, PathId pathId, CommandContext context) {
List<OfCommand> ofCommands = buildYFlowOfCommands(switchId, pathId);
UUID commandId = commandIdGenerator.generate();
MessageContext messageContext = new MessageContext(commandId.toString(), context.getCorrelationId());
return new DeleteSpeakerCommandsRequest(messageContext, switchId, commandId, ofCommands);
}
use of org.openkilda.floodlight.api.request.rulemanager.OfCommand in project open-kilda by telstra.
the class UpdateYFlowRulesAction method buildYFlowOfCommands.
private List<OfCommand> buildYFlowOfCommands(SwitchId switchId, PathId pathId) {
DataAdapter dataAdapter = PersistenceDataAdapter.builder().persistenceManager(persistenceManager).switchIds(singleton(switchId)).pathIds(singleton(pathId)).build();
List<SpeakerData> speakerData = ruleManager.buildRulesForSwitch(switchId, dataAdapter);
return speakerData.stream().filter(data -> data instanceof FlowSpeakerData).map(data -> new FlowCommand((FlowSpeakerData) data)).collect(toList());
}
Aggregations