Search in sources :

Example 1 with PooledLdapConnectionFactoryMonitor

use of org.apereo.cas.monitor.PooledLdapConnectionFactoryMonitor in project cas by apereo.

the class LdapMonitorConfiguration method pooledLdapConnectionFactoryMonitor.

@Autowired
@Bean
public Monitor pooledLdapConnectionFactoryMonitor(@Qualifier("pooledConnectionFactoryMonitorExecutorService") final ExecutorService executor) {
    final MonitorProperties.Ldap ldap = casProperties.getMonitor().getLdap();
    final PooledConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    return new PooledLdapConnectionFactoryMonitor(executor, Long.valueOf(ldap.getMaxWait()).intValue(), connectionFactory, new SearchValidator());
}
Also used : SearchValidator(org.ldaptive.pool.SearchValidator) PooledConnectionFactory(org.ldaptive.pool.PooledConnectionFactory) PooledLdapConnectionFactoryMonitor(org.apereo.cas.monitor.PooledLdapConnectionFactoryMonitor) MonitorProperties(org.apereo.cas.configuration.model.core.monitor.MonitorProperties) Autowired(org.springframework.beans.factory.annotation.Autowired) ThreadPoolExecutorFactoryBean(org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

MonitorProperties (org.apereo.cas.configuration.model.core.monitor.MonitorProperties)1 PooledLdapConnectionFactoryMonitor (org.apereo.cas.monitor.PooledLdapConnectionFactoryMonitor)1 PooledConnectionFactory (org.ldaptive.pool.PooledConnectionFactory)1 SearchValidator (org.ldaptive.pool.SearchValidator)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 Bean (org.springframework.context.annotation.Bean)1 ThreadPoolExecutorFactoryBean (org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean)1