use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializeMeterConfigBody.
private static void serializeMeterConfigBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestMeterConfigCase meterConfigCase = (MultipartRequestMeterConfigCase) multipartRequestBody;
MultipartRequestMeterConfig meterConfig = meterConfigCase.getMultipartRequestMeterConfig();
output.writeInt(meterConfig.getMeterId().getValue().intValue());
output.writeZero(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method createRequestMeterConfig.
private static MultipartRequestMeterConfigCase createRequestMeterConfig() {
MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
builder.setMeterId(new MeterId(1133L));
caseBuilder.setMultipartRequestMeterConfig(builder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method decodeRequestMeterConfig.
private static MultipartRequestMeterConfigCase decodeRequestMeterConfig(ByteBuf output) {
MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
builder.setMeterId(new MeterId(output.readUnsignedInt()));
output.skipBytes(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY);
caseBuilder.setMultipartRequestMeterConfig(builder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase in project openflowplugin by opendaylight.
the class MultipartRequestMeterConfigInputMessageFactoryTest method createRequestMeterConfig.
private static MultipartRequestMeterConfigCase createRequestMeterConfig() {
MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
builder.setMeterId(new MeterId(1133L));
caseBuilder.setMultipartRequestMeterConfig(builder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeterConfig.
@Test
public void testMakeMultipartRequestInputMeterConfig() throws Exception {
final MultipartType mpType = MultipartType.OFPMPMETERCONFIG;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterConfigCase);
MultipartRequestMeterConfig mpRq = ((MultipartRequestMeterConfigCase) mpRqBody).getMultipartRequestMeterConfig();
Assert.assertEquals(OFConstants.OFPM_ALL, mpRq.getMeterId().getValue());
}
Aggregations