public void fill(TLVList list) { if (list.getList().Count > 0) { TLVAmqp element = list.getList()[0]; if (!element.isNull()) { _sectionNumber = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element); } } if (list.getList().Count > 1) { TLVAmqp element = list.getList()[1]; if (!element.isNull()) { _sectionOffset = AMQPUnwrapper <AMQPSymbol> .unwrapULong(element); } } }
public override void fillArguments(TLVList list) { int size = list.getList().Count; if (size < 3) { throw new MalformedMessageException("Received malformed Attach header: mandatory " + "fields name, handle and role must not be null"); } if (size > 14) { throw new MalformedMessageException("Received malformed Attach header. Invalid number of arguments: " + size); } if (size > 0) { TLVAmqp element = list.getList()[0]; if (element.isNull()) { throw new MalformedMessageException("Received malformed Attach header: name can't be null"); } _name = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } if (size > 1) { TLVAmqp element = list.getList()[1]; if (element.isNull()) { throw new MalformedMessageException("Received malformed Attach header: handle can't be null"); } _handle = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element); } if (size > 2) { TLVAmqp element = list.getList()[2]; if (element.isNull()) { throw new MalformedMessageException("Received malformed Attach header: role can't be null"); } Boolean value = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element); if (value) { _role = RoleCodes.RECEIVER; } else { _role = RoleCodes.SENDER; } } if (size > 3) { TLVAmqp element = list.getList()[3]; if (!element.isNull()) { _sndSettleMode = (SendCodes)AMQPUnwrapper <AMQPSymbol> .unwrapUByte(element); } } if (size > 4) { TLVAmqp element = list.getList()[4]; if (!element.isNull()) { _rcvSettleMode = (ReceiveCodes)AMQPUnwrapper <AMQPSymbol> .unwrapUByte(element); } } if (size > 5) { TLVAmqp element = list.getList()[5]; if (!element.isNull()) { AMQPType code = element.Code; if (code != AMQPType.LIST_0 && code != AMQPType.LIST_8 && code != AMQPType.LIST_32) { throw new MalformedMessageException("Expected type SOURCE - received: " + element.Code); } _source = new AMQPSource(); _source.fill((TLVList)element); } } if (size > 6) { TLVAmqp element = list.getList()[6]; if (!element.isNull()) { AMQPType code = element.Code; if (code != AMQPType.LIST_0 && code != AMQPType.LIST_8 && code != AMQPType.LIST_32) { throw new MalformedMessageException("Expected type TARGET - received: " + element.Code); } _target = new AMQPTarget(); _target.fill((TLVList)element); } } if (size > 7) { TLVAmqp unsettledMap = list.getList()[7]; if (!unsettledMap.isNull()) { _unsettled = AMQPUnwrapper <AMQPSymbol> .unwrapMap(unsettledMap); } } if (size > 8) { TLVAmqp element = list.getList()[8]; if (!element.isNull()) { _incompleteUnsettled = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element); } } if (size > 9) { TLVAmqp element = list.getList()[9]; if (!element.isNull()) { _initialDeliveryCount = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element); } else if (_role == RoleCodes.SENDER) { throw new MalformedMessageException("Received an attach header with a null initial-delivery-count"); } } if (size > 10) { TLVAmqp element = list.getList()[10]; if (!element.isNull()) { _maxMessageSize = AMQPUnwrapper <AMQPSymbol> .unwrapULong(element); } } if (size > 11) { TLVAmqp element = list.getList()[11]; if (!element.isNull()) { _offeredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element); } } if (size > 12) { TLVAmqp element = list.getList()[12]; if (!element.isNull()) { _desiredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element); } } if (size > 13) { TLVAmqp element = list.getList()[13]; if (!element.isNull()) { _properties = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element); } } }
public void fill(TLVAmqp value) { TLVList list = (TLVList)value; if (list.getList().Count > 0) { TLVAmqp element = list.getList()[0]; if (!element.isNull()) { switch (element.Code) { case AMQPType.ULONG_0: case AMQPType.SMALL_ULONG: case AMQPType.ULONG: _messageId = new LongID(AMQPUnwrapper <AMQPSymbol> .unwrapULong(element)); break; case AMQPType.STRING_8: case AMQPType.STRING_32: _messageId = new StringID(AMQPUnwrapper <AMQPSymbol> .unwrapString(element)); break; case AMQPType.BINARY_8: case AMQPType.BINARY_32: _messageId = new BinaryID(AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element)); break; case AMQPType.UUID: _messageId = new UuidID(AMQPUnwrapper <AMQPSymbol> .unwrapUuid(element)); break; default: throw new ArgumentException("Expected type 'MessageID' - received: " + element.Code); } } } if (list.getList().Count > 1) { TLVAmqp element = list.getList()[1]; if (!element.isNull()) { _userId = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element); } } if (list.getList().Count > 2) { TLVAmqp element = list.getList()[2]; if (!element.isNull()) { _to = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 3) { TLVAmqp element = list.getList()[3]; if (!element.isNull()) { _subject = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 4) { TLVAmqp element = list.getList()[4]; if (!element.isNull()) { _replyTo = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 5) { TLVAmqp element = list.getList()[5]; if (!element.isNull()) { _correlationId = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element); } } if (list.getList().Count > 6) { TLVAmqp element = list.getList()[6]; if (!element.isNull()) { _contentType = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 7) { TLVAmqp element = list.getList()[7]; if (!element.isNull()) { _contentEncoding = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 8) { TLVAmqp element = list.getList()[8]; if (!element.isNull()) { _absoluteExpiryTime = AMQPUnwrapper <AMQPSymbol> .unwrapTimestamp(element); } } if (list.getList().Count > 9) { TLVAmqp element = list.getList()[9]; if (!element.isNull()) { _creationTime = AMQPUnwrapper <AMQPSymbol> .unwrapTimestamp(element); } } if (list.getList().Count > 10) { TLVAmqp element = list.getList()[10]; if (!element.isNull()) { _groupId = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } if (list.getList().Count > 11) { TLVAmqp element = list.getList()[11]; if (!element.isNull()) { _groupSequence = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element); } } if (list.getList().Count > 12) { TLVAmqp element = list.getList()[12]; if (!element.isNull()) { _replyToGroupId = AMQPUnwrapper <AMQPSymbol> .unwrapString(element); } } }