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 class
Address record.static class
static class
static class
static class
Pointer record.static class
Service record.static class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
abstract ServiceEvent
getServiceEvent
(JmDNSImpl dns) Creates and return a service event for this record.Return a service information associated with that record if appropriate.abstract ServiceInfo
getServiceInfo
(boolean persistent) Return a service information associated with that record if appropriate.int
getTTL()
void
boolean
isExpired
(long now) Check if the record is expired.abstract boolean
Determine if a record can have multiple values in the cache.boolean
isStale
(long now) Check if the record is stale, i.e.boolean
isStaleAndShouldBeRefreshed
(long now) Check if the record is stale and whether the record should be refreshed over the network.void
setRecordSource
(InetAddress source) void
setTTL
(int ttl) protected void
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 Details
-
equals
-
isExpired
public boolean isExpired(long now) Description copied from class:DNSEntry
Check if the record is expired. -
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. -
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:
true
is the record is stale and should be refreshed,false
otherwise.
-
incrementRefreshPercentage
public void incrementRefreshPercentage() -
isSingleValued
public abstract boolean isSingleValued()Determine if a record can have multiple values in the cache.- Returns:
false
if this record can have multiple values in the cache,true
otherwise.
-
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
- iftrue
ServiceListener.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()
-