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
  • Method Details

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class DNSEntry
    • isExpired

      public boolean isExpired(long now)
      Description copied from class: DNSEntry
      Check if the record is expired.
      Specified by:
      isExpired in class DNSEntry
      Parameters:
      now - update date
      Returns:
      true is the record is expired, false otherwise.
    • 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.
      Specified by:
      isStale in class DNSEntry
      Parameters:
      now - update date
      Returns:
      true is the record is stale, false otherwise.
    • 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

      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 - if true ServiceListener.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)
      Overrides:
      toString in class DNSEntry
      Parameters:
      sb -
    • setTTL

      public void setTTL(int ttl)
    • getTTL

      public int getTTL()
    • getCreated

      public long getCreated()