Search in sources :

Example 1 with LdapServiceRegistryProperties

use of org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties 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)

Example 2 with LdapServiceRegistryProperties

use of org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties in project cas by apereo.

the class LdapServiceRegistryConfiguration method ldapServiceRegistry.

@Bean
@RefreshScope
public ServiceRegistry ldapServiceRegistry() {
    final LdapServiceRegistryProperties ldap = casProperties.getServiceRegistry().getLdap();
    final ConnectionFactory connectionFactory = LdapUtils.newLdaptivePooledConnectionFactory(ldap);
    return new LdapServiceRegistry(connectionFactory, ldap.getBaseDn(), ldapServiceRegistryMapper(), ldap);
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) LdapServiceRegistry(org.apereo.cas.adaptors.ldap.services.LdapServiceRegistry) LdapServiceRegistryProperties(org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

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