Exemplo n.º 1
0
        public MessageSubscribe(String Queue, String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, String ResumeId, long ResumeTtl, Dictionary <String, Object> Arguments, params Option[] options)
        {
            SetQueue(Queue);
            SetDestination(Destination);
            SetAcceptMode(AcceptMode);
            SetAcquireMode(AcquireMode);
            SetResumeId(ResumeId);
            SetResumeTtl(ResumeTtl);
            SetArguments(Arguments);

            for (int i = 0; i < options.Length; i++)
            {
                switch (options[i])
                {
                case Option.EXCLUSIVE: packing_flags |= 4096; break;

                case Option.SYNC: Sync = true; break;

                case Option.BATCH: Batch = true; break;

                case Option.NONE: break;

                default: throw new Exception("invalid option: " + options[i]);
                }
            }
        }
Exemplo n.º 2
0
 public MessageSubscribe SetAcceptMode(MessageAcceptMode value)
 {
     _AcceptMode    = value;
     packing_flags |= 1024;
     Dirty          = true;
     return(this);
 }
Exemplo n.º 3
0
 public override void Read(IDecoder dec)
 {
     packing_flags = (int)dec.ReadUint16();
     if ((packing_flags & 256) != 0)
     {
         _Queue = dec.ReadStr8();
     }
     if ((packing_flags & 512) != 0)
     {
         _Destination = dec.ReadStr8();
     }
     if ((packing_flags & 1024) != 0)
     {
         _AcceptMode = MessageAcceptModeGetter.Get(dec.ReadUint8());
     }
     if ((packing_flags & 2048) != 0)
     {
         _AcquireMode = MessageAcquireModeGetter.Get(dec.ReadUint8());
     }
     if ((packing_flags & 8192) != 0)
     {
         _ResumeId = dec.ReadStr16();
     }
     if ((packing_flags & 16384) != 0)
     {
         _ResumeTtl = dec.ReadUint64();
     }
     if ((packing_flags & 32768) != 0)
     {
         _Arguments = dec.ReadMap();
     }
 }
Exemplo n.º 4
0
 public MessageTransfer SetAcceptMode(MessageAcceptMode value)
 {
     _AcceptMode    = value;
     packing_flags |= 512;
     Dirty          = true;
     return(this);
 }
Exemplo n.º 5
0
 public void MessageTransfer(String destination,
                             MessageAcceptMode acceptMode,
                             MessageAcquireMode acquireMode,
                             Header header,
                             String body,
                             params Option[] options)
 {
     MessageTransfer(destination, acceptMode, acquireMode, header,
                     new MemoryStream(Convert.ToByte(body)), options);
 }
Exemplo n.º 6
0
        public void MessageTransfer(String destination,
                                    MessageAcceptMode acceptMode,
                                    MessageAcquireMode acquireMode,
                                    Header header,
                                    byte[] body,
                                    params Option[] options)
        {
            MemoryStream mbody = new MemoryStream();

            mbody.Write(body, 0, body.Length);
            MessageTransfer(destination, acceptMode, acquireMode, header,
                            mbody, options);
        }
Exemplo n.º 7
0
 public override void Read(IDecoder dec)
 {
     packing_flags = (int)dec.ReadUint16();
     if ((packing_flags & 256) != 0)
     {
         _Destination = dec.ReadStr8();
     }
     if ((packing_flags & 512) != 0)
     {
         _AcceptMode = MessageAcceptModeGetter.Get(dec.ReadUint8());
     }
     if ((packing_flags & 1024) != 0)
     {
         _AcquireMode = MessageAcquireModeGetter.Get(dec.ReadUint8());
     }
 }
Exemplo n.º 8
0
        public MessageTransfer(String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, Header header, MemoryStream body, params Option[] options)
        {
            SetDestination(Destination);
            SetAcceptMode(AcceptMode);
            SetAcquireMode(AcquireMode);
            Header = header;
            Body   = body;

            for (int i = 0; i < options.Length; i++)
            {
                switch (options[i])
                {
                case Option.SYNC: Sync = true; break;

                case Option.BATCH: Batch = true; break;

                case Option.NONE: break;

                default: throw new Exception("invalid option: " + options[i]);
                }
            }
        }
Exemplo n.º 9
0
 public void MessageSubscribe(String Queue, String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, String ResumeId, long ResumeTtl, Dictionary<String,Object> Arguments, params Option[] options) {
     Invoke(new MessageSubscribe(Queue, Destination, AcceptMode, AcquireMode, ResumeId, ResumeTtl, Arguments, options));
 }
Exemplo n.º 10
0
 public void MessageTransfer(String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, Header header, MemoryStream body, params Option[] options) {
     Invoke(new MessageTransfer(Destination, AcceptMode, AcquireMode, header, body, options));
 }
Exemplo n.º 11
0
 public void MessageTransfer(String destination,
                             MessageAcceptMode acceptMode,
                             MessageAcquireMode acquireMode,
                             Header header,
                             String body,
                             params Option[] options)
 {
     MessageTransfer(destination, acceptMode, acquireMode, header,
                     new MemoryStream(Convert.ToByte(body)), options);
 }
Exemplo n.º 12
0
 public void MessageTransfer(String destination,
                             MessageAcceptMode acceptMode,
                             MessageAcquireMode acquireMode,
                             Header header,
                             byte[] body,
                             params Option[] options)
 {
     MemoryStream mbody = new MemoryStream();
     mbody.Write(body,0, body.Length);
     MessageTransfer(destination, acceptMode, acquireMode, header,
                     mbody, options);
 }
Exemplo n.º 13
0
 public void MessageSubscribe(String Queue, String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, String ResumeId, long ResumeTtl, Dictionary <String, Object> Arguments, params Option[] options)
 {
     Invoke(new MessageSubscribe(Queue, Destination, AcceptMode, AcquireMode, ResumeId, ResumeTtl, Arguments, options));
 }
Exemplo n.º 14
0
 public void MessageTransfer(String Destination, MessageAcceptMode AcceptMode, MessageAcquireMode AcquireMode, Header header, MemoryStream body, params Option[] options)
 {
     Invoke(new MessageTransfer(Destination, AcceptMode, AcquireMode, header, body, options));
 }