Search in sources :

Example 26 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class EhcacheTicketRegistryConfiguration method ehcacheTicketsCache.

@Lazy
@Autowired
@Bean
public EhCacheFactoryBean ehcacheTicketsCache(@Qualifier("cacheManager") final CacheManager manager) {
    final EhcacheProperties ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache();
    final EhCacheFactoryBean bean = new EhCacheFactoryBean();
    bean.setCacheName(ehcacheProperties.getCacheName());
    bean.setCacheEventListeners(Collections.singleton(ticketRMISynchronousCacheReplicator()));
    bean.setTimeToIdle(ehcacheProperties.getCacheTimeToIdle());
    bean.setTimeToLive(ehcacheProperties.getCacheTimeToLive());
    bean.setCacheManager(manager);
    bean.setBootstrapCacheLoader(ticketCacheBootstrapCacheLoader());
    bean.setDiskExpiryThreadIntervalSeconds(ehcacheProperties.getDiskExpiryThreadIntervalSeconds());
    bean.setEternal(ehcacheProperties.isEternal());
    bean.setMaxEntriesLocalHeap(ehcacheProperties.getMaxElementsInMemory());
    bean.setMaxEntriesInCache(ehcacheProperties.getMaxElementsInCache());
    bean.setMaxEntriesLocalDisk(ehcacheProperties.getMaxElementsOnDisk());
    bean.setMemoryStoreEvictionPolicy(ehcacheProperties.getMemoryStoreEvictionPolicy());
    final PersistenceConfiguration c = new PersistenceConfiguration();
    c.strategy(ehcacheProperties.getPersistence());
    c.setSynchronousWrites(ehcacheProperties.isSynchronousWrites());
    bean.persistence(c);
    return bean;
}
Also used : EhCacheFactoryBean(org.springframework.cache.ehcache.EhCacheFactoryBean) PersistenceConfiguration(net.sf.ehcache.config.PersistenceConfiguration) EhcacheProperties(org.apereo.cas.configuration.model.support.ehcache.EhcacheProperties) Lazy(org.springframework.context.annotation.Lazy) Autowired(org.springframework.beans.factory.annotation.Autowired) EhCacheFactoryBean(org.springframework.cache.ehcache.EhCacheFactoryBean) EhCacheManagerFactoryBean(org.springframework.cache.ehcache.EhCacheManagerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 27 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class CasCookieConfiguration method ticketGrantingTicketCookieGenerator.

@Autowired
@Bean
@RefreshScope
public CookieRetrievingCookieGenerator ticketGrantingTicketCookieGenerator(@Qualifier("cookieCipherExecutor") final CipherExecutor cipherExecutor) {
    final TicketGrantingCookieProperties tgc = casProperties.getTgc();
    final int rememberMeMaxAge = Long.valueOf(tgc.getRememberMeMaxAge()).intValue();
    return new TGCCookieRetrievingCookieGenerator(cookieValueManager(cipherExecutor), tgc.getName(), tgc.getPath(), tgc.getDomain(), rememberMeMaxAge, tgc.isSecure(), tgc.getMaxAge());
}
Also used : TGCCookieRetrievingCookieGenerator(org.apereo.cas.web.support.TGCCookieRetrievingCookieGenerator) TicketGrantingCookieProperties(org.apereo.cas.configuration.model.support.cookie.TicketGrantingCookieProperties) 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 28 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class SamlConfiguration method samlValidateController.

@Autowired
@Bean
public SamlValidateController samlValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor) {
    final SamlValidateController c = new SamlValidateController();
    c.setValidationSpecification(cas20WithoutProxyProtocolValidationSpecification);
    c.setSuccessView(casSamlServiceSuccessView());
    c.setFailureView(casSamlServiceFailureView());
    c.setProxyHandler(proxy20Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView);
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
Also used : SamlValidateController(org.apereo.cas.support.saml.web.SamlValidateController) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) OpenSamlConfigBean(org.apereo.cas.support.saml.OpenSamlConfigBean) Bean(org.springframework.context.annotation.Bean)

Example 29 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class MemcachedTicketRegistryConfiguration method ticketRegistry.

@Autowired
@Bean
public TicketRegistry ticketRegistry(@Qualifier("memcachedClient") final MemcachedClientIF memcachedClientIF) {
    final MemCacheTicketRegistry registry = new MemCacheTicketRegistry(memcachedClientIF);
    registry.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(casProperties.getTicket().getRegistry().getMemcached().getCrypto()));
    return registry;
}
Also used : MemCacheTicketRegistry(org.apereo.cas.ticket.registry.MemCacheTicketRegistry) Autowired(org.springframework.beans.factory.annotation.Autowired) MemcachedClientFactoryBean(net.spy.memcached.spring.MemcachedClientFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 30 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class LdapMonitorConfiguration method pooledLdapConnectionFactoryMonitor.

@Autowired
@Bean
public Monitor pooledLdapConnectionFactoryMonitor(@Qualifier("pooledConnectionFactoryMonitorExecutorService") final ExecutorService executor) {
    final MonitorProperties.Ldap ldap = casProperties.getMonitor().getLdap();
    final PooledConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    return new PooledLdapConnectionFactoryMonitor(executor, Long.valueOf(ldap.getMaxWait()).intValue(), connectionFactory, new SearchValidator());
}
Also used : SearchValidator(org.ldaptive.pool.SearchValidator) PooledConnectionFactory(org.ldaptive.pool.PooledConnectionFactory) PooledLdapConnectionFactoryMonitor(org.apereo.cas.monitor.PooledLdapConnectionFactoryMonitor) MonitorProperties(org.apereo.cas.configuration.model.core.monitor.MonitorProperties) Autowired(org.springframework.beans.factory.annotation.Autowired) ThreadPoolExecutorFactoryBean(org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Autowired (org.springframework.beans.factory.annotation.Autowired)38 Bean (org.springframework.context.annotation.Bean)23 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)9 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)5 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)3 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)3 V3ProxyValidateController (org.apereo.cas.web.v3.V3ProxyValidateController)2 V3ServiceValidateController (org.apereo.cas.web.v3.V3ServiceValidateController)2 Logger (org.slf4j.Logger)2 Qualifier (org.springframework.beans.factory.annotation.Qualifier)2 File (java.io.File)1 Constructor (java.lang.reflect.Constructor)1 Executable (java.lang.reflect.Executable)1 Field (java.lang.reflect.Field)1 Parameter (java.lang.reflect.Parameter)1 Properties (java.util.Properties)1 Resource (javax.annotation.Resource)1 Inject (javax.inject.Inject)1 PersistenceConfiguration (net.sf.ehcache.config.PersistenceConfiguration)1 CacheEntryFactory (net.sf.ehcache.constructs.blocking.CacheEntryFactory)1