Package javax.jmdns.impl
Class DNSRecord
java.lang.Object
javax.jmdns.impl.DNSEntry
javax.jmdns.impl.DNSRecord
- Direct Known Subclasses:
DNSRecord.Address,DNSRecord.HostInformation,DNSRecord.Pointer,DNSRecord.Service,DNSRecord.Text
DNS record
- Author:
- Arthur van Hoff, Rick Blair, Werner Randelshofer, Pierre Frisch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAddress record.static classstatic classstatic classstatic classPointer record.static classService record.static class -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongabstract ServiceEventgetServiceEvent(JmDNSImpl dns) Creates and return a service event for this record.Return a service information associated with that record if appropriate.abstract ServiceInfogetServiceInfo(boolean persistent) Return a service information associated with that record if appropriate.intgetTTL()voidbooleanisExpired(long now) Check if the record is expired.abstract booleanDetermine if a record can have multiple values in the cache.booleanisStale(long now) Check if the record is stale, i.e.booleanisStaleAndShouldBeRefreshed(long now) Check if the record is stale and whether the record should be refreshed over the network.voidsetRecordSource(InetAddress source) voidsetTTL(int ttl) protected voidMethods inherited from class javax.jmdns.impl.DNSEntry
compareTo, getKey, getName, getQualifiedNameMap, getRecordClass, getRecordType, getSubtype, getType, hashCode, isDomainDiscoveryQuery, isReverseLookup, isSameEntry, isSameRecordClass, isSameType, isServicesDiscoveryMetaQuery, isUnique, isV4ReverseLookup, isV6ReverseLookup, matchRecordClass, matchRecordType, sameSubtype, toByteArray, toByteArray, toString
-
Method Details
-
equals
-
isExpired
public boolean isExpired(long now) Description copied from class:DNSEntryCheck if the record is expired. -
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. -
isStaleAndShouldBeRefreshed
public boolean isStaleAndShouldBeRefreshed(long now) Check if the record is stale and whether the record should be refreshed over the network.- Parameters:
now- update date- Returns:
trueis the record is stale and should be refreshed,falseotherwise.
-
incrementRefreshPercentage
public void incrementRefreshPercentage() -
isSingleValued
public abstract boolean isSingleValued()Determine if a record can have multiple values in the cache.- Returns:
falseif this record can have multiple values in the cache,trueotherwise.
-
getServiceInfo
Return a service information associated with that record if appropriate.- Returns:
- service information
-
getServiceInfo
Return a service information associated with that record if appropriate.- Parameters:
persistent- iftrueServiceListener.resolveService will be called whenever new new information is received.- Returns:
- service information
-
getServiceEvent
Creates and return a service event for this record.- Parameters:
dns- DNS serviced by this event- Returns:
- service event
-
setRecordSource
-
getRecordSource
-
toString
-
setTTL
public void setTTL(int ttl) -
getTTL
public int getTTL() -
getCreated
public long getCreated()
-