@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { // find matching services for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) { this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo); } if (this.isServicesDiscoveryMetaQuery()) { for (String serviceType : jmDNSImpl.getServiceTypes().keySet()) { ServiceTypeEntry typeEntry = jmDNSImpl.getServiceTypes().get(serviceType); answers.add(new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType())); } } else if (this.isReverseLookup()) { String ipValue = this.getQualifiedNameMap().get(Fields.Instance); if ((ipValue != null) && (ipValue.length() > 0)) { InetAddress address = jmDNSImpl.getLocalHost().getInetAddress(); String hostIPAddress = (address != null ? address.getHostAddress() : ""); if (ipValue.equalsIgnoreCase(hostIPAddress)) { if (this.isV4ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_A, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } if (this.isV6ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_AAAA, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } } } } else if (this.isDomainDiscoveryQuery()) { // FIXME [PJYF Nov 16 2010] We do not currently support domain discovery } }
return new HostInformation(name, type, recordClass, unique); case TYPE_PTR: return new Pointer(name, type, recordClass, unique); case TYPE_SRV: return new Service(name, type, recordClass, unique);
return new HostInformation(name, type, recordClass, unique); case TYPE_PTR: return new Pointer(name, type, recordClass, unique); case TYPE_SRV: return new Service(name, type, recordClass, unique);
return new HostInformation(name, type, recordClass, unique); case TYPE_PTR: return new Pointer(name, type, recordClass, unique); case TYPE_SRV: return new Service(name, type, recordClass, unique);
return new HostInformation(name, type, recordClass, unique); case TYPE_PTR: return new Pointer(name, type, recordClass, unique); case TYPE_SRV: return new Service(name, type, recordClass, unique);
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { // find matching services for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) { this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo); } if (this.isServicesDiscoveryMetaQuery()) { for (String serviceType : jmDNSImpl.getServiceTypes().keySet()) { ServiceTypeEntry typeEntry = jmDNSImpl.getServiceTypes().get(serviceType); answers.add(new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType())); } } else if (this.isReverseLookup()) { String ipValue = this.getQualifiedNameMap().get(Fields.Instance); if ((ipValue != null) && (ipValue.length() > 0)) { InetAddress address = jmDNSImpl.getLocalHost().getInetAddress(); String hostIPAddress = (address != null ? address.getHostAddress() : ""); if (ipValue.equalsIgnoreCase(hostIPAddress)) { if (this.isV4ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_A, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } if (this.isV6ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_AAAA, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } } } } else if (this.isDomainDiscoveryQuery()) { // FIXME [PJYF Nov 16 2010] We do not currently support domain discovery } }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { // find matching services for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) { this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo); } if (this.isServicesDiscoveryMetaQuery()) { for (final ServiceTypeEntry typeEntry : jmDNSImpl.getServiceTypes().values()) { answers.add(new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType())); } } else if (this.isReverseLookup()) { String ipValue = this.getQualifiedNameMap().get(Fields.Instance); if ((ipValue != null) && (ipValue.length() > 0)) { InetAddress address = jmDNSImpl.getLocalHost().getInetAddress(); String hostIPAddress = (address != null ? address.getHostAddress() : ""); if (ipValue.equalsIgnoreCase(hostIPAddress)) { if (this.isV4ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_A, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } if (this.isV6ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_AAAA, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } } } } else if (this.isDomainDiscoveryQuery()) { // FIXME [PJYF Nov 16 2010] We do not currently support domain discovery } }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { // find matching services for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) { this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo); } if (this.isServicesDiscoveryMetaQuery()) { for (String serviceType : jmDNSImpl.getServiceTypes().keySet()) { ServiceTypeEntry typeEntry = jmDNSImpl.getServiceTypes().get(serviceType); answers.add(new DNSRecord.Pointer("_services._dns-sd._udp.local.", DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, typeEntry.getType())); } } else if (this.isReverseLookup()) { String ipValue = this.getQualifiedNameMap().get(Fields.Instance); if ((ipValue != null) && (ipValue.length() > 0)) { InetAddress address = jmDNSImpl.getLocalHost().getInetAddress(); String hostIPAddress = (address != null ? address.getHostAddress() : ""); if (ipValue.equalsIgnoreCase(hostIPAddress)) { if (this.isV4ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_A, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } if (this.isV6ReverseLookup()) { answers.add(jmDNSImpl.getLocalHost().getDNSReverseAddressRecord(DNSRecordType.TYPE_AAAA, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL)); } } } } else if (this.isDomainDiscoveryQuery()) { // FIXME [PJYF Nov 16 2010] We do not currently support domain discovery } }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.getRecordClass(), this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } for (ServiceInfo serviceInfo : jmDNSImpl.getServices().values()) { this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) serviceInfo); } }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.getRecordClass(), this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }
@Override public void addAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) { String loname = this.getName().toLowerCase(); if (jmDNSImpl.getLocalHost().getName().equalsIgnoreCase(loname)) { // type = DNSConstants.TYPE_A; answers.addAll(jmDNSImpl.getLocalHost().answers(this.isUnique(), DNSConstants.DNS_TTL)); return; } // Service type request if (jmDNSImpl.getServiceTypes().containsKey(loname)) { DNSQuestion question = new Pointer(this.getName(), DNSRecordType.TYPE_PTR, this.getRecordClass(), this.isUnique()); question.addAnswers(jmDNSImpl, answers); return; } this.addAnswersForServiceInfo(jmDNSImpl, answers, (ServiceInfoImpl) jmDNSImpl.getServices().get(loname)); }