use of org.springframework.context.annotation.Bean in project cas by apereo.
the class CasSupportActionsAcceptableUsagePolicyLdapConfiguration method acceptableUsagePolicyRepository.
@RefreshScope
@Bean
public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository() {
final AcceptableUsagePolicyProperties.Ldap ldap = casProperties.getAcceptableUsagePolicy().getLdap();
final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
final LdapAcceptableUsagePolicyRepository r = new LdapAcceptableUsagePolicyRepository(ticketRegistrySupport, connectionFactory, ldap.getUserFilter(), ldap.getBaseDn());
r.setAupAttributeName(casProperties.getAcceptableUsagePolicy().getAupAttributeName());
return r;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class GoogleAuthenticatorJpaConfiguration method googleAuthenticatorEntityManagerFactory.
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean googleAuthenticatorEntityManagerFactory() {
final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean(new JpaConfigDataHolder(jpaGoogleAuthenticatorVendorAdapter(), "jpaGoogleAuthenticatorContext", jpaPackagesToScanGoogleAuthenticator(), dataSourceGoogleAuthenticator()), casProperties.getAuthn().getMfa().getGauth().getJpa().getDatabase());
bean.getJpaPropertyMap().put("hibernate.enable_lazy_load_no_trans", Boolean.TRUE);
return bean;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class GoogleAuthenticatorJpaConfiguration method transactionManagerGoogleAuthenticator.
@Autowired
@Bean
public PlatformTransactionManager transactionManagerGoogleAuthenticator(@Qualifier("googleAuthenticatorEntityManagerFactory") final EntityManagerFactory emf) {
final JpaTransactionManager mgmr = new JpaTransactionManager();
mgmr.setEntityManagerFactory(emf);
return mgmr;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class JpaEventsConfiguration method transactionManagerEvents.
@Autowired
@Bean
public PlatformTransactionManager transactionManagerEvents(@Qualifier("eventsEntityManagerFactory") final EntityManagerFactory emf) {
final JpaTransactionManager mgmr = new JpaTransactionManager();
mgmr.setEntityManagerFactory(emf);
return mgmr;
}
use of org.springframework.context.annotation.Bean in project cas by apereo.
the class CouchbaseTicketRegistryConfiguration method ticketRegistry.
@RefreshScope
@Bean
public TicketRegistry ticketRegistry() {
final CouchbaseTicketRegistryProperties couchbase = casProperties.getTicket().getRegistry().getCouchbase();
final CouchbaseTicketRegistry c = new CouchbaseTicketRegistry(ticketRegistryCouchbaseClientFactory(), couchbase.isQueryEnabled());
c.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(couchbase.getCrypto()));
return c;
}
Aggregations