Skip navigation links


oracle.idm.connection.ldap
Class LdapConnectionManager

java.lang.Object
  extended by oracle.idm.connection.ConnectionManager
      extended by oracle.idm.connection.ldap.LdapConnectionManager

All Implemented Interfaces:
java.lang.Comparable, ConnectionDelegate, XmlPrintable

public class LdapConnectionManager
extends ConnectionManager

This class implements the LDAP connection manager. LDAP connection managers use the LDAP context delegates to perform LDAP context operations, and simply maintain the mapping between the LDAP connection and an LDAP context. This allows for more flexibility in how LDAP contexts are created while it reduces the complexity of the LDAP context manager that may need to be implemented by the end user of the framework in order to provide application specific logic.

When modifying LDAP connection manager properties directly, synchronize with the connection pool in order to avoid undesirable side effects, as follows:

 synchronized (pool) { manager.setValidating(false); }
 

Note: Each LdapContext that comes from the LDAP connection manager will contain the following environment property, so you can get back the LdapConnection:

 // Get LdapConnection reference from LdapContext.
 LdapConnection connection = (LdapConnection)context.getEnvironment().get(Connection.Parameter.REFERENCE);
 

Field Summary

 

Fields inherited from class oracle.idm.connection.ConnectionManager
tag

 

Fields inherited from interface oracle.idm.connection.ConnectionDelegate
DEFAULT_LIMIT, DEFAULT_PRIORITY, DEFAULT_PROXYING, DEFAULT_STACK_TRACING, DEFAULT_VALIDATING, DEFAULT_WEIGHT

 

Constructor Summary
LdapConnectionManager(LdapContextDelegate delegate)
          Constructor for the LDAP connection manager.

 

Method Summary
 boolean canCloseConnection(Connection connection, java.util.Map parameters)
          Returns true if this connection can be closed.
 boolean canOpenConnection(java.util.Map parameters)
          Returns true if this connection can be opened.
 boolean canProxyConnection(Connection connection, java.util.Map parameters)
          Returns true if this connection can be proxied.
 boolean canValidateConnection(Connection connection, java.util.Map parameters)
          Returns true if this connection can be validated.
 java.util.Map cloneEnvironment(java.util.Map environment)
          This method clones the LDAP context environment of this connection.
 java.util.Map cloneParameters(java.util.Map parameters)
          This method colones parameters to be internalized by the connection.
 void closeConnection(Connection connection, java.util.Map parameters)
          This method logs, records, and counts close connection operation.
 LdapContextDelegate getLdapContextDelegate()
          Returns the LDAP context delegate for this connection manager.
 java.lang.String getType()
          Getter for the type of this connection delegate.
 boolean isAlteredConnection(Connection connection, java.util.Map parameters)
          Returns true if this is the connection has been altered, called from the pool upon release and return operations to check for connection integrity.
 boolean isMatchingConnection(Connection connection, java.util.Map parameters)
          Returns true if this is a matching connection without the need to be proxied.
 boolean isMatchingParameters(java.util.Map parameters)
          Tests if the connection delegate matches specified parameters.
 boolean isProxying()
          Getter for the proxying mode.
 boolean isValidating()
          Getter for the validating mode.
 Connection openConnection(java.util.Map parameters)
          This method opens a connection.
 void proxyConnection(Connection connection, java.util.Map parameters)
          This method logs, records, and counts proxy connection operation.
 void resetProxying()
          Resets the proxying mode to DEFAULT_PROXYING.
 void resetValidating()
          Resets the validating mode to DEFAULT_VALIDATING.
 void setProxying(boolean proxying)
          Setter for the proxying mode.
 void setValidating(boolean validating)
          Setter for the validating mode.
 void validateConnection(Connection connection, java.util.Map parameters)
          This method logs, records, and counts validate connection operation.
protected  void xprintBody(XmlPrintWriter out)
          This method prints the connection manager XML tag body.

 

Methods inherited from class oracle.idm.connection.ConnectionManager
canCaptureConnection, canInvalidateConnection, canMatchConnection, canOperateConnection, canReleaseConnection, canRemoveConnection, canReturnConnection, captureConnection, checkConnection, checkParameters, checkProxying, checkValidating, compareTo, getConnectionOperationCountInfo, getConnectionOperationFailSafe, getGross, getLimit, getLoad, getLogger, getPriority, getWeight, hasReachedLimit, invalidateConnection, isForeignConnection, isMatchingType, isStackTracing, matchConnection, openConnection, releaseConnection, removeConnection, resetLimit, resetPriority, resetStackTracing, resetWeight, returnConnection, setLimit, setPriority, setStackTracing, setWeight, xprint

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

LdapConnectionManager

public LdapConnectionManager(LdapContextDelegate delegate)
Constructor for the LDAP connection manager.

