Search in sources :

Example 1 with MultipartRequestExperimenter

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);
}
Also used : MultipartRequestExperimenter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.experimenter._case.MultipartRequestExperimenter) ExperimenterDataOfChoice(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice) MultipartRequestExperimenterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCase)

Example 2 with MultipartRequestExperimenter

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);
}
Also used : MultipartRequestExperimenter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.experimenter._case.MultipartRequestExperimenter) ExperimenterDataOfChoice(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice) MultipartRequestExperimenterCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCase)

Example 3 with MultipartRequestExperimenter

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());
}
Also used : SendExperimenterMpRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput) SendExperimenterMpRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder) MultipartRequestExperimenter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) Test(org.junit.Test)

Aggregations

ExperimenterDataOfChoice (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice)2 MultipartRequestExperimenterCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCase)2 MultipartRequestExperimenter (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.experimenter._case.MultipartRequestExperimenter)2 Test (org.junit.Test)1 SendExperimenterMpRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput)1 SendExperimenterMpRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder)1 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)1 MultipartRequestExperimenter (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter)1