Package javax.jmdns.impl
Class DNSQuestion
- java.lang.Object
-
- javax.jmdns.impl.DNSEntry
-
- javax.jmdns.impl.DNSQuestion
-
- Direct Known Subclasses:
DNSQuestion.AllRecords
,DNSQuestion.DNS4Address
,DNSQuestion.DNS6Address
,DNSQuestion.HostInformation
,DNSQuestion.Pointer
,DNSQuestion.Service
,DNSQuestion.Text
public class DNSQuestion extends DNSEntry
A DNS question.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DNSQuestion.AllRecords
AllRecords question.private static class
DNSQuestion.DNS4Address
Address question.private static class
DNSQuestion.DNS6Address
Address question.private static class
DNSQuestion.HostInformation
Host Information question.private static class
DNSQuestion.Pointer
Pointer question.private static class
DNSQuestion.Service
Service question.private static class
DNSQuestion.Text
Text question.
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
logger
-
Fields inherited from class javax.jmdns.impl.DNSEntry
_qualifiedNameMap
-
-
Constructor Summary
Constructors Constructor Description DNSQuestion(java.lang.String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnswers(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers)
Adds answers to the list for our question.protected void
addAnswersForServiceInfo(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers, ServiceInfoImpl info)
(package private) boolean
answeredBy(DNSEntry rec)
Check if this question is answered by a given DNS record.boolean
iAmTheOnlyOne(JmDNSImpl jmDNSImpl)
Checks if we are the only to be able to answer that question.boolean
isExpired(long now)
Check if the record is expired.boolean
isStale(long now)
Check if the record is stale, i.e.static DNSQuestion
newQuestion(java.lang.String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)
Create a question.void
toString(java.lang.StringBuilder sb)
-
Methods inherited from class javax.jmdns.impl.DNSEntry
compareTo, equals, getKey, getName, getQualifiedNameMap, getRecordClass, getRecordType, getSubtype, getType, hashCode, isDomainDiscoveryQuery, isReverseLookup, isSameEntry, isSameRecordClass, isSameType, isServicesDiscoveryMetaQuery, isUnique, isV4ReverseLookup, isV6ReverseLookup, matchRecordClass, matchRecordType, sameSubtype, toByteArray, toByteArray, toString
-
-
-
-
Constructor Detail
-
DNSQuestion
DNSQuestion(java.lang.String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)
-
-
Method Detail
-
newQuestion
public static DNSQuestion newQuestion(java.lang.String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)
Create a question.- Parameters:
name
- DNS name to be resolvedtype
- Record type to resolverecordClass
- Record class to resolveunique
- Request unicast response (Currently not supported in this implementation)- Returns:
- new question
-
answeredBy
boolean answeredBy(DNSEntry rec)
Check if this question is answered by a given DNS record.
-
addAnswers
public void addAnswers(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers)
Adds answers to the list for our question.- Parameters:
jmDNSImpl
- DNS holding the recordsanswers
- List of previous answer to append.
-
addAnswersForServiceInfo
protected void addAnswersForServiceInfo(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers, ServiceInfoImpl info)
-
isStale
public boolean isStale(long now)
Description copied from class:DNSEntry
Check if the record is stale, i.e. it has outlived more than half of its TTL.
-
isExpired
public boolean isExpired(long now)
Description copied from class:DNSEntry
Check if the record is expired.
-
iAmTheOnlyOne
public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl)
Checks if we are the only to be able to answer that question.- Parameters:
jmDNSImpl
- DNS holding the records- Returns:
true
if we are the only one with the answer to the question,false
otherwise.
-
-