Search in sources :

Example 1 with Pointer

use of javax.jmdns.impl.DNSRecord.Pointer in project JAirPort by froks.

the class ServiceInfoImpl method answers.

public Collection<DNSRecord> answers(boolean unique, int ttl, HostInfo localHost) {
    List<DNSRecord> list = new ArrayList<DNSRecord>();
    if (this.getSubtype().length() > 0) {
        list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
    }
    list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, textBytesToValidTextBytes(this.getTextBytes())));
    list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
    list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
    //        }
    for (Inet4Address adr : this.getInet4Addresses()) {
        list.add(new DNSRecord.IPv4Address(removeLastDot(this.getServer()), DNSRecordClass.CLASS_IN, false, ttl, adr));
    }
    list.add(new Pointer("_services._dns-sd._udp.local", DNSRecordClass.CLASS_IN, false, ttl, "_raop._tcp.local"));
    return list;
}
Also used : Inet4Address(java.net.Inet4Address) ArrayList(java.util.ArrayList) Service(javax.jmdns.impl.DNSRecord.Service) Pointer(javax.jmdns.impl.DNSRecord.Pointer) Text(javax.jmdns.impl.DNSRecord.Text)

Aggregations

Inet4Address (java.net.Inet4Address)1 ArrayList (java.util.ArrayList)1 Pointer (javax.jmdns.impl.DNSRecord.Pointer)1 Service (javax.jmdns.impl.DNSRecord.Service)1 Text (javax.jmdns.impl.DNSRecord.Text)1