コード例 #1
0
        public override TLVList getArguments()
        {
            TLVList list = new TLVList();

            if (_role == null)
            {
                throw new MalformedMessageException("Disposition header's role can't be null");
            }

            if (_role.Value == RoleCodes.RECEIVER)
            {
                list.addElement(0, AMQPWrapper <AMQPSymbol> .wrap(true));
            }
            else
            {
                list.addElement(0, AMQPWrapper <AMQPSymbol> .wrap(false));
            }

            if (_first == null)
            {
                throw new MalformedMessageException("Transfer header's first can't be null");
            }

            list.addElement(1, AMQPWrapper <AMQPSymbol> .wrap(_first));

            if (_last != null)
            {
                list.addElement(2, AMQPWrapper <AMQPSymbol> .wrap(_last));
            }

            if (_settled != null)
            {
                list.addElement(3, AMQPWrapper <AMQPSymbol> .wrap(_settled));
            }

            if (_state != null)
            {
                list.addElement(4, _state.getList());
            }

            if (_batchable != null)
            {
                list.addElement(5, AMQPWrapper <AMQPSymbol> .wrap(_batchable));
            }

            DescribedConstructor constructor = new DescribedConstructor(list.Code, new TLVFixed(AMQPType.SMALL_ULONG, new byte[] { (byte)_code }));

            list.Constructor = constructor;

            return(list);
        }
コード例 #2
0
        public override TLVList getArguments()
        {
            TLVList list = new TLVList();

            if (_handle == null)
            {
                throw new MalformedMessageException("Transfer header's handle can't be null");
            }

            list.addElement(0, AMQPWrapper <SectionCodes> .wrap(_handle));

            if (_deliveryId != null)
            {
                list.addElement(1, AMQPWrapper <SectionCodes> .wrap(_deliveryId));
            }

            if (_deliveryTag != null)
            {
                list.addElement(2, AMQPWrapper <SectionCodes> .wrap(_deliveryTag));
            }

            if (_messageFormat != null)
            {
                list.addElement(3, AMQPWrapper <SectionCodes> .wrap(_messageFormat.encode()));
            }

            if (_settled != null)
            {
                list.addElement(4, AMQPWrapper <SectionCodes> .wrap(_settled));
            }

            if (_more != null)
            {
                list.addElement(5, AMQPWrapper <SectionCodes> .wrap(_more));
            }

            if (_rcvSettleMode != null)
            {
                list.addElement(6, AMQPWrapper <SectionCodes> .wrap((Int32)_rcvSettleMode.Value));
            }

            if (_state != null)
            {
                list.addElement(7, _state.getList());
            }

            if (_resume != null)
            {
                list.addElement(8, AMQPWrapper <SectionCodes> .wrap(_resume));
            }

            if (_aborted != null)
            {
                list.addElement(9, AMQPWrapper <SectionCodes> .wrap(_aborted));
            }

            if (_batchable != null)
            {
                list.addElement(10, AMQPWrapper <SectionCodes> .wrap(_batchable));
            }

            DescribedConstructor constructor = new DescribedConstructor(list.Code, new TLVFixed(AMQPType.SMALL_ULONG, new byte[] { (byte)_code }));

            list.Constructor = constructor;

            return(list);
        }