use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterFlags in project openflowplugin by opendaylight.
the class MeterMessageSerializer method serialize.
@Override
public void serialize(final MeterMessage message, final ByteBuf outBuffer) {
final int index = outBuffer.writerIndex();
super.serialize(message, outBuffer);
outBuffer.writeShort(message.getCommand().getIntValue());
outBuffer.writeShort(createMeterFlagsBitMask(MoreObjects.firstNonNull(message.getFlags(), new MeterFlags(false, false, true, false))));
outBuffer.writeInt(message.getMeterId().getValue().intValue());
serializeBands(message.getMeterBandHeaders(), outBuffer);
outBuffer.setShort(index + 2, outBuffer.writerIndex() - index);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterFlags in project openflowplugin by opendaylight.
the class MultipartReplyTranslatorUtilTest method translateMeterFeatures.
@Test
public void translateMeterFeatures() {
final MultipartReply multipartReply = buildReply(MultipartType.OFPMPMETERFEATURES, new MultipartReplyMeterFeaturesCaseBuilder().setMultipartReplyMeterFeatures(new MultipartReplyMeterFeaturesBuilder().setMaxMeter(10L).setCapabilities(new MeterFlags(true, false, false, false)).setBandTypes(new MeterBandTypeBitmap(true, false)).build()).build());
dummyAssertReply(multipartReply);
}
Aggregations