Class PreferredConnection


  • public class PreferredConnection
    extends Object
    A simple class that is used to be able to specify which URL and connection type to use when we connect to a server.
    • Constructor Detail

      • PreferredConnection

        public PreferredConnection​(HostPort hostPort,
                                   PreferredConnection.Type type)
        The constructor of the PreferredConnection.
        Parameters:
        hostPort - the host and port to connect to the server.
        type - the type of connection to be used to connect (required to differentiate StartTLS and regular LDAP).
    • Method Detail

      • getLDAPURL

        public String getLDAPURL()
        Returns the LDAP URL to be used.
        Returns:
        the LDAP URL to be used.
      • getHostPort

        public HostPort getHostPort()
        Returns the host name and port number.
        Returns:
        the hostPort
      • getType

        public PreferredConnection.Type getType()
        Returns the type of the connection.
        Returns:
        the type of the connection.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getPreferredConnections

        public static Set<PreferredConnection> getPreferredConnections​(ConnectionWrapper conn)
        Commodity method that generates a list of preferred connection (of just one) with the information on a given connection.
        Parameters:
        conn - the connection we retrieve the information from.
        Returns:
        a list containing the preferred connection object.