Search in sources :

Example 1 with MultipartRequestDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder in project openflowplugin by opendaylight.

the class MultipartRequestInputMessageFactory method setDesc.

private MultipartRequestDescCase setDesc(ByteBuf input) {
    MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
    MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
    descBuilder.setEmpty(true);
    caseBuilder.setMultipartRequestDesc(descBuilder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder)

Example 2 with MultipartRequestDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder in project openflowplugin by opendaylight.

the class OF10StatsRequestInputFactory method setDesc.

private MultipartRequestDescCase setDesc(ByteBuf input) {
    MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
    MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
    descBuilder.setEmpty(true);
    caseBuilder.setMultipartRequestDesc(descBuilder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder)

Example 3 with MultipartRequestDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder in project openflowplugin by opendaylight.

the class MultipartRequestInputFactoryTest method createRequestDesc.

private static MultipartRequestBody createRequestDesc() {
    MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
    MultipartRequestDescBuilder builder = new MultipartRequestDescBuilder();
    caseBuilder.setMultipartRequestDesc(builder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder)

Example 4 with MultipartRequestDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder in project openflowplugin by opendaylight.

the class OF10StatsRequestInputFactoryTest method testDesc.

/**
 * Testing OF10StatsRequestInputFactory (Desc) for correct serialization.
 */
@Test
public void testDesc() throws Exception {
    MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
    builder.setType(MultipartType.OFPMPDESC);
    builder.setFlags(new MultipartRequestFlags(false));
    MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
    MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
    caseBuilder.setMultipartRequestDesc(descBuilder.build());
    builder.setMultipartRequestBody(caseBuilder.build());
    MultipartRequestInput message = builder.build();
    ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
    multipartFactory.serialize(message, out);
    BufferHelper.checkHeaderV10(out, (byte) 16, 12);
    Assert.assertEquals("Wrong type", 0, out.readUnsignedShort());
    Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort());
    Assert.assertTrue("Unread data", out.readableBytes() == 0);
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder) MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags) MultipartRequestDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder) ByteBuf(io.netty.buffer.ByteBuf) MultipartRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput) Test(org.junit.Test)

Example 5 with MultipartRequestDescBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder in project openflowplugin by opendaylight.

the class OF10StatsRequestInputDescFactoryTest method createMultipartRequestBody.

private static MultipartRequestBody createMultipartRequestBody() {
    MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
    MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
    descBuilder.setEmpty(true);
    caseBuilder.setMultipartRequestDesc(descBuilder.build());
    return caseBuilder.build();
}
Also used : MultipartRequestDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder) MultipartRequestDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder)

Aggregations

MultipartRequestDescCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder)6 MultipartRequestDescBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.desc._case.MultipartRequestDescBuilder)6 ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 MultipartRequestFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags)1 MultipartRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput)1 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)1