Search in sources :

Example 1 with GetQueueConfigInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder in project openflowplugin by opendaylight.

the class OF10GetQueueConfigInputMessageFactory method deserialize.

@Override
public GetQueueConfigInput deserialize(ByteBuf rawMessage) {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
    builder.setXid(rawMessage.readUnsignedInt());
    builder.setPort(new PortNumber((long) rawMessage.readUnsignedShort()));
    return builder.build();
}
Also used : GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 2 with GetQueueConfigInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder in project openflowplugin by opendaylight.

the class GetQueueConfigInputMessageFactoryTest method testGetQueueConfigInputMessage.

/**
 * Testing of {@link GetQueueConfigInputMessageFactory} for correct translation from POJO.
 */
@Test
public void testGetQueueConfigInputMessage() throws Exception {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
    builder.setPort(new PortNumber(0x00010203L));
    GetQueueConfigInput message = builder.build();
    ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
    getQueueFactory.serialize(message, out);
    BufferHelper.checkHeaderV13(out, GET_QUEUE_CONFIG_INPUT_MESSAGE_CODE_TYPE, 16);
    Assert.assertEquals("Wrong port", 0x00010203, out.readUnsignedInt());
    out.skipBytes(PADDING_IN_QUEUE_CONFIG_INPUT_MESSAGE);
}
Also used : GetQueueConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput) GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 3 with GetQueueConfigInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder in project openflowplugin by opendaylight.

the class GetQueueConfigInputMessageFactory method deserialize.

@Override
public GetQueueConfigInput deserialize(ByteBuf rawMessage) {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
    builder.setXid(rawMessage.readUnsignedInt());
    builder.setPort(new PortNumber(rawMessage.readUnsignedInt()));
    return builder.build();
}
Also used : GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 4 with GetQueueConfigInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder in project openflowplugin by opendaylight.

the class OF10QueueGetConfigInputMessageFactoryTest method test.

/**
 * Testing of {@link OF10QueueGetConfigInputMessageFactory} for correct translation from POJO.
 */
@Test
public void test() throws Exception {
    GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
    builder.setPort(new PortNumber(6653L));
    GetQueueConfigInput message = builder.build();
    ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
    queueFactory.serialize(message, out);
    BufferHelper.checkHeaderV10(out, (byte) 20, 12);
    Assert.assertEquals("Wrong port", 6653L, out.readUnsignedShort());
    out.skipBytes(2);
}
Also used : GetQueueConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput) GetQueueConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)4 GetQueueConfigInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder)4 ByteBuf (io.netty.buffer.ByteBuf)2 Test (org.junit.Test)2 GetQueueConfigInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput)2