use of org.openkilda.messaging.info.event.SwitchInfoExtendedData in project open-kilda by telstra.
the class IOFSwitchConverter method buildSwitchInfoDataExtended.
/**
* Transforms {@link IOFSwitch} to object that is used throughout kilda in all components.
* @param sw switch data.
* @param eventType switch state.
* @param flowStats installed flows.
* @return converted switch.
*/
public static SwitchInfoExtendedData buildSwitchInfoDataExtended(IOFSwitch sw, SwitchState eventType, OFFlowStatsReply flowStats) {
SwitchInfoData switchInfoData = buildSwitchInfoData(sw, eventType);
List<FlowEntry> flows = flowStats.getEntries().stream().map(OFFlowStatsConverter::toFlowEntry).collect(Collectors.toList());
return new SwitchInfoExtendedData(switchInfoData, flows);
}
Aggregations