Search in sources :

Example 1 with SwitchInfoExtendedData

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);
}
Also used : SwitchInfoExtendedData(org.openkilda.messaging.info.event.SwitchInfoExtendedData) SwitchInfoData(org.openkilda.messaging.info.event.SwitchInfoData) FlowEntry(org.openkilda.messaging.info.rule.FlowEntry)

Aggregations

SwitchInfoData (org.openkilda.messaging.info.event.SwitchInfoData)1 SwitchInfoExtendedData (org.openkilda.messaging.info.event.SwitchInfoExtendedData)1 FlowEntry (org.openkilda.messaging.info.rule.FlowEntry)1