public class DefaultConnectionFactory extends Object implements ConnectionFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultConnectionFactory.DefaultConnection
Default implementation for managing a connection to an LDAP.
|
Modifier and Type | Field and Description |
---|---|
private ConnectionConfig |
config
Connection configuration used by this factory.
|
protected static Provider<?> |
DEFAULT_PROVIDER
Static reference to the default ldap provider.
|
private Provider<?> |
provider
Provider used by this factory.
|
static String |
PROVIDER
Ldap provider class name.
|
Constructor and Description |
---|
DefaultConnectionFactory()
Default constructor.
|
DefaultConnectionFactory(ConnectionConfig cc)
Creates a new default connection factory.
|
DefaultConnectionFactory(ConnectionConfig cc,
Provider<?> p)
Creates a new default connection factory.
|
DefaultConnectionFactory(String ldapUrl)
Creates a new default connection factory.
|
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Creates a new connection.
|
static Connection |
getConnection(ConnectionConfig cc)
Creates a new connection.
|
static Connection |
getConnection(String ldapUrl)
Creates a new connection.
|
ConnectionConfig |
getConnectionConfig()
Returns the connection config.
|
static Provider<?> |
getDefaultProvider()
The
PROVIDER property is checked and that class is loaded if provided. |
Provider<?> |
getProvider()
Returns the ldap provider.
|
void |
setConnectionConfig(ConnectionConfig cc)
Sets the connection config.
|
void |
setProvider(Provider<?> p)
Sets the ldap provider.
|
String |
toString() |
public static final String PROVIDER
protected static final Provider<?> DEFAULT_PROVIDER
private Provider<?> provider
private ConnectionConfig config
public DefaultConnectionFactory()
public DefaultConnectionFactory(String ldapUrl)
ldapUrl
- to connect topublic DefaultConnectionFactory(ConnectionConfig cc)
cc
- connection configurationpublic DefaultConnectionFactory(ConnectionConfig cc, Provider<?> p)
cc
- connection configurationp
- providerpublic ConnectionConfig getConnectionConfig()
public void setConnectionConfig(ConnectionConfig cc)
AbstractConfig.makeImmutable()
.cc
- connection configpublic Provider<?> getProvider()
public void setProvider(Provider<?> p)
p
- ldap provider to setpublic Connection getConnection()
getConnection
in interface ConnectionFactory
public static Connection getConnection(String ldapUrl)
ldapUrl
- to connect topublic static Connection getConnection(ConnectionConfig cc)
cc
- connection configurationpublic static Provider<?> getDefaultProvider()
PROVIDER
property is checked and that class is loaded if provided. Otherwise the JNDI provider is
returned.Copyright © 2003-2019 Virginia Tech. All Rights Reserved.