示例#1
0
 public void fill(TLVAmqp map)
 {
     if (!map.isNull())
     {
         _annotations = AMQPUnwrapper <Object> .unwrapMap(map);
     }
 }
 public void fill(TLVAmqp list)
 {
     if (!list.isNull())
     {
         _sequence = AMQPUnwrapper <Object> .unwrapList(list);
     }
 }
 public void fill(TLVAmqp value)
 {
     if (!value.isNull())
     {
         this._value = AMQPUnwrapper <AMQPSymbol> .unwrap(value);
     }
 }
        public void fill(TLVList list)
        {
            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _condition = (ErrorCodes)StringEnum.Parse(typeof(ErrorCodes), AMQPUnwrapper <AMQPSymbol> .unwrapSymbol(element).Value);
                }
            }

            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _description = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);
                }
            }

            if (list.getList().Count > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _info = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                }
            }
        }
示例#5
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed SASL-Challenge header: challenge can't be null");
            }

            if (size > 1)
            {
                throw new MalformedMessageException("Received malformed SASL-Challenge header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed SASL-Challenge header: challenge can't be null");
                }

                _challenge = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element);
            }
        }
示例#6
0
        public void fill(TLVList list)
        {
            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _deliveryFailed = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _undeliverableHere = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (list.getList().Count > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _messageAnnotations = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                }
            }
        }
 public void fill(TLVAmqp value)
 {
     if (!value.isNull())
     {
         _data = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(value);
     }
 }
示例#8
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed SASL-Outcome header: code can't be null");
            }

            if (size > 2)
            {
                throw new MalformedMessageException("Received malformed SASL-Outcome header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed SASL-Outcome header: code can't be null");
                }

                _outcomeCode = (OutcomeCodes)AMQPUnwrapper <AMQPSymbol> .unwrapUByte(element);
            }

            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _additionalData = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element);
                }
            }
        }
示例#9
0
 public void fill(TLVAmqp map)
 {
     if (!map.isNull())
     {
         _properties = AMQPUnwrapper <String> .unwrapMap(map);
     }
 }
 public override void fillArguments(TLVList list)
 {
     if (list.getList().Count > 0)
     {
         TLVAmqp element = list.getList()[0];
         if (!element.isNull())
         {
             _mechanisms = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
         }
     }
 }
示例#11
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed Detach header: handle can't be null");
            }

            if (size > 3)
            {
                throw new MalformedMessageException("Received malformed Detach header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Detach header: handle can't be null");
                }

                _handle = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _closed = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                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 'ERROR' - received: " + element.Code);
                    }

                    _error = new AMQPError();
                    _error.fill((TLVList)element);
                }
            }
        }
        public void addToArray(int index, TLVAmqp element)
        {
            if (_count <= index)
            {
                addElement(index, new TLVArray());
            }
            TLVAmqp array = elements[index];

            if (array.isNull())
            {
                setElement(index, new TLVArray());
            }
            ((TLVArray)elements[index]).addElement(element);
            _size += element.getLength();
            update();
        }
        public void addToMap(int index, TLVAmqp key, TLVAmqp value)
        {
            if (_count <= index)
            {
                addElement(index, new TLVMap());
            }
            TLVAmqp map = elements[index];

            if (map.isNull())
            {
                setElement(index, new TLVMap());
            }
            ((TLVMap)elements[index]).putElement(key, value);
            _size += key.getLength() + value.getLength();
            update();
        }
        public void addToList(int index, int elemIndex, TLVAmqp element)
        {
            if (_count <= index)
            {
                addElement(index, new TLVList());
            }
            TLVAmqp list = this.elements[index];

            if (list.isNull())
            {
                setElement(index, new TLVList());
            }
            ((TLVList)this.elements[index]).addElement(elemIndex, element);
            _size += element.getLength();
            update();
        }
示例#15
0
        public void fill(TLVAmqp value)
        {
            TLVList list = (TLVList)value;

            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _durable = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _priority = AMQPUnwrapper <AMQPSymbol> .unwrapUByte(element);
                }
            }
            if (list.getList().Count > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _milliseconds = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }
            if (list.getList().Count > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (!element.isNull())
                {
                    _firstAquirer = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }
            if (list.getList().Count > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _deliveryCount = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }
        }
