use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder in project openflowplugin by opendaylight.
the class OF10QueueGetConfigReplyMessageFactory method createPropertiesList.
private static List<QueueProperty> createPropertiesList(ByteBuf input, int length) {
int propertiesLength = length;
List<QueueProperty> propertiesList = new ArrayList<>();
while (propertiesLength > 0) {
QueuePropertyBuilder propertiesBuilder = new QueuePropertyBuilder();
QueueProperties property = QueueProperties.forValue(input.readUnsignedShort());
propertiesBuilder.setProperty(property);
propertiesLength -= input.readUnsignedShort();
input.skipBytes(PADDING_IN_QUEUE_PROPERTY_HEADER);
if (property.equals(QueueProperties.OFPQTMINRATE)) {
RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
rateBuilder.setRate(input.readUnsignedShort());
propertiesBuilder.addAugmentation(RateQueueProperty.class, rateBuilder.build());
input.skipBytes(PADDING_IN_RATE_QUEUE_PROPERTY);
}
propertiesList.add(propertiesBuilder.build());
}
return propertiesList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder in project openflowplugin by opendaylight.
the class QueueGetConfigReplyMessageFactory method createPropertiesList.
private List<QueueProperty> createPropertiesList(ByteBuf input, int length) {
int propertiesLength = length;
List<QueueProperty> propertiesList = new ArrayList<>();
while (propertiesLength > 0) {
int propertyStartIndex = input.readerIndex();
QueuePropertyBuilder propertiesBuilder = new QueuePropertyBuilder();
QueueProperties property = QueueProperties.forValue(input.readUnsignedShort());
propertiesBuilder.setProperty(property);
int currentPropertyLength = input.readUnsignedShort();
propertiesLength -= currentPropertyLength;
input.skipBytes(PADDING_IN_QUEUE_PROPERTY_HEADER);
if (property.equals(QueueProperties.OFPQTMINRATE) || property.equals(QueueProperties.OFPQTMAXRATE)) {
RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
rateBuilder.setRate(input.readUnsignedShort());
propertiesBuilder.addAugmentation(RateQueueProperty.class, rateBuilder.build());
input.skipBytes(PADDING_IN_RATE_QUEUE_PROPERTY);
} else if (property.equals(QueueProperties.OFPQTEXPERIMENTER)) {
long expId = input.readUnsignedInt();
input.readerIndex(propertyStartIndex);
OFDeserializer<QueueProperty> deserializer = registry.getDeserializer(ExperimenterDeserializerKeyFactory.createQueuePropertyDeserializerKey(EncodeConstants.OF13_VERSION_ID, expId));
propertiesList.add(deserializer.deserialize(input));
continue;
}
propertiesList.add(propertiesBuilder.build());
}
return propertiesList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder in project openflowplugin by opendaylight.
the class QueueGetConfigReplyMessageFactoryTest method createPropertiesList.
private static List<QueueProperty> createPropertiesList() {
final List<QueueProperty> propertiesList = new ArrayList<>();
QueuePropertyBuilder pb = new QueuePropertyBuilder();
pb.setProperty(QueueProperties.forValue(2));
RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
rateBuilder.setRate(5);
pb.addAugmentation(RateQueueProperty.class, rateBuilder.build());
propertiesList.add(pb.build());
return propertiesList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder in project openflowplugin by opendaylight.
the class QueueGetConfigReplyMessageFactoryTest method createPropertiesList.
private static List<QueueProperty> createPropertiesList() {
final List<QueueProperty> propertiesList = new ArrayList<>();
QueuePropertyBuilder pb = new QueuePropertyBuilder();
pb.setProperty(QueueProperties.forValue(2));
RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
rateBuilder.setRate(5);
pb.addAugmentation(RateQueueProperty.class, rateBuilder.build());
propertiesList.add(pb.build());
return propertiesList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder in project openflowplugin by opendaylight.
the class QueueGetConfigReplyMessageFactoryMultiTest method createPropertiesList.
private static List<QueueProperty> createPropertiesList() {
final List<QueueProperty> propertiesList = new ArrayList<>();
QueuePropertyBuilder pb = new QueuePropertyBuilder();
pb.setProperty(QueueProperties.forValue(2));
RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
rateBuilder.setRate(5);
pb.addAugmentation(RateQueueProperty.class, rateBuilder.build());
propertiesList.add(pb.build());
return propertiesList;
}
Aggregations