Search in sources :

Example 1 with MongoTicketRegistryProperties

use of org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoTicketRegistryProperties in project cas by apereo.

the class MongoDbTicketRegistryConfiguration method mongoDbTicketRegistryTemplate.

@ConditionalOnMissingBean(name = "mongoDbTicketRegistryTemplate")
@Bean
public MongoTemplate mongoDbTicketRegistryTemplate() {
    final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
    final MongoTicketRegistryProperties mongo = casProperties.getTicket().getRegistry().getMongo();
    return factory.buildMongoTemplate(mongo);
}
Also used : MongoTicketRegistryProperties(org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoTicketRegistryProperties) MongoDbConnectionFactory(org.apereo.cas.mongo.MongoDbConnectionFactory) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with MongoTicketRegistryProperties

use of org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoTicketRegistryProperties in project cas by apereo.

the class MongoDbTicketRegistryConfiguration method ticketRegistry.

@RefreshScope
@Bean
@Autowired
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
    final MongoTicketRegistryProperties mongo = casProperties.getTicket().getRegistry().getMongo();
    final MongoDbTicketRegistry registry = new MongoDbTicketRegistry(ticketCatalog, mongoDbTicketRegistryTemplate(), mongo.isDropCollection());
    registry.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(mongo.getCrypto(), "mongo"));
    return registry;
}
Also used : MongoTicketRegistryProperties(org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoTicketRegistryProperties) MongoDbTicketRegistry(org.apereo.cas.ticket.registry.MongoDbTicketRegistry) 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)

Aggregations

MongoTicketRegistryProperties (org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoTicketRegistryProperties)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 Bean (org.springframework.context.annotation.Bean)2 MongoDbConnectionFactory (org.apereo.cas.mongo.MongoDbConnectionFactory)1 MongoDbTicketRegistry (org.apereo.cas.ticket.registry.MongoDbTicketRegistry)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1