Package org.opends.admin.ads.util
Class PreferredConnection
- java.lang.Object
-
- org.opends.admin.ads.util.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreferredConnection.TypeThe type of the connection.
-
Constructor Summary
Constructors Constructor Description PreferredConnection(HostPort hostPort, PreferredConnection.Type type)The constructor of the PreferredConnection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)HostPortgetHostPort()Returns the host name and port number.StringgetLDAPURL()Returns the LDAP URL to be used.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.PreferredConnection.TypegetType()Returns the type of the connection.inthashCode()StringtoString()
-
-
-
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.
-
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.
-
-