use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundlePropertyType in project openflowplugin by opendaylight.
the class BundleControlFactory method createBundleProperties.
private List<BundleProperty> createBundleProperties(final ByteBuf message) {
List<BundleProperty> properties = new ArrayList<>();
while (message.readableBytes() > 0) {
BundlePropertyType type = BundlePropertyType.forValue(message.readUnsignedShort());
int length = message.readUnsignedShort();
if (type != null && type.equals(BundlePropertyType.ONFETBPTEXPERIMENTER)) {
properties.add(createExperimenterBundleProperty(length, message));
} else {
message.skipBytes(length);
}
}
return properties;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundlePropertyType in project openflowplugin by opendaylight.
the class AbstractBundleMessageFactory method writeBundleProperties.
void writeBundleProperties(final List<BundleProperty> properties, final ByteBuf outBuffer) {
for (BundleProperty property : properties) {
BundlePropertyType type = property.getType();
if (type != null && type.equals(BundlePropertyType.ONFETBPTEXPERIMENTER)) {
final int startIndex = outBuffer.writerIndex();
outBuffer.writeShort(type.getIntValue());
int lengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
writeBundleExperimenterProperty((BundlePropertyExperimenter) property.getBundlePropertyEntry(), outBuffer);
outBuffer.setShort(lengthIndex, outBuffer.writerIndex() - startIndex);
} else {
LOG.warn("Trying to serialize unknown bundle property (type: {}), skipping", type != null ? type.getIntValue() : 0);
}
}
}
Aggregations