コード例 #1
0
ファイル: Notification.cs プロジェクト: carlosefr/sapo-broker
 public void Read(TProtocol iprot)
 {
     TField field;
       iprot.ReadStructBegin();
       while (true)
       {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) {
       break;
     }
     switch (field.ID)
     {
       case 1:
     if (field.Type == TType.String) {
       this.destination = iprot.ReadString();
       this.__isset.destination = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.String) {
       this.subscription = iprot.ReadString();
       this.__isset.subscription = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 3:
     if (field.Type == TType.I32) {
       this.destination_type = (DestinationType)iprot.ReadI32();
       this.__isset.destination_type = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 4:
     if (field.Type == TType.Struct) {
       this.message = new BrokerMessage();
       this.message.Read(iprot);
       this.__isset.message = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       default:
     TProtocolUtil.Skip(iprot, field.Type);
     break;
     }
     iprot.ReadFieldEnd();
       }
       iprot.ReadStructEnd();
 }
コード例 #2
0
        private static BrokerMessage getBrokerMessage(NetBrokerMessage brokerMessage)
        {
            BrokerMessage brokerMsg = new BrokerMessage();
            brokerMsg.Expiration = brokerMessage.Expiration;
            brokerMsg.Message_id = brokerMessage.MessageId;
            brokerMsg.Payload = brokerMessage.Payload;
            brokerMsg.Timestamp = brokerMessage.Timestamp;

            return brokerMsg;
        }
コード例 #3
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        this.destination         = iprot.ReadString();
                        this.__isset.destination = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        this.subscription         = iprot.ReadString();
                        this.__isset.subscription = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        this.destination_type         = (DestinationType)iprot.ReadI32();
                        this.__isset.destination_type = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Struct)
                    {
                        this.message = new BrokerMessage();
                        this.message.Read(iprot);
                        this.__isset.message = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
コード例 #4
0
 private static NetBrokerMessage getBrokerMessage(BrokerMessage brokerMessage)
 {
     NetBrokerMessage netBrokerMessage = new NetBrokerMessage(brokerMessage.Payload);
     netBrokerMessage.Expiration = brokerMessage.Expiration;
     netBrokerMessage.MessageId = brokerMessage.Message_id;
     netBrokerMessage.Timestamp = brokerMessage.Timestamp;
     return netBrokerMessage;
 }