Search in sources :

Example 1 with CachingTicketRegistry

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

the class CasCoreTicketsConfiguration method ticketRegistry.

@ConditionalOnMissingBean(name = "ticketRegistry")
@Bean
public TicketRegistry ticketRegistry() {
    LOGGER.warn("Runtime memory is used as the persistence storage for retrieving and managing tickets. " + "Tickets that are issued during runtime will be LOST when the web server is restarted. This MAY impact SSO functionality.");
    final TicketRegistryProperties.InMemory mem = casProperties.getTicket().getRegistry().getInMemory();
    final CipherExecutor cipher = CoreTicketUtils.newTicketRegistryCipherExecutor(mem.getCrypto(), "inMemory");
    if (mem.isCache()) {
        final LogoutManager logoutManager = applicationContext.getBean("logoutManager", LogoutManager.class);
        return new CachingTicketRegistry(cipher, logoutManager);
    }
    return new DefaultTicketRegistry(mem.getInitialCapacity(), mem.getLoadFactor(), mem.getConcurrency(), cipher);
}
Also used : CipherExecutor(org.apereo.cas.CipherExecutor) ProtocolTicketCipherExecutor(org.apereo.cas.util.cipher.ProtocolTicketCipherExecutor) DefaultTicketRegistry(org.apereo.cas.ticket.registry.DefaultTicketRegistry) LogoutManager(org.apereo.cas.logout.LogoutManager) CachingTicketRegistry(org.apereo.cas.ticket.registry.CachingTicketRegistry) TicketRegistryProperties(org.apereo.cas.configuration.model.core.ticket.registry.TicketRegistryProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

CipherExecutor (org.apereo.cas.CipherExecutor)1 TicketRegistryProperties (org.apereo.cas.configuration.model.core.ticket.registry.TicketRegistryProperties)1 LogoutManager (org.apereo.cas.logout.LogoutManager)1 CachingTicketRegistry (org.apereo.cas.ticket.registry.CachingTicketRegistry)1 DefaultTicketRegistry (org.apereo.cas.ticket.registry.DefaultTicketRegistry)1 ProtocolTicketCipherExecutor (org.apereo.cas.util.cipher.ProtocolTicketCipherExecutor)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1