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
public abstract class DNSRecord extends DNSEntry
DNS record- Author:
- Arthur van Hoff, Rick Blair, Werner Randelshofer, Pierre Frisch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDNSRecord.AddressAddress record.static classDNSRecord.HostInformationstatic classDNSRecord.IPv4Addressstatic classDNSRecord.IPv6Addressstatic classDNSRecord.PointerPointer record.static classDNSRecord.ServiceService record.static classDNSRecord.Text
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)longgetCreated()InetAddressgetRecordSource()abstract ServiceEventgetServiceEvent(JmDNSImpl dns)Creates and return a service event for this record.ServiceInfogetServiceInfo()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()voidincrementRefreshPercentage()booleanisExpired(long now)Check if the record is expired.abstract booleanisSingleValued()Determine 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 voidtoString(StringBuilder sb)-
Methods 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 Detail
-
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
public ServiceInfo getServiceInfo()
Return a service information associated with that record if appropriate.- Returns:
- service information
-
getServiceInfo
public abstract ServiceInfo getServiceInfo(boolean persistent)
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
public abstract ServiceEvent getServiceEvent(JmDNSImpl dns)
Creates and return a service event for this record.- Parameters:
dns- DNS serviced by this event- Returns:
- service event
-
setRecordSource
public void setRecordSource(InetAddress source)
-
getRecordSource
public InetAddress getRecordSource()
-
toString
protected void toString(StringBuilder sb)
-
setTTL
public void setTTL(int ttl)
-
getTTL
public int getTTL()
-
getCreated
public long getCreated()
-
-