Search in sources :

Example 11 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class CasCoreTicketsConfiguration method ticketCatalog.

@ConditionalOnMissingBean(name = "ticketCatalog")
@Autowired
@Bean
public TicketCatalog ticketCatalog(final List<TicketCatalogConfigurer> configurers) {
    final DefaultTicketCatalog plan = new DefaultTicketCatalog();
    configurers.forEach(c -> {
        final String name = StringUtils.removePattern(c.getClass().getSimpleName(), "\\$.+");
        LOGGER.debug("Configuring ticket metadata registration plan [{}]", name);
        c.configureTicketCatalog(plan);
    });
    return plan;
}
Also used : DefaultTicketCatalog(org.apereo.cas.ticket.DefaultTicketCatalog) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 12 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class CasCoreConfiguration method authenticationServiceSelectionPlan.

@ConditionalOnMissingBean(name = "authenticationServiceSelectionPlan")
@Autowired
@Bean
public AuthenticationServiceSelectionPlan authenticationServiceSelectionPlan(final List<AuthenticationServiceSelectionStrategyConfigurer> configurers) {
    final DefaultAuthenticationServiceSelectionPlan plan = new DefaultAuthenticationServiceSelectionPlan();
    configurers.forEach(c -> {
        final String name = StringUtils.removePattern(c.getClass().getSimpleName(), "\\$.+");
        LOGGER.debug("Configuring authentication request service selection strategy plan [{}]", name);
        c.configureAuthenticationServiceSelectionStrategy(plan);
    });
    return plan;
}
Also used : DefaultAuthenticationServiceSelectionPlan(org.apereo.cas.authentication.DefaultAuthenticationServiceSelectionPlan) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 13 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class CasCoreWebConfiguration method messageSource.

@RefreshScope
@Bean
public AbstractResourceBasedMessageSource messageSource() {
    final CasReloadableMessageBundle bean = new CasReloadableMessageBundle();
    bean.setDefaultEncoding(casProperties.getMessageBundle().getEncoding());
    bean.setCacheSeconds(casProperties.getMessageBundle().getCacheSeconds());
    bean.setFallbackToSystemLocale(casProperties.getMessageBundle().isFallbackSystemLocale());
    bean.setUseCodeAsDefaultMessage(casProperties.getMessageBundle().isUseCodeMessage());
    bean.setBasenames(casProperties.getMessageBundle().getBaseNames());
    return bean;
}
Also used : CasReloadableMessageBundle(org.apereo.cas.web.view.CasReloadableMessageBundle) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 14 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class AuthyAuthenticationEventExecutionPlanConfiguration method authyAuthenticatorAuthenticationProvider.

@Bean
@RefreshScope
public MultifactorAuthenticationProvider authyAuthenticatorAuthenticationProvider() {
    final AuthyMultifactorAuthenticationProvider p = new AuthyMultifactorAuthenticationProvider();
    p.setBypassEvaluator(authyBypassEvaluator());
    p.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
    p.setOrder(casProperties.getAuthn().getMfa().getAuthy().getRank());
    p.setId(casProperties.getAuthn().getMfa().getAuthy().getId());
    return p;
}
Also used : AuthyMultifactorAuthenticationProvider(org.apereo.cas.adaptors.authy.AuthyMultifactorAuthenticationProvider) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 15 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class CasSupportJdbcAuditConfiguration method inspektrAuditTransactionTemplate.

@Bean
public TransactionTemplate inspektrAuditTransactionTemplate() {
    final TransactionTemplate t = new TransactionTemplate(inspektrAuditTransactionManager());
    t.setIsolationLevelName(casProperties.getAudit().getJdbc().getIsolationLevelName());
    t.setPropagationBehaviorName(casProperties.getAudit().getJdbc().getPropagationBehaviorName());
    return t;
}
Also used : TransactionTemplate(org.springframework.transaction.support.TransactionTemplate) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

Bean (org.springframework.context.annotation.Bean)3865 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1065 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)444 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)389 ConditionalOnClass (org.springframework.boot.autoconfigure.condition.ConditionalOnClass)309 lombok.val (lombok.val)294 HashMap (java.util.HashMap)285 Lazy (org.springframework.context.annotation.Lazy)257 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)190 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)151 Map (java.util.Map)150 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)110 Properties (java.util.Properties)94 Autowired (org.springframework.beans.factory.annotation.Autowired)92 ArrayList (java.util.ArrayList)79 Primary (org.springframework.context.annotation.Primary)75 Qualifier (org.springframework.beans.factory.annotation.Qualifier)71 CamelContextAware (org.apache.camel.CamelContextAware)69 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)68 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)59