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
A DNS question.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classAllRecords question.private static classAddress question.private static classAddress question.private static classHost Information question.private static classPointer question.private static classService question.private static classText question. -
Field Summary
FieldsFields inherited from class javax.jmdns.impl.DNSEntry
_qualifiedNameMap -
Constructor Summary
ConstructorsConstructorDescriptionDNSQuestion(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnswers(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers) Adds answers to the list for our question.protected voidaddAnswersForServiceInfo(JmDNSImpl jmDNSImpl, Set<DNSRecord> answers, ServiceInfoImpl info) (package private) booleanansweredBy(DNSEntry rec) Check if this question is answered by a given DNS record.booleaniAmTheOnlyOne(JmDNSImpl jmDNSImpl) Checks if we are the only to be able to answer that question.booleanisExpired(long now) Check if the record is expired.booleanisStale(long now) Check if the record is stale, i.e.static DNSQuestionnewQuestion(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique) Create a question.voidMethods 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
-
Field Details
-
logger
private static org.slf4j.Logger logger
-
-
Constructor Details
-
DNSQuestion
DNSQuestion(String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)
-
-
Method Details
-
newQuestion
public static DNSQuestion newQuestion(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
Check if this question is answered by a given DNS record. -
addAnswers
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, Set<DNSRecord> answers, ServiceInfoImpl info) -
isStale
public boolean isStale(long now) Description copied from class:DNSEntryCheck 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:DNSEntryCheck if the record is expired. -
iAmTheOnlyOne
Checks if we are the only to be able to answer that question.- Parameters:
jmDNSImpl- DNS holding the records- Returns:
trueif we are the only one with the answer to the question,falseotherwise.
-
toString
-