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);
                }
            }
        }
Ejemplo n.º 2
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);
                }
            }
        }