org.ldaptive.provider
Class AbstractProviderConnectionFactory<T extends ProviderConfig>

java.lang.Object
  extended by org.ldaptive.provider.AbstractProviderConnectionFactory<T>
Type Parameters:
T - type of provider config for this connection factory
All Implemented Interfaces:
ProviderConnectionFactory<T>
Direct Known Subclasses:
JndiConnectionFactory, JndiStartTLSConnectionFactory

public abstract class AbstractProviderConnectionFactory<T extends ProviderConfig>
extends Object
implements ProviderConnectionFactory<T>

Provides a basic implementation for other connection factories to inherit.

Version:
$Revision: 3006 $ $Date: 2014-07-02 10:22:50 -0400 (Wed, 02 Jul 2014) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
AbstractProviderConnectionFactory(String url, T config)
          Creates a new abstract connection factory.
 
Method Summary
 ProviderConnection create()
          Create a connection to an LDAP.
protected abstract  ProviderConnection createInternal(String url)
          Create the provider connection and prepare the connection for use.
protected  ConnectionFactoryMetadata getMetadata()
          Returns the connection factory metadata.
 T getProviderConfig()
          Returns the provider configuration.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

AbstractProviderConnectionFactory

public AbstractProviderConnectionFactory(String url,
                                         T config)
Creates a new abstract connection factory. Once invoked the supplied provider config is made immutable. See AbstractConfig.makeImmutable().

Parameters:
url - of the ldap to connect to
config - provider configuration
Method Detail

getProviderConfig

public T getProviderConfig()
Returns the provider configuration.

Specified by:
getProviderConfig in interface ProviderConnectionFactory<T extends ProviderConfig>
Returns:
provider configuration

getMetadata

protected ConnectionFactoryMetadata getMetadata()
Returns the connection factory metadata.

Returns:
metadata

create

public ProviderConnection create()
                          throws LdapException
Create a connection to an LDAP.

Specified by:
create in interface ProviderConnectionFactory<T extends ProviderConfig>
Returns:
provider connection
Throws:
LdapException - if an LDAP error occurs

createInternal

protected abstract ProviderConnection createInternal(String url)
                                              throws LdapException
Create the provider connection and prepare the connection for use.

Parameters:
url - to connect to
Returns:
provider connection
Throws:
LdapException - if a connection cannot be established

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.