@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
private DNSRecord.Address getDNS6AddressRecord(boolean unique, int ttl) { if (this.getInetAddress() instanceof Inet6Address) { return new DNSRecord.IPv6Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress()); } return null; }
/** * {@inheritDoc} */ @Override public ServiceInfo getServiceInfo(String type, String name, boolean persistent, long timeout) { final ServiceInfoImpl info = this.resolveServiceInfo(type, name, "", persistent); this.waitForInfoData(info, timeout); return (info.hasData() ? info : null); }
@Override protected DNSOutgoing buildOutgoingForDNS(DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut.addQuestion(DNSQuestion.newQuestion(this.getDns().getLocalHost().getName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); for (DNSRecord answer : this.getDns().getLocalHost().answers(DNSRecordClass.CLASS_ANY, DNSRecordClass.NOT_UNIQUE, this.getTTL())) { newOut = this.addAuthoritativeAnswer(newOut, answer); } return newOut; }
@Override public ServiceEventImpl clone() { ServiceInfoImpl newInfo = new ServiceInfoImpl(this.getInfo()); return new ServiceEventImpl((JmDNSImpl) this.getDNS(), this.getType(), this.getName(), newInfo); }
@Override public void startReaper() { DNSTaskStarter.Factory.getInstance().getStarter(this.getDns()).startReaper(); }
@Override public void startTypeResolver() { DNSTaskStarter.Factory.getInstance().getStarter(this.getDns()).startTypeResolver(); }
@Override public void startCanceler() { DNSTaskStarter.Factory.getInstance().getStarter(this.getDns()).startCanceler(); }
private DNSRecord.Address getDNS4AddressRecord(boolean unique, int ttl) { if (this.getInetAddress() instanceof Inet4Address) { return new DNSRecord.IPv4Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress()); } return null; }
@Override public ServiceInfo getServiceInfo(boolean persistent) { ServiceInfoImpl info = (ServiceInfoImpl) super.getServiceInfo(persistent); info.addAddress((Inet4Address) _addr); return info; }
/** * Add an answer if it is not suppressed. * * @param in * @param rec * @exception IOException */ public void addAnswer(DNSIncoming in, DNSRecord rec) throws IOException { if ((in == null) || !rec.suppressedBy(in)) { this.addAnswer(rec, 0); } }
public DNSTaskStarterImpl(JmDNSImpl jmDNSImpl) { super(); _jmDNSImpl = jmDNSImpl; _timer = new StarterTimer("JmDNS(" + _jmDNSImpl.getName() + ").Timer", true); _stateTimer = new StarterTimer("JmDNS(" + _jmDNSImpl.getName() + ").State.Timer", false); }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
private DNSRecord.Address getDNS6AddressRecord(boolean unique, int ttl) { if (this.getInetAddress() instanceof Inet6Address) { return new DNSRecord.IPv6Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress()); } return null; }
@Override public ServiceInfo getServiceInfo(boolean persistent) { ServiceInfoImpl info = (ServiceInfoImpl) super.getServiceInfo(persistent); info.addAddress((Inet4Address) _addr); return info; }
/** * Add an answer if it is not suppressed. * * @param in * @param rec * @exception IOException */ public void addAnswer(DNSIncoming in, DNSRecord rec) throws IOException { if ((in == null) || !rec.suppressedBy(in)) { this.addAnswer(rec, 0); } }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
@Override public ServiceInfo getServiceInfo(boolean persistent) { ServiceInfoImpl info = (ServiceInfoImpl) super.getServiceInfo(persistent); info.addAddress((Inet6Address) _addr); return info; }