@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 (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 } }