use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput in project openflowplugin by opendaylight.
the class FlowModInputMessageFactory method deserialize.
@Override
// FB doesn't recognize Objects.requireNonNull
@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public FlowModInput deserialize(ByteBuf rawMessage) {
Objects.requireNonNull(registry);
FlowModInputBuilder builder = new FlowModInputBuilder();
builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
rawMessage.readBytes(cookie);
builder.setCookie(new BigInteger(1, cookie));
final byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
rawMessage.readBytes(cookieMask);
builder.setCookieMask(new BigInteger(1, cookieMask));
builder.setTableId(new TableId((long) rawMessage.readUnsignedByte()));
builder.setCommand(FlowModCommand.forValue(rawMessage.readUnsignedByte()));
builder.setIdleTimeout(rawMessage.readUnsignedShort());
builder.setHardTimeout(rawMessage.readUnsignedShort());
builder.setPriority(rawMessage.readUnsignedShort());
builder.setBufferId(rawMessage.readUnsignedInt());
builder.setOutPort(new PortNumber(rawMessage.readUnsignedInt()));
builder.setOutGroup(rawMessage.readUnsignedInt());
builder.setFlags(createFlowModFlagsFromBitmap(rawMessage.readUnsignedShort()));
rawMessage.skipBytes(PADDING);
OFDeserializer<Match> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, EncodeConstants.EMPTY_VALUE, Match.class));
builder.setMatch(matchDeserializer.deserialize(rawMessage));
CodeKeyMaker keyMaker = CodeKeyMakerFactory.createInstructionsKeyMaker(EncodeConstants.OF13_VERSION_ID);
List<Instruction> instructions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, rawMessage.readableBytes(), rawMessage, keyMaker, registry);
builder.setInstruction(instructions);
return builder.build();
}
Aggregations