Search in sources :

Example 1 with MeterFeaturesUpdatedBuilder

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();
}
Also used : Counter32(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32) MultipartReplyMeterFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeatures) MeterFeaturesUpdatedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdatedBuilder) MultipartReplyMeterFeaturesCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyMeterFeaturesCase)

Aggregations

Counter32 (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32)1 MeterFeaturesUpdatedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdatedBuilder)1 MultipartReplyMeterFeaturesCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyMeterFeaturesCase)1 MultipartReplyMeterFeatures (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeatures)1