コード例 #1
0
        void DeepCopy(AmqpMessage source)
        {
            if (source.header != null)
            {
                this.header               = new Header();
                this.header.Durable       = source.header.Durable;
                this.header.Priority      = source.header.Priority;
                this.header.Ttl           = source.header.Ttl;
                this.header.FirstAcquirer = source.header.FirstAcquirer;
                this.header.DeliveryCount = source.header.DeliveryCount;
            }

            if (source.deliveryAnnotations != null)
            {
                this.deliveryAnnotations = new DeliveryAnnotations();
                this.deliveryAnnotations.Map.Merge(source.deliveryAnnotations.Map);
            }

            if (source.messageAnnotations != null)
            {
                this.messageAnnotations = new MessageAnnotations();
                this.messageAnnotations.Map.Merge(source.messageAnnotations.Map);
            }

            if (source.applicationProperties != null)
            {
                this.applicationProperties = new ApplicationProperties();
                this.applicationProperties.Map.Merge(source.applicationProperties.Map);
            }

            if (source.properties != null)
            {
                this.properties                    = new Properties();
                this.properties.MessageId          = source.properties.MessageId;
                this.properties.UserId             = source.properties.UserId;
                this.properties.To                 = source.properties.To;
                this.properties.Subject            = source.properties.Subject;
                this.properties.ReplyTo            = source.properties.ReplyTo;
                this.properties.CorrelationId      = source.properties.CorrelationId;
                this.properties.ContentType        = source.properties.ContentType;
                this.properties.ContentEncoding    = source.properties.ContentEncoding;
                this.properties.AbsoluteExpiryTime = source.properties.AbsoluteExpiryTime;
                this.properties.CreationTime       = source.properties.CreationTime;
                this.properties.GroupId            = source.properties.GroupId;
                this.properties.GroupSequence      = source.properties.GroupSequence;
                this.properties.ReplyToGroupId     = source.properties.ReplyToGroupId;
            }

            if (source.footer != null)
            {
                this.footer = new Footer();
                this.footer.Map.Merge(source.footer.Map);
            }

            this.sectionFlags |= (source.sectionFlags & SectionFlag.NonBody);
        }
コード例 #2
0
 void ShadowCopy(AmqpMessage source)
 {
     this.header = source.header;
     this.deliveryAnnotations   = source.deliveryAnnotations;
     this.messageAnnotations    = source.messageAnnotations;
     this.properties            = source.properties;
     this.applicationProperties = source.applicationProperties;
     this.footer        = source.footer;
     this.sectionFlags |= (source.sectionFlags & SectionFlag.NonBody);
 }
コード例 #3
0
        public static AMQPSection getSection(IByteBuffer buf)
        {
            TLVAmqp value = TLVFactory.getTlv(buf);

            AMQPSection section = null;

            Byte         byteCode = value.Constructor.getDescriptorCode().Value;
            SectionCodes code     = (SectionCodes)byteCode;

            switch (code)
            {
            case SectionCodes.APPLICATION_PROPERTIES:
                section = new ApplicationProperties();
                break;

            case SectionCodes.DATA:
                section = new AMQPData();
                break;

            case SectionCodes.DELIVERY_ANNOTATIONS:
                section = new DeliveryAnnotations();
                break;

            case SectionCodes.FOOTER:
                section = new AMQPFooter();
                break;

            case SectionCodes.HEADER:
                section = new MessageHeader();
                break;

            case SectionCodes.MESSAGE_ANNOTATIONS:
                section = new MessageAnnotations();
                break;

            case SectionCodes.PROPERTIES:
                section = new AMQPProperties();
                break;

            case SectionCodes.SEQUENCE:
                section = new AMQPSequence();
                break;

            case SectionCodes.VALUE:
                section = new AMQPValue();
                break;

            default:
                throw new MalformedMessageException("Received header with unrecognized message section code");
            }

            section.fill(value);

            return(section);
        }
コード例 #4
0
 protected void InitDeliveryAnnotations()
 {
     if (this.deliveryAnnontations == null && this.message.DeliveryAnnotations == null)
     {
         this.deliveryAnnontations        = new DeliveryAnnotations();
         this.message.DeliveryAnnotations = this.deliveryAnnontations;
     }
     else if (this.deliveryAnnontations == null && this.message.DeliveryAnnotations != null)
     {
         this.deliveryAnnontations = this.message.DeliveryAnnotations;
     }
     else if (this.deliveryAnnontations != null && this.message.DeliveryAnnotations == null)
     {
         this.message.DeliveryAnnotations = this.deliveryAnnontations;
     }
 }
コード例 #5
0
ファイル: AmqpMessage.cs プロジェクト: tralivali1234/IL2JS
            void UpdateDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
            {
                if (deliveryAnnotations != null)
                {
                    if (this.deliveryAnnotations == null)
                    {
                        this.DeliveryAnnotations = deliveryAnnotations;
                    }
                    else
                    {
                        foreach (KeyValuePair <MapKey, object> pair in this.deliveryAnnotations.Map)
                        {
                            deliveryAnnotations.Map[pair.Key] = pair.Value;
                        }

                        this.deliveryAnnotations = deliveryAnnotations;
                    }
                }
            }