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);
                }
            }
        }
        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);
                }
            }
        }
Example #3
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);
                }
            }
        }
Example #4
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);
                }
            }
        }