com.metamatrix.connector.ldap
Class LDAPConnection

java.lang.Object
  extended by org.teiid.connector.basic.BasicConnection
      extended by com.metamatrix.connector.ldap.LDAPConnection
All Implemented Interfaces:
Connection

public class LDAPConnection
extends BasicConnection

Represents a connection to an LDAP data source.


Field Summary
static java.lang.String LDAP_AUTH_TYPE
           
static java.lang.String LDAP_REFERRAL_MODE
           
static java.lang.String LDAP_USER_OBJECT_TYPE
           
 
Constructor Summary
LDAPConnection(ExecutionContext ctx, java.util.Properties props, ConnectorLogger logger)
          Constructor.
 
Method Summary
 void close()
          Closes LDAP context, effectively closing the connection to LDAP.
 void closeCalled()
          Called by the pool to indicate that the connection was returned to the pool.
 ResultSetExecution createResultSetExecution(IQueryCommand command, ExecutionContext executionContext, RuntimeMetadata metadata)
           
 UpdateExecution createUpdateExecution(ICommand command, ExecutionContext executionContext, RuntimeMetadata metadata)
           
 boolean isAlive()
          Currently, this method always returns alive.
 
Methods inherited from class org.teiid.connector.basic.BasicConnection
createExecution, createProcedureExecution, getCapabilities, setConnectorIdentity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDAP_AUTH_TYPE

public static final java.lang.String LDAP_AUTH_TYPE
See Also:
Constant Field Values

LDAP_USER_OBJECT_TYPE

public static final java.lang.String LDAP_USER_OBJECT_TYPE
See Also:
Constant Field Values

LDAP_REFERRAL_MODE

public static final java.lang.String LDAP_REFERRAL_MODE
See Also:
Constant Field Values
Constructor Detail

LDAPConnection

public LDAPConnection(ExecutionContext ctx,
                      java.util.Properties props,
                      ConnectorLogger logger)
               throws ConnectorException
Constructor.

Parameters:
ctx -
props -
logger -
Throws:
ConnectorException
Method Detail

createResultSetExecution

public ResultSetExecution createResultSetExecution(IQueryCommand command,
                                                   ExecutionContext executionContext,
                                                   RuntimeMetadata metadata)
                                            throws ConnectorException
Overrides:
createResultSetExecution in class BasicConnection
Throws:
ConnectorException

createUpdateExecution

public UpdateExecution createUpdateExecution(ICommand command,
                                             ExecutionContext executionContext,
                                             RuntimeMetadata metadata)
                                      throws ConnectorException
Overrides:
createUpdateExecution in class BasicConnection
Throws:
ConnectorException

close

public void close()
Closes LDAP context, effectively closing the connection to LDAP. (non-Javadoc)

See Also:
com.metamatrix.connector.pool.PoolAwareConnection#closeSource()

isAlive

public boolean isAlive()
Currently, this method always returns alive. We assume the connection is alive, and rely on proper timeout values to automatically clean up connections before any server-side timeout occurs. Rather than incur overhead by rebinding, we'll assume the connection is always alive, and throw an error when it is actually used, if the connection fails. This may be a more efficient way of handling failed connections, with the one tradeoff that stale connections will not be detected until execution time. In practice, there is no benefit to detecting stale connections before execution time. One possible extension is to implement a UnsolicitedNotificationListener. (non-Javadoc)

Specified by:
isAlive in interface Connection
Overrides:
isAlive in class BasicConnection
Returns:
true if open, false if there is a source error.
See Also:
com.metamatrix.connector.pool.PoolAwareConnection#isAlive()

closeCalled

public void closeCalled()
Description copied from interface: Connection
Called by the pool to indicate that the connection was returned to the pool. The actual close call will be made when the pool wants to purge this connection.

Specified by:
closeCalled in interface Connection
Overrides:
closeCalled in class BasicConnection


Copyright © 2009. All Rights Reserved.