use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterCapability in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtil method translateMeterFeatures.
private static org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.multipart.reply.multipart.reply.body.MultipartReplyMeterFeatures translateMeterFeatures(final MultipartReply msg) {
MultipartReplyMeterFeaturesBuilder message = new MultipartReplyMeterFeaturesBuilder();
MultipartReplyMeterFeaturesCase caseBody = (MultipartReplyMeterFeaturesCase) msg.getMultipartReplyBody();
MultipartReplyMeterFeatures replyBody = caseBody.getMultipartReplyMeterFeatures();
message.setMaxBands(replyBody.getMaxBands());
message.setMaxColor(replyBody.getMaxColor());
message.setMaxMeter(new Counter32(replyBody.getMaxMeter()));
List<Class<? extends MeterCapability>> supportedCapabilities = new ArrayList<>();
if (replyBody.getCapabilities().isOFPMFBURST()) {
supportedCapabilities.add(MeterBurst.class);
}
if (replyBody.getCapabilities().isOFPMFKBPS()) {
supportedCapabilities.add(MeterKbps.class);
}
if (replyBody.getCapabilities().isOFPMFPKTPS()) {
supportedCapabilities.add(MeterPktps.class);
}
if (replyBody.getCapabilities().isOFPMFSTATS()) {
supportedCapabilities.add(MeterStats.class);
}
message.setMeterCapabilitiesSupported(supportedCapabilities);
List<Class<? extends MeterBand>> supportedMeterBand = new ArrayList<>();
if (replyBody.getBandTypes().isOFPMBTDROP()) {
supportedMeterBand.add(MeterBandDrop.class);
}
if (replyBody.getBandTypes().isOFPMBTDSCPREMARK()) {
supportedMeterBand.add(MeterBandDscpRemark.class);
}
message.setMeterBandSupported(supportedMeterBand);
return message.build();
}
Aggregations