コード例 #1
0
        public byte[] Encode(NamingLookupRequest obj)
        {
            var request = new AvroNamingLookupRequest {
                ids = obj.Identifiers
            };

            return(AvroUtils.AvroSerialize(request));
        }
コード例 #2
0
        public byte[] Encode(NamingUnregisterRequest obj)
        {
            AvroNamingUnRegisterRequest request = new AvroNamingUnRegisterRequest {
                id = obj.Identifier
            };

            return(AvroUtils.AvroSerialize(request));
        }
コード例 #3
0
        public byte[] Encode(NamingRegisterRequest obj)
        {
            AvroNamingRegisterRequest request = new AvroNamingRegisterRequest
            {
                id   = obj.NameAssignment.Identifier,
                host = obj.NameAssignment.Endpoint.Address.ToString(),
                port = obj.NameAssignment.Endpoint.Port
            };

            return(AvroUtils.AvroSerialize(request));
        }
コード例 #4
0
        public byte[] Encode(NamingLookupResponse obj)
        {
            List <AvroNamingAssignment> tuples = obj.NameAssignments
                                                 .Select(assignment => new AvroNamingAssignment()
            {
                id   = assignment.Identifier,
                host = assignment.Endpoint.Address.ToString(),
                port = assignment.Endpoint.Port
            }).ToList();

            AvroNamingLookupResponse response = new AvroNamingLookupResponse {
                tuples = tuples
            };

            return(AvroUtils.AvroSerialize(response));
        }