Search in sources :

Example 1 with UniqueTicketIdGeneratorConfigurer

use of org.apereo.cas.ticket.UniqueTicketIdGeneratorConfigurer in project cas by apereo.

the class CasCoreTicketIdGeneratorsConfiguration method uniqueIdGeneratorsMap.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public Map<String, UniqueTicketIdGenerator> uniqueIdGeneratorsMap(final ObjectProvider<List<UniqueTicketIdGeneratorConfigurer>> configurers) {
    val map = new HashMap<String, UniqueTicketIdGenerator>();
    configurers.ifAvailable(cfgs -> cfgs.forEach(c -> {
        val pair = c.buildUniqueTicketIdGenerators();
        pair.forEach(p -> map.put(p.getKey(), p.getValue()));
    }));
    return map;
}
Also used : lombok.val(lombok.val) CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) UniqueTicketIdGeneratorConfigurer(org.apereo.cas.ticket.UniqueTicketIdGeneratorConfigurer) lombok.val(lombok.val) ScopedProxyMode(org.springframework.context.annotation.ScopedProxyMode) UniqueTicketIdGenerator(org.apereo.cas.ticket.UniqueTicketIdGenerator) HashMap(java.util.HashMap) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Configuration(org.springframework.context.annotation.Configuration) ObjectProvider(org.springframework.beans.factory.ObjectProvider) List(java.util.List) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean) HashMap(java.util.HashMap) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 lombok.val (lombok.val)1 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)1 UniqueTicketIdGenerator (org.apereo.cas.ticket.UniqueTicketIdGenerator)1 UniqueTicketIdGeneratorConfigurer (org.apereo.cas.ticket.UniqueTicketIdGeneratorConfigurer)1 ObjectProvider (org.springframework.beans.factory.ObjectProvider)1 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1 Configuration (org.springframework.context.annotation.Configuration)1 ScopedProxyMode (org.springframework.context.annotation.ScopedProxyMode)1