use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method serializeExperimenterBody.
private void serializeExperimenterBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
MultipartRequestExperimenterCase expCase = (MultipartRequestExperimenterCase) multipartRequestBody;
MultipartRequestExperimenter experimenter = expCase.getMultipartRequestExperimenter();
final long expId = experimenter.getExperimenter().getValue().longValue();
// write experimenterId
output.writeInt((int) expId);
OFSerializer<ExperimenterDataOfChoice> serializer = registry.getSerializer(ExperimenterSerializerKeyFactory.createMultipartRequestSerializerKey(EncodeConstants.OF10_VERSION_ID, expId, -1));
serializer.serialize(experimenter.getExperimenterDataOfChoice(), output);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter in project openflowplugin by opendaylight.
the class MultipartRequestInputFactory method serializeExperimenterBody.
private void serializeExperimenterBody(final MultipartRequestInput message, final ByteBuf outBuffer) {
MultipartRequestExperimenterCase expCase = (MultipartRequestExperimenterCase) message.getMultipartRequestBody();
MultipartRequestExperimenter experimenter = expCase.getMultipartRequestExperimenter();
final long expId = experimenter.getExperimenter().getValue().longValue();
final long expType = experimenter.getExpType().longValue();
// write experimenterId and type
outBuffer.writeInt((int) expId);
outBuffer.writeInt((int) expType);
// serialize experimenter data
OFSerializer<ExperimenterDataOfChoice> serializer = registry.getSerializer(ExperimenterSerializerKeyFactory.createMultipartRequestSerializerKey(EncodeConstants.OF13_VERSION_ID, expId, expType));
serializer.serialize(experimenter.getExperimenterDataOfChoice(), outBuffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter in project openflowplugin by opendaylight.
the class SingleLayerExperimenterMultipartServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final SendExperimenterMpRequestInput input = new SendExperimenterMpRequestInputBuilder().setExperimenterMessageOfChoice(mockExperimenter()).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(MultipartRequest.class, ofHeader.getImplementedInterface());
final MultipartRequestExperimenter result = MultipartRequestExperimenter.class.cast(MultipartRequest.class.cast(ofHeader).getMultipartRequestBody());
assertEquals(DummyExperimenter.class, result.getExperimenterMessageOfChoice().getImplementedInterface());
}
Aggregations