/** * Renew a service when the record become stale. If there is no service collector for the type this method does nothing. * * @param record * DNS record */ public void renewServiceCollector(DNSRecord record) { ServiceInfo info = record.getServiceInfo(); if (_serviceCollectors.containsKey(info.getType().toLowerCase())) { // Create/start ServiceResolver this.startServiceResolver(info.getType()); } }
@Override protected DNSOutgoing addAnswers(DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; long now = System.currentTimeMillis(); for (ServiceInfo info : this.getDns().getServices().values()) { newOut = this.addAnswer(newOut, new DNSRecord.Pointer(info.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getQualifiedName()), now); // newOut = this.addAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), // this.getDns().getLocalHost().getName()), now); } return newOut; }
@Override protected DNSOutgoing addAnswers(DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; long now = System.currentTimeMillis(); for (ServiceInfo info : this.getDns().getServices().values()) { newOut = this.addAnswer(newOut, new DNSRecord.Pointer(info.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getQualifiedName()), now); // newOut = this.addAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), // this.getDns().getLocalHost().getName()), now); } return newOut; }
@Override protected DNSOutgoing addAnswers(DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; long now = System.currentTimeMillis(); for (ServiceInfo info : this.getDns().getServices().values()) { newOut = this.addAnswer(newOut, new DNSRecord.Pointer(info.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getQualifiedName()), now); // newOut = this.addAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), // this.getDns().getLocalHost().getName()), now); } return newOut; }
@Override protected DNSOutgoing addAnswers(DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; long now = System.currentTimeMillis(); for (ServiceInfo info : this.getDns().getServices().values()) { newOut = this.addAnswer(newOut, new DNSRecord.Pointer(info.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getQualifiedName()), now); // newOut = this.addAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), // this.getDns().getLocalHost().getName()), now); } return newOut; }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); return new ServiceEventImpl(dns, info.getType(), info.getName(), info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); String domainName = info.getType(); String serviceName = JmDNSImpl.toUnqualifiedName(domainName, this.getAlias()); return new ServiceEventImpl(dns, domainName, serviceName, info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); String domainName = info.getType(); String serviceName = JmDNSImpl.toUnqualifiedName(domainName, this.getAlias()); return new ServiceEventImpl(dns, domainName, serviceName, info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); String domainName = info.getType(); String serviceName = JmDNSImpl.toUnqualifiedName(domainName, this.getAlias()); return new ServiceEventImpl(dns, domainName, serviceName, info); }
@Override public ServiceEvent getServiceEvent(JmDNSImpl dns) { ServiceInfo info = this.getServiceInfo(false); ((ServiceInfoImpl) info).setDns(dns); String domainName = info.getType(); String serviceName = JmDNSImpl.toUnqualifiedName(domainName, this.getAlias()); return new ServiceEventImpl(dns, domainName, serviceName, info); }