Class DNSRecord.Service

Enclosing class:
DNSRecord

public static class DNSRecord.Service extends DNSRecord
Service record.
  • Field Details

    • logger1

      private static org.slf4j.Logger logger1
    • _priority

      private final int _priority
    • _weight

      private final int _weight
    • _port

      private final int _port
    • _server

      private final String _server
  • Constructor Details

    • Service

      public Service(String name, DNSRecordClass recordClass, boolean unique, int ttl, int priority, int weight, int port, String server)
  • Method Details

    • write

      Description copied from class: DNSRecord
      Write this record into an outgoing message.
      Specified by:
      write in class DNSRecord
    • toByteArray

      protected void toByteArray(DataOutputStream dout) throws IOException
      Overrides:
      toByteArray in class DNSEntry
      Parameters:
      dout -
      Throws:
      IOException
    • getServer

      String getServer()
    • getPriority

      public int getPriority()
      Returns:
      the priority
    • getWeight

      public int getWeight()
      Returns:
      the weight
    • getPort

      public int getPort()
      Returns:
      the port
    • sameValue

      boolean sameValue(DNSRecord other)
      Description copied from class: DNSRecord
      True if this record has the same value as some other record.
      Specified by:
      sameValue in class DNSRecord
    • isSingleValued

      public boolean isSingleValued()
      Description copied from class: DNSRecord
      Determine if a record can have multiple values in the cache.
      Specified by:
      isSingleValued in class DNSRecord
      Returns:
      false if this record can have multiple values in the cache, true otherwise.
    • handleQuery

      boolean handleQuery(JmDNSImpl dns, long expirationTime)
      Description copied from class: DNSRecord
      Handles a query represented by this record.
      Specified by:
      handleQuery in class DNSRecord
      Returns:
      Returns true if a conflict with one of the services registered with JmDNS or with the hostname occured.
    • handleResponse

      boolean handleResponse(JmDNSImpl dns)
      Description copied from class: DNSRecord
      Handles a response represented by this record.
      Specified by:
      handleResponse in class DNSRecord
      Returns:
      Returns true if a conflict with one of the services registered with JmDNS or with the hostname occured.
    • addAnswer

      DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException
      Description copied from class: DNSRecord
      Adds this as an answer to the provided outgoing datagram.
      Specified by:
      addAnswer in class DNSRecord
      Throws:
      IOException
    • getServiceInfo

      public ServiceInfo getServiceInfo(boolean persistent)
      Description copied from class: DNSRecord
      Return a service information associated with that record if appropriate.
      Specified by:
      getServiceInfo in class DNSRecord
      Parameters:
      persistent - if true ServiceListener.resolveService will be called whenever new new information is received.
      Returns:
      service information
    • getServiceEvent

      public ServiceEvent getServiceEvent(JmDNSImpl dns)
      Description copied from class: DNSRecord
      Creates and return a service event for this record.
      Specified by:
      getServiceEvent in class DNSRecord
      Parameters:
      dns - DNS serviced by this event
      Returns:
      service event
    • toString

      protected void toString(StringBuilder sb)
      Overrides:
      toString in class DNSRecord
      Parameters:
      sb -