Search in sources :

Example 1 with PersonDirectoryAttributeRepositoryPlanConfigurer

use of org.apereo.cas.persondir.PersonDirectoryAttributeRepositoryPlanConfigurer in project cas by apereo.

the class CasPersonDirectoryConfiguration method attributeRepositories.

@ConditionalOnMissingBean(name = "attributeRepositories")
@Bean
@RefreshScope
public List<IPersonAttributeDao> attributeRepositories() {
    final List<IPersonAttributeDao> list = new ArrayList<>();
    list.addAll(ldapAttributeRepositories());
    list.addAll(jdbcAttributeRepositories());
    list.addAll(jsonAttributeRepositories());
    list.addAll(groovyAttributeRepositories());
    list.addAll(grouperAttributeRepositories());
    list.addAll(restfulAttributeRepositories());
    list.addAll(scriptedAttributeRepositories());
    list.addAll(stubAttributeRepositories());
    final List<PersonDirectoryAttributeRepositoryPlanConfigurer> configurers = ObjectUtils.defaultIfNull(attributeRepositoryConfigurers.getIfAvailable(), new ArrayList<>());
    final PersonDirectoryAttributeRepositoryPlan plan = new DefaultPersonDirectoryAttributeRepositoryPlan();
    configurers.forEach(c -> c.configureAttributeRepositoryPlan(plan));
    list.addAll(plan.getAttributeRepositories());
    OrderComparator.sort(list);
    LOGGER.debug("Final list of attribute repositories is [{}]", list);
    return list;
}
Also used : IPersonAttributeDao(org.apereo.services.persondir.IPersonAttributeDao) PersonDirectoryAttributeRepositoryPlanConfigurer(org.apereo.cas.persondir.PersonDirectoryAttributeRepositoryPlanConfigurer) ArrayList(java.util.ArrayList) DefaultPersonDirectoryAttributeRepositoryPlan(org.apereo.cas.persondir.DefaultPersonDirectoryAttributeRepositoryPlan) PersonDirectoryAttributeRepositoryPlan(org.apereo.cas.persondir.PersonDirectoryAttributeRepositoryPlan) DefaultPersonDirectoryAttributeRepositoryPlan(org.apereo.cas.persondir.DefaultPersonDirectoryAttributeRepositoryPlan) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 DefaultPersonDirectoryAttributeRepositoryPlan (org.apereo.cas.persondir.DefaultPersonDirectoryAttributeRepositoryPlan)1 PersonDirectoryAttributeRepositoryPlan (org.apereo.cas.persondir.PersonDirectoryAttributeRepositoryPlan)1 PersonDirectoryAttributeRepositoryPlanConfigurer (org.apereo.cas.persondir.PersonDirectoryAttributeRepositoryPlanConfigurer)1 IPersonAttributeDao (org.apereo.services.persondir.IPersonAttributeDao)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