use of org.apereo.cas.monitor.TicketRegistryHealthIndicator in project cas by apereo.
the class CasCoreMonitorConfiguration method sessionHealthIndicator.
@ConditionalOnMissingBean(name = "sessionHealthIndicator")
@Bean
@ConditionalOnEnabledHealthIndicator("sessionHealthIndicator")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public HealthIndicator sessionHealthIndicator(@Qualifier(TicketRegistry.BEAN_NAME) final TicketRegistry ticketRegistry, final CasConfigurationProperties casProperties) {
val warnSt = casProperties.getMonitor().getSt().getWarn();
val warnTgt = casProperties.getMonitor().getTgt().getWarn();
if (warnSt.getThreshold() > 0 && warnTgt.getThreshold() > 0) {
LOGGER.debug("Configured session monitor with service ticket threshold [{}] and session threshold [{}]", warnSt.getThreshold(), warnTgt.getThreshold());
return new TicketRegistryHealthIndicator(ticketRegistry, warnSt.getThreshold(), warnTgt.getThreshold());
}
return () -> Health.up().build();
}
Aggregations