Search in sources :

Example 1 with MongoDbHealthIndicator

use of org.apereo.cas.monitor.MongoDbHealthIndicator in project cas by apereo.

the class MongoDbMonitoringConfiguration method mongoHealthIndicator.

@Bean
public HealthIndicator mongoHealthIndicator() {
    final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
    final MonitorProperties.MongoDb mongoProps = casProperties.getMonitor().getMongo();
    final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongoProps);
    return new MongoDbHealthIndicator(mongoTemplate, casProperties);
}
Also used : MongoDbHealthIndicator(org.apereo.cas.monitor.MongoDbHealthIndicator) MongoDbConnectionFactory(org.apereo.cas.mongo.MongoDbConnectionFactory) MongoTemplate(org.springframework.data.mongodb.core.MongoTemplate) MonitorProperties(org.apereo.cas.configuration.model.core.monitor.MonitorProperties) Bean(org.springframework.context.annotation.Bean)

Aggregations

MonitorProperties (org.apereo.cas.configuration.model.core.monitor.MonitorProperties)1 MongoDbConnectionFactory (org.apereo.cas.mongo.MongoDbConnectionFactory)1 MongoDbHealthIndicator (org.apereo.cas.monitor.MongoDbHealthIndicator)1 Bean (org.springframework.context.annotation.Bean)1 MongoTemplate (org.springframework.data.mongodb.core.MongoTemplate)1