Class Lookup


  • public final class Lookup
    extends java.lang.Object
    A service lookup. It is up to each method to decide what to do with the optional portName and protocol fields. For example portName could be used to distinguish between Akka remoting ports and HTTP ports.

    • Constructor Summary

      Constructors 
      Constructor Description
      Lookup​(java.lang.String serviceName, scala.Option<java.lang.String> portName, scala.Option<java.lang.String> protocol)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Lookup apply​(java.lang.String serviceName)
      Create a service Lookup with only a serviceName.
      static Lookup apply​(java.lang.String serviceName, scala.Option<java.lang.String> portName, scala.Option<java.lang.String> protocol)
      Create a service Lookup with serviceName, optional portName and optional protocol.
      static boolean canEqual​(java.lang.Object x$1)  
      static Lookup create​(java.lang.String serviceName)
      Java API
      boolean equals​(java.lang.Object obj)  
      java.util.Optional<java.lang.String> getPortName()
      Java API
      java.util.Optional<java.lang.String> getProtocol()
      Java API
      int hashCode()  
      static boolean isValidSrv​(java.lang.String srv)
      Returns true if passed string conforms with SRV format.
      static Lookup parseSrv​(java.lang.String str)
      Create a service Lookup from a string with format: _portName._protocol.serviceName.
      scala.Option<java.lang.String> portName()  
      static int productArity()  
      static java.lang.Object productElement​(int x$1)  
      static scala.collection.Iterator<java.lang.Object> productIterator()  
      static java.lang.String productPrefix()  
      scala.Option<java.lang.String> protocol()  
      java.lang.String serviceName()  
      java.lang.String toString()  
      Lookup withPortName​(java.lang.String value)
      Which port for a service e.g.
      Lookup withProtocol​(java.lang.String value)
      Which protocol e.g.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Lookup

        public Lookup​(java.lang.String serviceName,
                      scala.Option<java.lang.String> portName,
                      scala.Option<java.lang.String> protocol)
    • Method Detail

      • apply

        public static Lookup apply​(java.lang.String serviceName)
        Create a service Lookup with only a serviceName. Use withPortName and withProtocol to provide optional portName and protocol
        Parameters:
        serviceName - (undocumented)
        Returns:
        (undocumented)
      • apply

        public static Lookup apply​(java.lang.String serviceName,
                                   scala.Option<java.lang.String> portName,
                                   scala.Option<java.lang.String> protocol)
        Create a service Lookup with serviceName, optional portName and optional protocol.
        Parameters:
        serviceName - (undocumented)
        portName - (undocumented)
        protocol - (undocumented)
        Returns:
        (undocumented)
      • create

        public static Lookup create​(java.lang.String serviceName)
        Java API

        Create a service Lookup with only a serviceName. Use withPortName and withProtocol to provide optional portName and protocol

        Parameters:
        serviceName - (undocumented)
        Returns:
        (undocumented)
      • parseSrv

        public static Lookup parseSrv​(java.lang.String str)
        Create a service Lookup from a string with format: _portName._protocol.serviceName. (as specified by https://www.ietf.org/rfc/rfc2782.txt)

        If the passed string conforms with this format, a SRV Lookup is returned. The serviceName part must be a valid domain name.

        The string is parsed and dismembered to build a Lookup as following: Lookup(serviceName).withPortName(portName).withProtocol(protocol)

        Parameters:
        str - (undocumented)
        Returns:
        (undocumented)
        Throws:
        java.lang.NullPointerException - If the passed string is null
        java.lang.IllegalArgumentException - If the string doesn't not conform with the SRV format
      • isValidSrv

        public static boolean isValidSrv​(java.lang.String srv)
        Returns true if passed string conforms with SRV format. Otherwise returns false.
        Parameters:
        srv - (undocumented)
        Returns:
        (undocumented)
      • productPrefix

        public static java.lang.String productPrefix()
      • productArity

        public static int productArity()
      • productElement

        public static java.lang.Object productElement​(int x$1)
      • productIterator

        public static scala.collection.Iterator<java.lang.Object> productIterator()
      • canEqual

        public static boolean canEqual​(java.lang.Object x$1)
      • serviceName

        public java.lang.String serviceName()
      • portName

        public scala.Option<java.lang.String> portName()
      • protocol

        public scala.Option<java.lang.String> protocol()
      • withPortName

        public Lookup withPortName​(java.lang.String value)
        Which port for a service e.g. Akka remoting or HTTP. Maps to "service" for an SRV records.
        Parameters:
        value - (undocumented)
        Returns:
        (undocumented)
      • withProtocol

        public Lookup withProtocol​(java.lang.String value)
        Which protocol e.g. TCP or UDP. Maps to "protocol" for SRV records.
        Parameters:
        value - (undocumented)
        Returns:
        (undocumented)
      • getPortName

        public java.util.Optional<java.lang.String> getPortName()
        Java API
        Returns:
        (undocumented)
      • getProtocol

        public java.util.Optional<java.lang.String> getProtocol()
        Java API
        Returns:
        (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object