edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector
Class LdapPoolVTStrategy

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.LdapPoolVTStrategy
All Implemented Interfaces:
LdapPoolStrategy

public class LdapPoolVTStrategy
extends Object
implements LdapPoolStrategy

Ldap pool strategy backed by the vt-ldap library.


Field Summary
private  int blockWaitTime
          Amount of time to wait, in milliseconds, if blocking when the pool is empty.
private  boolean blockWhenEmpty
          Whether to block when empty.
private  edu.vt.middleware.ldap.pool.LdapFactory<edu.vt.middleware.ldap.Ldap> ldapFactory
          Factory for making ldap objects.
private  edu.vt.middleware.ldap.pool.LdapPool<edu.vt.middleware.ldap.Ldap> ldapPool
          Underlying pool.
private  edu.vt.middleware.ldap.pool.LdapPoolConfig ldapPoolConfig
          Ldap pool configuration.
private  org.slf4j.Logger log
          Class logger.
 
Constructor Summary
LdapPoolVTStrategy()
          Default constructor.
 
Method Summary
 void checkIn(edu.vt.middleware.ldap.Ldap l)
          Return an ldap object.
 edu.vt.middleware.ldap.Ldap checkOut()
          Retrieve an ldap object.
 void initialize()
          Prepare the pool for use.
 void setBlockWaitTime(int waitTime)
          Sets the amount of time to wait, in milliseconds, if blocking when the pool is empty.
 void setBlockWhenEmpty(boolean block)
          Sets whether to block when the pool is empty.
 void setLdapFactory(edu.vt.middleware.ldap.pool.LdapFactory<edu.vt.middleware.ldap.Ldap> factory)
          Sets the ldap factory.
 void setLdapPoolConfig(edu.vt.middleware.ldap.pool.LdapPoolConfig config)
          Sets the ldap pool configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final org.slf4j.Logger log
Class logger.


ldapPool

private edu.vt.middleware.ldap.pool.LdapPool<edu.vt.middleware.ldap.Ldap> ldapPool
Underlying pool.


ldapPoolConfig

private edu.vt.middleware.ldap.pool.LdapPoolConfig ldapPoolConfig
Ldap pool configuration.


ldapFactory

private edu.vt.middleware.ldap.pool.LdapFactory<edu.vt.middleware.ldap.Ldap> ldapFactory
Factory for making ldap objects.


blockWhenEmpty

private boolean blockWhenEmpty
Whether to block when empty.


blockWaitTime

private int blockWaitTime
Amount of time to wait, in milliseconds, if blocking when the pool is empty. Default value: 0

Constructor Detail

LdapPoolVTStrategy

public LdapPoolVTStrategy()
Default constructor.

Method Detail

setLdapPoolConfig

public void setLdapPoolConfig(edu.vt.middleware.ldap.pool.LdapPoolConfig config)
Sets the ldap pool configuration.

Specified by:
setLdapPoolConfig in interface LdapPoolStrategy
Parameters:
config - to manage ldap pool with

setLdapFactory

public void setLdapFactory(edu.vt.middleware.ldap.pool.LdapFactory<edu.vt.middleware.ldap.Ldap> factory)
Sets the ldap factory.

Specified by:
setLdapFactory in interface LdapPoolStrategy
Parameters:
factory - to create ldap objects with

setBlockWhenEmpty

public void setBlockWhenEmpty(boolean block)
Sets whether to block when the pool is empty.

Specified by:
setBlockWhenEmpty in interface LdapPoolStrategy
Parameters:
block - when the pool is empty

setBlockWaitTime

public void setBlockWaitTime(int waitTime)
Sets the amount of time to wait, in milliseconds, if blocking when the pool is empty. A value of 0 means to wait indefinitely.

Parameters:
waitTime - amount of time to wait, in milliseconds, if blocking when the pool is empty

initialize

public void initialize()
Prepare the pool for use.

Specified by:
initialize in interface LdapPoolStrategy

checkOut

public edu.vt.middleware.ldap.Ldap checkOut()
                                     throws Exception
Retrieve an ldap object.

Specified by:
checkOut in interface LdapPoolStrategy
Returns:
ldap object
Throws:
Exception - thrown if there is a problem checking in an Ldap object

checkIn

public void checkIn(edu.vt.middleware.ldap.Ldap l)
             throws Exception
Return an ldap object.

Specified by:
checkIn in interface LdapPoolStrategy
Parameters:
l - the ldap object
Throws:
Exception - thrown if there is a problem checking out an Ldap object


Copyright © 1999-2012. All Rights Reserved.