示例#16
0
        public void fill(TLVList list)
        {
            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    AMQPType code = element.Code;
                    if (code != AMQPType.LIST_0 && code != AMQPType.LIST_8 && code != AMQPType.LIST_32)
                    {
                        throw new ArgumentException("Expected type 'ERROR' - received: " + element.Code);
                    }

                    _error = new AMQPError();
                    _error.fill((TLVList)element);
                }
            }
        }
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed SASL-Init header: mechanism can't be null");
            }

            if (size > 3)
            {
                throw new MalformedMessageException("Received malformed SASL-Init header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed SASL-Init header: mechanism can't be null");
                }

                _mechanism = AMQPUnwrapper <AMQPSymbol> .unwrapSymbol(element);
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _initialResponse = AMQPUnwrapper <AMQPSymbol> .unwrapBinary(element);
                }
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _hostName = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);
                }
            }
        }
示例#18
0
 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);
         }
     }
 }
示例#19
0
        public void fill(TLVList list)
        {
            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _address = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);
                }
            }
            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _durable = (TerminusDurability)AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }
            if (list.getList().Count > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _expiryPeriod = (TerminusExpiryPolicy)StringEnum.Parse(typeof(TerminusExpiryPolicy), AMQPUnwrapper <AMQPSymbol> .unwrapSymbol(element).Value);
                }
            }
            if (list.getList().Count > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (!element.isNull())
                {
                    _timeout = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }
            if (list.getList().Count > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _dynamic = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }
            if (list.getList().Count > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    if (_dynamic != null)
                    {
                        if (_dynamic.Value)
                        {
                            _dynamicNodeProperties = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                        }
                        else
                        {
                            throw new MalformedMessageException("Received malformed Source: dynamic-node-properties can't be specified when dynamic flag is false");
                        }
                    }
                    else
                    {
                        throw new MalformedMessageException("Received malformed Source: dynamic-node-properties can't be specified when dynamic flag is not set");
                    }
                }
            }
            if (list.getList().Count > 6)
            {
                TLVAmqp element = list.getList()[6];
                if (!element.isNull())
                {
                    _distributionMode = (DistributionMode)StringEnum.Parse(typeof(DistributionMode), AMQPUnwrapper <AMQPSymbol> .unwrapSymbol(element).Value);
                }
            }
            if (list.getList().Count > 7)
            {
                TLVAmqp element = list.getList()[7];
                if (!element.isNull())
                {
                    _filter = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                }
            }
            if (list.getList().Count > 8)
            {
                TLVAmqp element = list.getList()[8];
                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 'OUTCOME' - received: " + element.Code);
                    }

                    _defaultOutcome = AMQPFactory.getOutcome((TLVList)element);
                    _defaultOutcome.fill((TLVList)element);
                }
            }
            if (list.getList().Count > 9)
            {
                TLVAmqp element = list.getList()[9];
                if (!element.isNull())
                {
                    _outcomes = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }
            if (list.getList().Count > 10)
            {
                TLVAmqp element = list.getList()[10];
                if (!element.isNull())
                {
                    _capabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(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);
                }
            }
        }
