Search in sources :

Example 1 with MemcachedTicketRegistry

use of org.apereo.cas.ticket.registry.MemcachedTicketRegistry in project cas by apereo.

the class MemcachedTicketRegistryConfiguration method ticketRegistry.

@Bean
public TicketRegistry ticketRegistry() {
    final MemcachedTicketRegistryProperties memcached = casProperties.getTicket().getRegistry().getMemcached();
    final MemcachedPooledClientConnectionFactory factory = new MemcachedPooledClientConnectionFactory(memcached, memcachedTicketRegistryTranscoder());
    final MemcachedTicketRegistry registry = new MemcachedTicketRegistry(factory.getObjectPool());
    final CipherExecutor cipherExecutor = CoreTicketUtils.newTicketRegistryCipherExecutor(memcached.getCrypto(), "memcached");
    registry.setCipherExecutor(cipherExecutor);
    return registry;
}
Also used : MemcachedTicketRegistry(org.apereo.cas.ticket.registry.MemcachedTicketRegistry) MemcachedPooledClientConnectionFactory(org.apereo.cas.memcached.MemcachedPooledClientConnectionFactory) CipherExecutor(org.apereo.cas.CipherExecutor) MemcachedTicketRegistryProperties(org.apereo.cas.configuration.model.support.memcached.MemcachedTicketRegistryProperties) Bean(org.springframework.context.annotation.Bean)

Example 2 with MemcachedTicketRegistry

use of org.apereo.cas.ticket.registry.MemcachedTicketRegistry in project cas by apereo.

the class MemcachedTicketRegistryConfiguration method ticketRegistry.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public TicketRegistry ticketRegistry(final CasConfigurationProperties casProperties, @Qualifier("memcachedTicketRegistryTranscoder") final Transcoder memcachedTicketRegistryTranscoder) {
    val memcached = casProperties.getTicket().getRegistry().getMemcached();
    val factory = new MemcachedPooledClientConnectionFactory(memcached, memcachedTicketRegistryTranscoder);
    val registry = new MemcachedTicketRegistry(factory.getObjectPool());
    val cipherExecutor = CoreTicketUtils.newTicketRegistryCipherExecutor(memcached.getCrypto(), "memcached");
    registry.setCipherExecutor(cipherExecutor);
    return registry;
}
Also used : lombok.val(lombok.val) MemcachedTicketRegistry(org.apereo.cas.ticket.registry.MemcachedTicketRegistry) MemcachedPooledClientConnectionFactory(org.apereo.cas.memcached.MemcachedPooledClientConnectionFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

MemcachedPooledClientConnectionFactory (org.apereo.cas.memcached.MemcachedPooledClientConnectionFactory)2 MemcachedTicketRegistry (org.apereo.cas.ticket.registry.MemcachedTicketRegistry)2 Bean (org.springframework.context.annotation.Bean)2 lombok.val (lombok.val)1 CipherExecutor (org.apereo.cas.CipherExecutor)1 MemcachedTicketRegistryProperties (org.apereo.cas.configuration.model.support.memcached.MemcachedTicketRegistryProperties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1