Method Detail

getType

public java.lang.String getType()
Description copied from interface: ConnectionDelegate
Getter for the type of this connection delegate.

A connection delegate type must match the type of the connection it manages.

Returns:
string representing the type

isProxying

public boolean isProxying()
Description copied from interface: ConnectionDelegate
Getter for the proxying mode.
Specified by:
isProxying in interface ConnectionDelegate
Overrides:
isProxying in class ConnectionManager
Returns:
true if the connection delegate is proxying, false otherwise

setProxying

public void setProxying(boolean proxying)
                 throws java.lang.UnsupportedOperationException
Description copied from interface: ConnectionDelegate
Setter for the proxying mode.

If this operation is not suported, throw UnsupportedOperationException

Specified by:
setProxying in interface ConnectionDelegate
Overrides:
setProxying in class ConnectionManager
Throws:
java.lang.UnsupportedOperationException

resetProxying

public void resetProxying()
                   throws java.lang.UnsupportedOperationException
Description copied from interface: ConnectionDelegate
Resets the proxying mode to DEFAULT_PROXYING.

If this operation is not suported, throw UnsupportedOperationException

Specified by:
resetProxying in interface ConnectionDelegate
Overrides:
resetProxying in class ConnectionManager
Throws:
java.lang.UnsupportedOperationException

isValidating

public boolean isValidating()
Description copied from interface: ConnectionDelegate
Getter for the validating mode.
Specified by:
isValidating in interface ConnectionDelegate
Overrides:
isValidating in class ConnectionManager
Returns:
true if the connection delegate is validating, false otherwise

setValidating

public void setValidating(boolean validating)
                   throws java.lang.UnsupportedOperationException
Description copied from interface: ConnectionDelegate
Setter for the validating mode.

If this operation is not suported, throw UnsupportedOperationException

Specified by:
setValidating in interface ConnectionDelegate
Overrides:
setValidating in class ConnectionManager
Throws:
java.lang.UnsupportedOperationException

resetValidating

public void resetValidating()
                     throws java.lang.UnsupportedOperationException
Description copied from interface: ConnectionDelegate
Resets the validating mode to DEFAULT_VALIDATING.

If this operation is not suported, throw UnsupportedOperationException

Specified by:
resetValidating in interface ConnectionDelegate
Overrides:
resetValidating in class ConnectionManager
Throws:
java.lang.UnsupportedOperationException

getLdapContextDelegate

public LdapContextDelegate getLdapContextDelegate()
Returns the LDAP context delegate for this connection manager.
Returns:
ldap context delegate for this connection manager

isMatchingParameters

public final boolean isMatchingParameters(java.util.Map parameters)
Description copied from interface: ConnectionDelegate
Tests if the connection delegate matches specified parameters.

This method must test for matching type and any other connection delegate specific parameters.

The connection pool will call this method on each connection delegate before selecting it to process the connection request. If this method returns false, the connection delegate will not be selected for the request. Thus this method can be used to implement connection subtypes or perform other pruning of potential targets for request fulfillment.

Specified by:
isMatchingParameters in interface ConnectionDelegate
Overrides:
isMatchingParameters in class ConnectionManager
Returns:
true if the parameterts match, false otherwise

canOpenConnection

public boolean canOpenConnection(java.util.Map parameters)
                          throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this connection can be opened.

The connection pool will call this method on each connection delegate before performin the open operation. If this method returns false, the connection delegate will not be selected for the open operation.

This method is very similar ot the isMatchingParameters(Map) method, except that is is called only for open operations and can do more operation specific pruning of potential targets for that operaion.

Typically, implementations of this method will call the isMatchingParameters(Map) method and do further operation specific checks.

Does not check for reached limit, this should be left to the pool.

Does not enforce operation timeouts, this should be left to the pool.

Specified by:
canOpenConnection in interface ConnectionDelegate
Overrides:
canOpenConnection in class ConnectionManager
Returns:
true if the connection can be opened, false otherwise
Throws:
ConnectionException

openConnection

public Connection openConnection(java.util.Map parameters)
                          throws ConnectionException
Description copied from interface: ConnectionDelegate
This method opens a connection.
Returns:
connection that has been opened
Throws:
ConnectionException

canCloseConnection

public boolean canCloseConnection(Connection connection,
                                  java.util.Map parameters)
                           throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this connection can be closed.

The connection pool will call this method on each connection delegate before performin the close operation. If this method returns false, the connection delegate will not be selected for the close operation.

This method is very similar ot the isMatchingParameters(Map) method, except that is is called only for close operations and can do more operation specific pruning of potential targets for that operaion.

Typically, implementations of this method will call the isMatchingParameters(Map) method and do further operation specific checks.

