use of org.projectfloodlight.openflow.protocol.OFMeterConfigStatsRequest in project open-kilda by telstra.
the class SwitchManager method dumpMeters.
/**
* {@inheritDoc}
*/
@Override
public OFMeterConfigStatsReply dumpMeters(final DatapathId dpid) throws SwitchOperationException {
OFMeterConfigStatsReply values = null;
IOFSwitch sw = lookupSwitch(dpid);
if (sw == null) {
throw new IllegalArgumentException(String.format("Switch %s was not found", dpid.toString()));
}
OFFactory ofFactory = sw.getOFFactory();
OFMeterConfigStatsRequest meterRequest = ofFactory.buildMeterConfigStatsRequest().setMeterId(0xffffffff).build();
try {
ListenableFuture<OFMeterConfigStatsReply> future = sw.writeRequest(meterRequest);
values = future.get(5, TimeUnit.SECONDS);
} catch (ExecutionException | InterruptedException | TimeoutException e) {
logger.error("Could not get meter config stats: {}", e.getMessage());
}
return values;
}
Aggregations