Search in sources :

Example 1 with LdapServiceRegistryDao

use of org.apereo.cas.adaptors.ldap.services.LdapServiceRegistryDao in project cas by apereo.

the class LdapServiceRegistryConfiguration method serviceRegistryDao.

@Bean
@RefreshScope
@Autowired
public ServiceRegistryDao serviceRegistryDao(@Qualifier("ldapServiceRegistryMapper") final LdapRegisteredServiceMapper mapper) {
    final LdapServiceRegistryProperties ldap = casProperties.getServiceRegistry().getLdap();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    return new LdapServiceRegistryDao(connectionFactory, ldap.getBaseDn(), mapper, ldap);
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) LdapServiceRegistryProperties(org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties) LdapServiceRegistryDao(org.apereo.cas.adaptors.ldap.services.LdapServiceRegistryDao) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

LdapServiceRegistryDao (org.apereo.cas.adaptors.ldap.services.LdapServiceRegistryDao)1 LdapServiceRegistryProperties (org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties)1 ConnectionFactory (org.ldaptive.ConnectionFactory)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1