use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbCloudConfigBootstrapConfiguration method mongoDbCloudConfigurationTemplate.
@Bean
public MongoTemplate mongoDbCloudConfigurationTemplate() {
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final String uri = environment.getProperty("cas.spring.cloud.mongo.uri");
return factory.buildMongoTemplate(uri);
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class CasMetricsRepositoryConfiguration method mongoDbMetricWriter.
@ConditionalOnProperty(prefix = "cas.metrics.mongo", name = "collection")
@Bean
@ExportMetricWriter
public GaugeWriter mongoDbMetricWriter() {
final MetricsProperties.MongoDb prop = casProperties.getMetrics().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(prop);
return metric -> {
final MongoDbMetric metrics = new MongoDbMetric(metric);
mongoTemplate.save(metrics, prop.getCollection());
};
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbEventsConfiguration method mongoEventsTemplate.
@RefreshScope
@Bean
public MongoTemplate mongoEventsTemplate() {
final EventsProperties.MongoDb mongo = casProperties.getEvents().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class GoogleAuthenticatorMongoDbConfiguration method mongoDbGoogleAuthenticatorTemplate.
@RefreshScope
@Bean
public MongoTemplate mongoDbGoogleAuthenticatorTemplate() {
final GAuthMultifactorProperties.MongoDb mongo = casProperties.getAuthn().getMfa().getGauth().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
use of org.apereo.cas.mongo.MongoDbConnectionFactory in project cas by apereo.
the class MongoDbMultifactorAuthenticationTrustConfiguration method mongoMfaTrustedAuthnTemplate.
@RefreshScope
@Bean
public MongoTemplate mongoMfaTrustedAuthnTemplate() {
final TrustedDevicesMultifactorProperties.MongoDb mongo = casProperties.getAuthn().getMfa().getTrusted().getMongo();
final MongoDbConnectionFactory factory = new MongoDbConnectionFactory();
final MongoTemplate mongoTemplate = factory.buildMongoTemplate(mongo);
factory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
return mongoTemplate;
}
Aggregations