Beispiel #1
0
 public override IMessageHeaderExtension DecodeMessageHeaderExtension(IAvroDecoder decoder)
 {
     return(null);
 }
Beispiel #2
0
 T IAvroResponder.ReadRequest <T>(IAvroDecoder decoder, string message)
 {
     return(_protocolPair.RequestReaders[message].Read(decoder) as T);
 }
 public T ReadError <T>(IAvroDecoder decoder, string message) where T : class
 {
     return(_protocolPair.ErrorReaders[message].Read(decoder) as T);
 }
Beispiel #4
0
 public override IMessageHeader DecodeMessageHeader(IAvroDecoder decoder)
 {
     return(decoder.DecodeAvroObject <MessageHeader>());
 }
Beispiel #5
0
        /// <summary>
        /// Decodes the message.
        /// </summary>
        /// <param name="header">The message header</param>
        /// <param name="extension">The header extension</param>
        /// <param name="decoder">The decoder with binary message data.</param>
        /// <returns>The message if successful; <c>null</c> otherwise.</returns>
        public EtpMessage DecodeMessage(IMessageHeader header, IMessageHeaderExtension extension, IAvroDecoder decoder)
        {
            var messageKey = EtpExtensions.CreateMessageKey(header.Protocol, header.MessageType);

            Func <IAvroDecoder, IMessageHeader, IMessageHeaderExtension, EtpMessage> messageDecoder;

            if (!MessageDecoders.TryGetValue(messageKey, out messageDecoder))
            {
                return(null);
            }

            return(messageDecoder(decoder, header, extension));
        }
 public T ReadResponse <T>(IAvroDecoder decoder, string message) where T : class
 {
     return(_protocolPair.ResponseReaders[message].Read(decoder) as T);
 }
Beispiel #7
0
 /// <summary>
 /// Decode the binary message header.
 /// </summary>
 /// <param name="decoder">The decoder with the binary data.</param>
 /// <returns>The decoded message header.</returns>
 public abstract IMessageHeader DecodeMessageHeader(IAvroDecoder decoder);
Beispiel #8
0
 /// <summary>
 /// Decode the binary message header extension.
 /// </summary>
 /// <param name="decoder">The decoder with the binary data.</param>
 /// <returns>The decoded message header extension.</returns>
 public abstract IMessageHeaderExtension DecodeMessageHeaderExtension(IAvroDecoder decoder);
Beispiel #9
0
 void IAvroObject.Decode(IAvroDecoder decoder)
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
 public void Skip(IAvroDecoder stream) => _skipper.Invoke(stream);
Beispiel #11
0
 public T Read(IAvroDecoder stream, ref T reuse) => reuse = _reader.Invoke(stream);
Beispiel #12
0
 public T Read(IAvroDecoder stream) => _reader.Invoke(stream);
Beispiel #13
0
 public override IMessageHeaderExtension DecodeMessageHeaderExtension(IAvroDecoder decoder)
 {
     return(decoder.DecodeAvroObject <MessageHeaderExtension>());
 }