diff options
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.jmdns/jmdns/javax/jmdns/impl/tasks/resolver/ServiceResolver.java')
-rw-r--r-- | providers/bundles/org.eclipse.ecf.provider.jmdns/jmdns/javax/jmdns/impl/tasks/resolver/ServiceResolver.java | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/jmdns/javax/jmdns/impl/tasks/resolver/ServiceResolver.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/jmdns/javax/jmdns/impl/tasks/resolver/ServiceResolver.java deleted file mode 100644 index eea86c514..000000000 --- a/providers/bundles/org.eclipse.ecf.provider.jmdns/jmdns/javax/jmdns/impl/tasks/resolver/ServiceResolver.java +++ /dev/null @@ -1,88 +0,0 @@ -//Copyright 2003-2005 Arthur van Hoff, Rick Blair -//Licensed under Apache License version 2.0 -//Original license LGPL - -package javax.jmdns.impl.tasks.resolver; - -import java.io.IOException; - -import javax.jmdns.ServiceInfo; -import javax.jmdns.impl.DNSOutgoing; -import javax.jmdns.impl.DNSQuestion; -import javax.jmdns.impl.DNSRecord; -import javax.jmdns.impl.JmDNSImpl; -import javax.jmdns.impl.constants.DNSConstants; -import javax.jmdns.impl.constants.DNSRecordClass; -import javax.jmdns.impl.constants.DNSRecordType; - -/** - * The ServiceResolver queries three times consecutively for services of a given type, and then removes itself from the timer. - * <p/> - * The ServiceResolver will run only if JmDNS is in state ANNOUNCED. REMIND: Prevent having multiple service resolvers for the same type in the timer queue. - */ -public class ServiceResolver extends DNSResolverTask -{ - - private String _type; - - public ServiceResolver(JmDNSImpl jmDNSImpl, String type) - { - super(jmDNSImpl); - this._type = type; - } - - /* - * (non-Javadoc) - * - * @see javax.jmdns.impl.tasks.DNSTask#getName() - */ - @Override - public String getName() - { - return "ServiceResolver(" + (this.getDns() != null ? this.getDns().getName() : "") + ")"; - } - - /* - * (non-Javadoc) - * - * @see javax.jmdns.impl.tasks.Resolver#addAnswers(javax.jmdns.impl.DNSOutgoing) - */ - @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; - } - - /* - * (non-Javadoc) - * - * @see javax.jmdns.impl.tasks.Resolver#addQuestions(javax.jmdns.impl.DNSOutgoing) - */ - @Override - protected DNSOutgoing addQuestions(DNSOutgoing out) throws IOException - { - DNSOutgoing newOut = out; - newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(_type, DNSRecordType.TYPE_PTR, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); - // newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(_type, DNSRecordType.TYPE_SRV, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); - return newOut; - } - - /* - * (non-Javadoc) - * - * @see javax.jmdns.impl.tasks.Resolver#description() - */ - @Override - protected String description() - { - return "querying service"; - } -}
\ No newline at end of file |