Search in sources :

Example 1 with CouchbaseTicketRegistryProperties

use of org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties in project cas by apereo.

the class CouchbaseTicketRegistryConfiguration method ticketRegistry.

@RefreshScope
@Bean
public TicketRegistry ticketRegistry() {
    final CouchbaseTicketRegistryProperties couchbase = casProperties.getTicket().getRegistry().getCouchbase();
    final CouchbaseTicketRegistry c = new CouchbaseTicketRegistry(ticketRegistryCouchbaseClientFactory(), couchbase.isQueryEnabled());
    c.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(couchbase.getCrypto()));
    return c;
}
Also used : CouchbaseTicketRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties) CouchbaseTicketRegistry(org.apereo.cas.ticket.registry.CouchbaseTicketRegistry) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with CouchbaseTicketRegistryProperties

use of org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties in project cas by apereo.

the class CouchbaseTicketRegistryConfiguration method ticketRegistry.

@Autowired
@RefreshScope
@Bean
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
    final CouchbaseTicketRegistryProperties couchbase = casProperties.getTicket().getRegistry().getCouchbase();
    final CouchbaseTicketRegistry c = new CouchbaseTicketRegistry(ticketCatalog, ticketRegistryCouchbaseClientFactory());
    c.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(couchbase.getCrypto(), "couchbase"));
    return c;
}
Also used : CouchbaseTicketRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties) CouchbaseTicketRegistry(org.apereo.cas.ticket.registry.CouchbaseTicketRegistry) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 3 with CouchbaseTicketRegistryProperties

use of org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties in project cas by apereo.

the class CouchbaseTicketRegistryConfiguration method ticketRegistryCouchbaseClientFactory.

@RefreshScope
@Bean
public CouchbaseClientFactory ticketRegistryCouchbaseClientFactory() {
    final CouchbaseTicketRegistryProperties cb = casProperties.getTicket().getRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(cb.getNodeSet());
    return new CouchbaseClientFactory(nodes, cb.getBucket(), cb.getPassword(), Beans.newDuration(cb.getTimeout()).toMillis(), CouchbaseTicketRegistry.UTIL_DOCUMENT, CouchbaseTicketRegistry.ALL_VIEWS);
}
Also used : CouchbaseTicketRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties) CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

CouchbaseTicketRegistryProperties (org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties)3 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)3 Bean (org.springframework.context.annotation.Bean)3 CouchbaseTicketRegistry (org.apereo.cas.ticket.registry.CouchbaseTicketRegistry)2 CouchbaseClientFactory (org.apereo.cas.couchbase.core.CouchbaseClientFactory)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1