示例#21
0
        public void fill(TLVList list)
        {
            if (list.getList().Count > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _address = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);
                }
            }

            if (list.getList().Count > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _durable = (TerminusDurability)AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (list.getList().Count > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _expiryPeriod = (TerminusExpiryPolicy)StringEnum.Parse(typeof(TerminusExpiryPolicy), AMQPUnwrapper <AMQPSymbol> .unwrapSymbol(element).Value);
                }
            }

            if (list.getList().Count > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (!element.isNull())
                {
                    _timeout = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (list.getList().Count > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _dynamic = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (list.getList().Count > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    if (_dynamic != null)
                    {
                        if (_dynamic.HasValue)
                        {
                            _dynamicNodeProperties = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                        }
                        else
                        {
                            throw new MalformedMessageException("Received malformed Target: dynamic-node-properties can't be specified when dynamic flag is false");
                        }
                    }
                    else
                    {
                        throw new MalformedMessageException("Received malformed Target: dynamic-node-properties can't be specified when dynamic flag is not set");
                    }
                }
            }

            if (list.getList().Count > 6)
            {
                TLVAmqp element = list.getList()[6];
                if (!element.isNull())
                {
                    _capabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }
        }
示例#22
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size < 4)
            {
                throw new MalformedMessageException("Received malformed Flow header: mandatory " + "fields incoming-window, next-outgoing-id and " + "outgoing-window must not be null");
            }

            if (size > 11)
            {
                throw new MalformedMessageException("Received malformed Flow header. Invalid arguments size: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _nextIncomingId = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Flow header: incoming-window can't be null");
                }

                _incomingWindow = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Flow header: next-outgoing-id can't be null");
                }

                _nextOutgoingId = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Flow header: outgoing-window can't be null");
                }
                _outgoingWindow = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }
            if (size > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _handle = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    if (_handle != null)
                    {
                        _deliveryCount = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                    }
                    else
                    {
                        throw new MalformedMessageException("Received malformed Flow header: delivery-count can't be present when handle is null");
                    }
                }
            }

            if (size > 6)
            {
                TLVAmqp element = list.getList()[6];
                if (!element.isNull())
                {
                    if (_handle != null)
                    {
                        _linkCredit = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                    }
                    else
                    {
                        throw new MalformedMessageException("Received malformed Flow header: link-credit can't be present when handle is null");
                    }
                }
            }

            if (size > 7)
            {
                TLVAmqp element = list.getList()[7];
                if (!element.isNull())
                {
                    if (_handle != null)
                    {
                        _avaliable = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                    }
                    else
                    {
                        throw new MalformedMessageException(
                                  "Received malformed Flow header: avaliable can't be present when handle is null");
                    }
                }
            }

            if (size > 8)
            {
                TLVAmqp element = list.getList()[8];
                if (!element.isNull())
                {
                    if (_handle != null)
                    {
                        _drain = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                    }
                    else
                    {
                        throw new MalformedMessageException(
                                  "Received malformed Flow header: drain can't be present when handle is null");
                    }
                }
            }

            if (size > 9)
            {
                TLVAmqp element = list.getList()[9];
                if (!element.isNull())
                {
                    _echo = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (size > 10)
            {
                TLVAmqp element = list.getList()[10];
                if (!element.isNull())
                {
                    _properties = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                }
            }
        }
示例#23
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size < 4)
            {
                throw new MalformedMessageException("Received malformed Begin header: mandatory " + "fields next-outgoing-id, incoming-window and " + "outgoing-window must not be null");
            }

            if (size > 8)
            {
                throw new MalformedMessageException("Received malformed Begin header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (!element.isNull())
                {
                    _remoteChannel = AMQPUnwrapper <AMQPSymbol> .unwrapUShort(element);
                }
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Begin header: next-outgoing-id can't be null");
                }
                _nextOutgoingId = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Begin header: incoming-window can't be null");
                }
                _incomingWindow = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Begin header: outgoing-window can't be null");
                }
                _outgoingWindow = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _handleMax = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    _offeredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 6)
            {
                TLVAmqp element = list.getList()[6];
                if (!element.isNull())
                {
                    _desiredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 7)
            {
                TLVAmqp element = list.getList()[7];
                if (!element.isNull())
                {
                    _properties = AMQPUnwrapper <AMQPSymbol> .unwrapMap(element);
                }
            }
        }
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size < 2)
            {
                throw new MalformedMessageException("Received malformed Disposition header: role and first can't be null");
            }

            if (size > 6)
            {
                throw new MalformedMessageException("Received malformed Disposition header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Disposition header: role can't be null");
                }

                Boolean role = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);

                if (role)
                {
                    _role = RoleCodes.RECEIVER;
                }
                else
                {
                    _role = RoleCodes.SENDER;
                }
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Disposition header: first can't be null");
                }

                _first = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _last = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (!element.isNull())
                {
                    _settled = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }

            if (size > 4)
            {
                TLVAmqp element = list.getList()[4];
                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 'STATE' - received: " + element.Code);
                    }

                    _state = AMQPFactory.getState((TLVList)element);
                    _state.fill((TLVList)element);
                }
            }

            if (size > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    _batchable = AMQPUnwrapper <AMQPSymbol> .unwrapBool(element);
                }
            }
        }
