/** * Create an entry. */ DNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) { _name = name; // _key = (name != null ? name.trim().toLowerCase() : null); _recordType = type; _dnsClass = recordClass; _unique = unique; _qualifiedNameMap = ServiceInfoImpl.decodeQualifiedNameMapForType(this.getName()); String domain = _qualifiedNameMap.get(Fields.Domain); String protocol = _qualifiedNameMap.get(Fields.Protocol); String application = _qualifiedNameMap.get(Fields.Application); String instance = _qualifiedNameMap.get(Fields.Instance).toLowerCase(); _type = (application.length() > 0 ? "_" + application + "." : "") + (protocol.length() > 0 ? "_" + protocol + "." : "") + domain + "."; _key = ((instance.length() > 0 ? instance + "." : "") + _type).toLowerCase(); }
/** * Create an entry. */ DNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) { _name = name; // _key = (name != null ? name.trim().toLowerCase() : null); _recordType = type; _dnsClass = recordClass; _unique = unique; _qualifiedNameMap = ServiceInfoImpl.decodeQualifiedNameMapForType(this.getName()); String domain = _qualifiedNameMap.get(Fields.Domain); String protocol = _qualifiedNameMap.get(Fields.Protocol); String application = _qualifiedNameMap.get(Fields.Application); String instance = _qualifiedNameMap.get(Fields.Instance).toLowerCase(); _type = (application.length() > 0 ? "_" + application + "." : "") + (protocol.length() > 0 ? "_" + protocol + "." : "") + domain + "."; _key = ((instance.length() > 0 ? instance + "." : "") + _type).toLowerCase(); }
/** * Create an entry. */ DNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) { _name = name; // _key = (name != null ? name.trim().toLowerCase() : null); _recordType = type; _dnsClass = recordClass; _unique = unique; _qualifiedNameMap = ServiceInfoImpl.decodeQualifiedNameMapForType(this.getName()); String domain = _qualifiedNameMap.get(Fields.Domain); String protocol = _qualifiedNameMap.get(Fields.Protocol); String application = _qualifiedNameMap.get(Fields.Application); String instance = _qualifiedNameMap.get(Fields.Instance).toLowerCase(); _type = (application.length() > 0 ? "_" + application + "." : "") + (protocol.length() > 0 ? "_" + protocol + "." : "") + domain + "."; _key = ((instance.length() > 0 ? instance + "." : "") + _type).toLowerCase(); }
/** * Create an entry. */ DNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) { _name = name; // _key = (name != null ? name.trim().toLowerCase() : null); _recordType = type; _dnsClass = recordClass; _unique = unique; _qualifiedNameMap = ServiceInfoImpl.decodeQualifiedNameMapForType(this.getName()); String domain = _qualifiedNameMap.get(Fields.Domain); String protocol = _qualifiedNameMap.get(Fields.Protocol); String application = _qualifiedNameMap.get(Fields.Application); String instance = _qualifiedNameMap.get(Fields.Instance).toLowerCase(); _type = (application.length() > 0 ? "_" + application + "." : "") + (protocol.length() > 0 ? "_" + protocol + "." : "") + domain + "."; _key = ((instance.length() > 0 ? instance + "." : "") + _type).toLowerCase(); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
/** * @param dout * @exception IOException */ protected void toByteArray(DataOutputStream dout) throws IOException { dout.write(this.getName().getBytes("UTF8")); dout.writeShort(this.getRecordType().indexValue()); dout.writeShort(this.getRecordClass().indexValue()); }
/** * Check if this question is answered by a given DNS record. */ boolean answeredBy(DNSEntry rec) { return this.isSameRecordClass(rec) && this.isSameType(rec) && this.getName().equals(rec.getName()); }
/** * Check if this question is answered by a given DNS record. */ boolean answeredBy(DNSEntry rec) { return this.isSameRecordClass(rec) && this.isSameType(rec) && this.getName().equals(rec.getName()); }
/** * Check if this question is answered by a given DNS record. */ boolean answeredBy(DNSEntry rec) { return this.isSameRecordClass(rec) && this.isSameType(rec) && this.getName().equals(rec.getName()); }
/** * Check if this question is answered by a given DNS record. */ boolean answeredBy(DNSEntry rec) { return this.isSameRecordClass(rec) && this.isSameType(rec) && this.getName().equals(rec.getName()); }
switch (rec.getRecordType()) { case TYPE_A: // IPv4 if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv4Addresses.add((Inet4Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv6Addresses.add((Inet6Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Service srv = (DNSRecord.Service) rec; boolean serverChanged = (_server == null) || !_server.equalsIgnoreCase(srv.getServer()); if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Text txt = (DNSRecord.Text) rec; _text = txt.getText();
switch (rec.getRecordType()) { case TYPE_A: // IPv4 if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv4Addresses.add((Inet4Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv6Addresses.add((Inet6Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Service srv = (DNSRecord.Service) rec; boolean serverChanged = (_server == null) || !_server.equalsIgnoreCase(srv.getServer()); if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Text txt = (DNSRecord.Text) rec; _text = txt.getText();
switch (rec.getRecordType()) { case TYPE_A: // IPv4 if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv4Addresses.add((Inet4Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getServer())) { _ipv6Addresses.add((Inet6Address) ((DNSRecord.Address) rec).getAddress()); serviceUpdated = true; if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Service srv = (DNSRecord.Service) rec; boolean serverChanged = (_server == null) || !_server.equalsIgnoreCase(srv.getServer()); if (rec.getName().equalsIgnoreCase(this.getQualifiedName())) { DNSRecord.Text txt = (DNSRecord.Text) rec; _text = txt.getText();