use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdatedBuilder in project openflowplugin by opendaylight.
the class MeterFeaturesService method transformToNotification.
@Override
public MeterFeaturesUpdated transformToNotification(List<MultipartReply> result, TransactionId emulatedTxId) {
final int mpSize = result.size();
Preconditions.checkArgument(mpSize == 1, "unexpected (!=1) mp-reply size received: {}", mpSize);
MeterFeaturesUpdatedBuilder notification = new MeterFeaturesUpdatedBuilder();
notification.setId(getDeviceInfo().getNodeId());
notification.setMoreReplies(Boolean.FALSE);
notification.setTransactionId(emulatedTxId);
MultipartReplyMeterFeaturesCase caseBody = (MultipartReplyMeterFeaturesCase) result.get(0).getMultipartReplyBody();
MultipartReplyMeterFeatures replyBody = caseBody.getMultipartReplyMeterFeatures();
notification.setMaxBands(replyBody.getMaxBands());
notification.setMaxColor(replyBody.getMaxColor());
notification.setMaxMeter(new Counter32(replyBody.getMaxMeter()));
notification.setMeterCapabilitiesSupported(extractMeterCapabilities(replyBody.getCapabilities()));
notification.setMeterBandSupported(extractSupportedMeterBand(replyBody, replyBody.getBandTypes()));
return notification.build();
}
Aggregations