use of org.openkilda.floodlight.error.SwitchMissingMeterException in project open-kilda by telstra.
the class MeterVerifyCommand method handleMeterStats.
private MeterSchema handleMeterStats(List<OFMeterConfigStatsReply> meterStatResponses) {
Optional<OFMeterConfig> target = Optional.empty();
for (OFMeterConfigStatsReply meterConfigReply : meterStatResponses) {
target = findMeter(meterConfigReply);
if (target.isPresent()) {
break;
}
}
if (!target.isPresent()) {
throw maskCallbackException(new SwitchMissingMeterException(getSw().getId(), meterConfig.getId()));
}
boolean isInaccurate = getSwitchFeatures().contains(SwitchFeature.INACCURATE_METER);
MeterSchema schema = MeterSchemaMapper.INSTANCE.map(getSw().getId(), target.get(), isInaccurate);
validateMeterConfig(schema, isInaccurate);
return schema;
}
use of org.openkilda.floodlight.error.SwitchMissingMeterException in project open-kilda by telstra.
the class MeterInstallCommandTest method missingConflictError.
@Test
public void missingConflictError() throws Throwable {
switchFeaturesSetup(sw, true);
expectVerifyMeter(new SwitchMissingMeterException(dpIdNext, meterConfig.getId()));
replayAll();
CompletableFuture<MeterInstallReport> result = processConflictError();
verifyErrorCompletion(result, SwitchMeterConflictException.class);
}
Aggregations