Class DNS_PING

All Implemented Interfaces:
Lifecycle

public class DNS_PING extends Discovery
  • Field Details

    • DEFAULT_DNS_FACTORY

      private static final String DEFAULT_DNS_FACTORY
      See Also:
    • DEFAULT_DNS_RECORD_TYPE

      private static final String DEFAULT_DNS_RECORD_TYPE
      See Also:
    • dns_context_factory

      protected String dns_context_factory
    • dns_address

      protected String dns_address
    • dns_record_type

      protected String dns_record_type
    • dns_query

      protected String dns_query
    • probe_transport_ports

      protected boolean probe_transport_ports
    • dns_resolver

      protected volatile DNSResolver dns_resolver
    • transportPort

      private int transportPort
    • portRange

      private int portRange
  • Constructor Details

    • DNS_PING

      public DNS_PING()
  • Method Details

    • init

      public void init() throws Exception
      Description copied from class: Protocol
      Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.
      Specified by:
      init in interface Lifecycle
      Overrides:
      init in class Discovery
      Throws:
      Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
    • setDNSResolver

      public DNS_PING setDNSResolver(DNSResolver resolver)
    • setDNSQuery

      public DNS_PING setDNSQuery(String query)
    • getDNSContextFactory

      public String getDNSContextFactory()
    • getDNSAddress

      public String getDNSAddress()
    • validateProperties

      protected void validateProperties()
    • destroy

      public void destroy()
      Description copied from class: Protocol
      This method is called on a JChannel.close(). Does some cleanup; after the call, the VM will terminate
      Specified by:
      destroy in interface Lifecycle
      Overrides:
      destroy in class Protocol
    • isDynamic

      public boolean isDynamic()
      Specified by:
      isDynamic in class Discovery
    • getMembers

      List<Address> getMembers(String dns_query, DNSResolver.DNSRecordType dns_record_type)
      Gets a list of IP addresses for the provided DNS query list and record type.
      Parameters:
      dns_query - A comma-separated list of DNS queries. Must not be null.
      dns_record_type - The DNS record type.
      Returns:
      A list of IP addresses corresponding to the provided DNS query list and record type. An empty list is returned if the provided DNS query does not resolve to any IP addresses.
      Throws:
      NullPointerException - if dns_query is null.
    • fetchFromDns

      public String fetchFromDns()
    • findMembers

      public void findMembers(List<Address> members, boolean initial_discovery, Responses responses)
      Description copied from class: Discovery
      Fetches information (e.g. physical address, logical name) for the given member addresses. Needs to add responses to the Responses object. If Discovery.async_discovery is true, this method will be called in a separate thread, otherwise the caller's thread will be used.
      Specified by:
      findMembers in class Discovery
      Parameters:
      members - A list of logical addresses (typically UUIDs). If null, then information for all members is fetched
      initial_discovery - Set to true if this is for the initial membership discovery. Some protocols (e.g. file based ones) may return only the information for the coordinator(s).
      responses - The list to which responses should be added
    • sendDiscoveryRequest

      protected void sendDiscoveryRequest(Message req)