示例#25
0
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed Transfer header: handle can't be null");
            }

            if (size > 11)
            {
                throw new MalformedMessageException("Received malformed Transfer header. Invalid number of arguments: " + size);
            }

            if (size > 0)
            {
                TLVAmqp element = list.getList()[0];
                if (element.isNull())
                {
                    throw new MalformedMessageException("Received malformed Transfer header: handle can't be null");
                }

                _handle = AMQPUnwrapper <SectionCodes> .unwrapUInt(element);
            }

            if (size > 1)
            {
                TLVAmqp element = list.getList()[1];
                if (!element.isNull())
                {
                    _deliveryId = AMQPUnwrapper <SectionCodes> .unwrapUInt(element);
                }
            }

            if (size > 2)
            {
                TLVAmqp element = list.getList()[2];
                if (!element.isNull())
                {
                    _deliveryTag = AMQPUnwrapper <SectionCodes> .unwrapBinary(element);
                }
            }

            if (size > 3)
            {
                TLVAmqp element = list.getList()[3];
                if (!element.isNull())
                {
                    _messageFormat = new AMQPMessageFormat(AMQPUnwrapper <SectionCodes> .unwrapUInt(element));
                }
            }
            if (size > 4)
            {
                TLVAmqp element = list.getList()[4];
                if (!element.isNull())
                {
                    _settled = AMQPUnwrapper <SectionCodes> .unwrapBool(element);
                }
            }

            if (size > 5)
            {
                TLVAmqp element = list.getList()[5];
                if (!element.isNull())
                {
                    _more = AMQPUnwrapper <SectionCodes> .unwrapBool(element);
                }
            }

            if (size > 6)
            {
                TLVAmqp element = list.getList()[6];
                if (!element.isNull())
                {
                    _rcvSettleMode = (ReceiveCodes)(AMQPUnwrapper <SectionCodes> .unwrapUByte(element));
                }
            }

            if (size > 7)
            {
                TLVAmqp element = list.getList()[7];
                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 'STATE' - received: " + element.Code);
                    }

                    _state = AMQPFactory.getState((TLVList)element);
                    _state.fill((TLVList)element);
                }
            }

            if (size > 8)
            {
                TLVAmqp element = list.getList()[8];
                if (!element.isNull())
                {
                    _resume = AMQPUnwrapper <SectionCodes> .unwrapBool(element);
                }
            }

            if (size > 9)
            {
                TLVAmqp element = list.getList()[9];
                if (!element.isNull())
                {
                    _aborted = AMQPUnwrapper <SectionCodes> .unwrapBool(element);
                }
            }
            if (size > 10)
            {
                TLVAmqp element = list.getList()[10];
                if (!element.isNull())
                {
                    _batchable = AMQPUnwrapper <SectionCodes> .unwrapBool(element);
                }
            }
        }
        public override void fillArguments(TLVList list)
        {
            int size = list.getList().Count;

            if (size == 0)
            {
                throw new MalformedMessageException("Received malformed Open header: container id can't be null");
            }

            if (size > 10)
            {
                throw new MalformedMessageException("Received malformed Open header. Invalid number of arguments: " + size);
            }

            TLVAmqp element = list.getList()[0];

            if (element.isNull())
            {
                throw new MalformedMessageException("Received malformed Open header: container id can't be null");
            }

            _containerId = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);

            if (size > 1)
            {
                element = list.getList()[1];
                if (!element.isNull())
                {
                    _hostname = AMQPUnwrapper <AMQPSymbol> .unwrapString(element);
                }
            }

            if (size > 2)
            {
                element = list.getList()[2];
                if (!element.isNull())
                {
                    _maxFrameSize = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 3)
            {
                element = list.getList()[3];
                if (!element.isNull())
                {
                    _channelMax = AMQPUnwrapper <AMQPSymbol> .unwrapUShort(element);
                }
            }

            if (size > 4)
            {
                element = list.getList()[4];
                if (!element.isNull())
                {
                    _idleTimeout = AMQPUnwrapper <AMQPSymbol> .unwrapUInt(element);
                }
            }

            if (size > 5)
            {
                element = list.getList()[5];
                if (!element.isNull())
                {
                    _outgoingLocales = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 6)
            {
                element = list.getList()[6];
                if (!element.isNull())
                {
                    _incomingLocales = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 7)
            {
                element = list.getList()[7];
                if (!element.isNull())
                {
                    _offeredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 8)
            {
                element = list.getList()[8];
                if (!element.isNull())
                {
                    _desiredCapabilities = AMQPUnwrapper <AMQPSymbol> .unwrapArray(element);
                }
            }

            if (size > 9)
            {
                element = list.getList()[9];
                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);
                }
            }
        }