public byte[] Encode(NamingLookupRequest obj) { var request = new AvroNamingLookupRequest { ids = obj.Identifiers }; return(AvroUtils.AvroSerialize(request)); }
public byte[] Encode(NamingUnregisterRequest obj) { AvroNamingUnRegisterRequest request = new AvroNamingUnRegisterRequest { id = obj.Identifier }; return(AvroUtils.AvroSerialize(request)); }
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)); }
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)); }