Search in sources :

Example 1 with CouchbaseClientFactory

use of org.apereo.cas.couchbase.core.CouchbaseClientFactory in project cas by apereo.

the class CouchbaseServiceRegistryConfiguration method serviceRegistryCouchbaseClientFactory.

/**
 * Service registry couchbase client factory couchbase client factory.
 *
 * @return the couchbase client factory
 */
@RefreshScope
@Bean
public CouchbaseClientFactory serviceRegistryCouchbaseClientFactory() {
    final CouchbaseServiceRegistryProperties couchbase = casProperties.getServiceRegistry().getCouchbase();
    final Set<String> nodes = StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
    return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword(), Beans.newDuration(couchbase.getTimeout()).toMillis(), CouchbaseServiceRegistry.UTIL_DOCUMENT, CouchbaseServiceRegistry.ALL_VIEWS);
}
Also used : CouchbaseServiceRegistryProperties(org.apereo.cas.configuration.model.support.couchbase.serviceregistry.CouchbaseServiceRegistryProperties) CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with CouchbaseClientFactory

use of org.apereo.cas.couchbase.core.CouchbaseClientFactory 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)

Example 3 with CouchbaseClientFactory

use of org.apereo.cas.couchbase.core.CouchbaseClientFactory in project cas by apereo.

the class CouchbaseAuthenticationConfiguration method authenticationCouchbaseClientFactory.

@ConditionalOnMissingBean(name = "authenticationCouchbaseClientFactory")
@RefreshScope
@Bean
public CouchbaseClientFactory authenticationCouchbaseClientFactory() {
    final CouchbaseAuthenticationProperties couchbase = casProperties.getAuthn().getCouchbase();
    final Set<String> nodes = org.springframework.util.StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
    return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword());
}
Also used : CouchbaseClientFactory(org.apereo.cas.couchbase.core.CouchbaseClientFactory) CouchbaseAuthenticationProperties(org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

CouchbaseClientFactory (org.apereo.cas.couchbase.core.CouchbaseClientFactory)3 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)3 Bean (org.springframework.context.annotation.Bean)3 CouchbaseAuthenticationProperties (org.apereo.cas.configuration.model.support.couchbase.authentication.CouchbaseAuthenticationProperties)1 CouchbaseServiceRegistryProperties (org.apereo.cas.configuration.model.support.couchbase.serviceregistry.CouchbaseServiceRegistryProperties)1 CouchbaseTicketRegistryProperties (org.apereo.cas.configuration.model.support.couchbase.ticketregistry.CouchbaseTicketRegistryProperties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1