Does not enforce operation timeouts, this should be left to the pool.

Specified by:
canCloseConnection in interface ConnectionDelegate
Overrides:
canCloseConnection in class ConnectionManager
Returns:
true if the connection can be closed, false otherwise
Throws:
ConnectionException

closeConnection

public void closeConnection(Connection connection,
                            java.util.Map parameters)
                     throws ConnectionException
Description copied from class: ConnectionManager
This method logs, records, and counts close connection operation.

This method is called from the ConnectionPool.

Specified by:
closeConnection in interface ConnectionDelegate
Overrides:
closeConnection in class ConnectionManager
Throws:
ConnectionException

canProxyConnection

public boolean canProxyConnection(Connection connection,
                                  java.util.Map parameters)
                           throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this connection can be proxied.

The connection pool will call this method on each connection delegate before performin the proxy operation. If this method returns false, the connection delegate will not be selected for the proxy operation.

This method is very similar ot the isMatchingParameters(Map) method, except that is is called only for proxy operations and can do more operation specific pruning of potential targets for that operaion.

Typically, implementations of this method will call the isMatchingParameters(Map) method and do further operation specific checks.

Does not enforce operation timeouts, this should be left to the pool.

Specified by:
canProxyConnection in interface ConnectionDelegate
Overrides:
canProxyConnection in class ConnectionManager
Returns:
true if the connection can be proxied, false otherwise
Throws:
ConnectionException

proxyConnection

public void proxyConnection(Connection connection,
                            java.util.Map parameters)
                     throws ConnectionException,
                            java.lang.UnsupportedOperationException
Description copied from class: ConnectionManager
This method logs, records, and counts proxy connection operation.

This method is called from the ConnectionPool.

Specified by:
proxyConnection in interface ConnectionDelegate
Overrides:
proxyConnection in class ConnectionManager
Throws:
ConnectionException
java.lang.UnsupportedOperationException

isMatchingConnection

public boolean isMatchingConnection(Connection connection,
                                    java.util.Map parameters)
                             throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this is a matching connection without the need to be proxied.
Specified by:
isMatchingConnection in interface ConnectionDelegate
Overrides:
isMatchingConnection in class ConnectionManager
Returns:
true if the connection matches the parameters, false otherwise
Throws:
ConnectionException

isAlteredConnection

public boolean isAlteredConnection(Connection connection,
                                   java.util.Map parameters)
                            throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this is the connection has been altered, called from the pool upon release and return operations to check for connection integrity.
Specified by:
isAlteredConnection in interface ConnectionDelegate
Overrides:
isAlteredConnection in class ConnectionManager
Returns:
true if the connection has been altered, false otherwise
Throws:
ConnectionException

canValidateConnection

public boolean canValidateConnection(Connection connection,
                                     java.util.Map parameters)
                              throws ConnectionException
Description copied from interface: ConnectionDelegate
Returns true if this connection can be validated.

The connection pool will call this method on each connection delegate before performin the validate operation. If this method returns false, the connection delegate will not be selected for the validate operation.

This method is very similar ot the isMatchingParameters(Map) method, except that is is called only for validate operations and can do more operation specific pruning of potential targets for that operaion.

Typically, implementations of this method will call the isMatchingParameters(Map) method and do further operation specific checks.

Does not enforce operation timeouts, this should be left to the pool.

Does not check for altered connections, this should be left to the pool.

Specified by:
canValidateConnection in interface ConnectionDelegate
Overrides:
canValidateConnection in class ConnectionManager
Returns:
true if the connection can be validated, false otherwise
Throws:
ConnectionException

validateConnection

public void validateConnection(Connection connection,
                               java.util.Map parameters)
                        throws ConnectionException,
                               java.lang.UnsupportedOperationException
Description copied from class: ConnectionManager
This method logs, records, and counts validate connection operation.

This method is called from the ConnectionPool.

Specified by:
validateConnection in interface ConnectionDelegate
Overrides:
validateConnection in class ConnectionManager
Throws:
ConnectionException
java.lang.UnsupportedOperationException

cloneParameters

public java.util.Map cloneParameters(java.util.Map parameters)
Description copied from interface: ConnectionDelegate
This method colones parameters to be internalized by the connection.

This method returns a clone of original parameteres.

This method must hide all sensitive parameters, such as passwords.

Returns:
cloned parameter map

cloneEnvironment

public java.util.Map cloneEnvironment(java.util.Map environment)
This method clones the LDAP context environment of this connection.

It will hide all sensitive parameters.

Returns:
cloned environment map

xprintBody

protected void xprintBody(XmlPrintWriter out)
Description copied from class: ConnectionManager
This method prints the connection manager XML tag body.
Overrides:
xprintBody in class ConnectionManager

Skip navigation links