Search in sources :

Example 1 with QueuesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder in project openflowplugin by opendaylight.

the class QueueGetConfigReplyMessageFactoryTest method createQueuesList.

private static List<Queues> createQueuesList() {
    final List<Queues> queuesList = new ArrayList<>();
    QueuesBuilder qb = new QueuesBuilder();
    qb.setQueueId(new QueueId(1L));
    qb.setPort(new PortNumber(3L));
    qb.setQueueProperty(createPropertiesList());
    queuesList.add(qb.build());
    return queuesList;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Example 2 with QueuesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder in project openflowplugin by opendaylight.

the class QueueGetConfigReplyMessageFactory method createQueuesList.

private List<Queues> createQueuesList(ByteBuf input) {
    List<Queues> queuesList = new ArrayList<>();
    while (input.readableBytes() > 0) {
        QueuesBuilder queueBuilder = new QueuesBuilder();
        queueBuilder.setQueueId(new QueueId(input.readUnsignedInt()));
        queueBuilder.setPort(new PortNumber(input.readUnsignedInt()));
        int length = input.readUnsignedShort();
        input.skipBytes(PADDING_IN_PACKET_QUEUE_HEADER);
        queueBuilder.setQueueProperty(createPropertiesList(input, length - PACKET_QUEUE_LENGTH));
        queuesList.add(queueBuilder.build());
    }
    return queuesList;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Example 3 with QueuesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder in project openflowplugin by opendaylight.

the class QueueGetConfigReplyMessageFactoryTest method createQueuesList.

private static List<Queues> createQueuesList() {
    List<Queues> queuesList = new ArrayList<>();
    for (int i = 1; i < 3; i++) {
        QueuesBuilder qb = new QueuesBuilder();
        qb.setQueueId(new QueueId((long) i));
        qb.setPort(new PortNumber((long) i));
        qb.setQueueProperty(createPropertiesList());
        queuesList.add(qb.build());
    }
    return queuesList;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Example 4 with QueuesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder in project openflowplugin by opendaylight.

the class OF10QueueGetConfigReplyMessageFactory method createQueuesList.

private static List<Queues> createQueuesList(ByteBuf input) {
    List<Queues> queuesList = new ArrayList<>();
    while (input.readableBytes() > 0) {
        QueuesBuilder queueBuilder = new QueuesBuilder();
        queueBuilder.setQueueId(new QueueId(input.readUnsignedInt()));
        int length = input.readUnsignedShort();
        input.skipBytes(PADDING_IN_PACKET_QUEUE_HEADER);
        queueBuilder.setQueueProperty(createPropertiesList(input, length - PACKET_QUEUE_HEADER_LENGTH));
        queuesList.add(queueBuilder.build());
    }
    return queuesList;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Example 5 with QueuesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder in project openflowplugin by opendaylight.

the class QueueGetConfigReplyMessageFactoryMultiTest method createQueuesList.

private static List<Queues> createQueuesList() {
    List<Queues> queuesList = new ArrayList<>();
    for (int i = 1; i < 3; i++) {
        QueuesBuilder qb = new QueuesBuilder();
        qb.setQueueId(new QueueId((long) i));
        qb.setPort(new PortNumber((long) i));
        qb.setQueueProperty(createPropertiesList());
        queuesList.add(qb.build());
    }
    return queuesList;
}
Also used : ArrayList(java.util.ArrayList) QueueId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId) Queues(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) QueuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)

Aggregations

ArrayList (java.util.ArrayList)6 QueueId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId)6 Queues (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues)6 QueuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder)6 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)4