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;
}
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());
}
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;
}
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;
}
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());
}
Aggregations