Search in sources :

Example 1 with MeterMisconfiguredInfoEntry

use of org.openkilda.messaging.info.switches.MeterMisconfiguredInfoEntry in project open-kilda by telstra.

the class ValidationServiceImpl method makeMisconfiguredMeterEntry.

private MeterInfoEntry makeMisconfiguredMeterEntry(MeterInfoEntry actualMeter, MeterInfoEntry expectedMeter, boolean isESwitch) {
    MeterMisconfiguredInfoEntry actual = new MeterMisconfiguredInfoEntry();
    MeterMisconfiguredInfoEntry expected = new MeterMisconfiguredInfoEntry();
    if (!Meter.equalsRate(actualMeter.getRate(), expectedMeter.getRate(), isESwitch)) {
        actual.setRate(actualMeter.getRate());
        expected.setRate(expectedMeter.getRate());
    }
    if (!Meter.equalsBurstSize(actualMeter.getBurstSize(), expectedMeter.getBurstSize(), isESwitch)) {
        actual.setBurstSize(actualMeter.getBurstSize());
        expected.setBurstSize(expectedMeter.getBurstSize());
    }
    if (!Sets.newHashSet(actualMeter.getFlags()).equals(Sets.newHashSet(expectedMeter.getFlags()))) {
        actual.setFlags(actualMeter.getFlags());
        expected.setFlags(expectedMeter.getFlags());
    }
    return MeterInfoEntry.builder().meterId(actualMeter.getMeterId()).cookie(expectedMeter.getCookie()).flowId(expectedMeter.getFlowId()).rate(actualMeter.getRate()).burstSize(actualMeter.getBurstSize()).flags(actualMeter.getFlags()).actual(actual).expected(expected).build();
}
Also used : MeterMisconfiguredInfoEntry(org.openkilda.messaging.info.switches.MeterMisconfiguredInfoEntry)

Aggregations

MeterMisconfiguredInfoEntry (org.openkilda.messaging.info.switches.MeterMisconfiguredInfoEntry)1