use of org.apereo.cas.configuration.model.support.hazelcast.HazelcastTicketRegistryProperties in project cas by apereo.
the class HazelcastTicketRegistryConfiguration method ticketRegistry.
@Autowired
@Bean
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
final HazelcastTicketRegistryProperties hz = casProperties.getTicket().getRegistry().getHazelcast();
final HazelcastTicketRegistry r = new HazelcastTicketRegistry(hazelcast(ticketCatalog), ticketCatalog, hz.getPageSize());
r.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(hz.getCrypto(), "hazelcast"));
return r;
}
use of org.apereo.cas.configuration.model.support.hazelcast.HazelcastTicketRegistryProperties in project cas by apereo.
the class HazelcastTicketRegistryConfiguration method buildHazelcastMapConfigurations.
private Map<String, MapConfig> buildHazelcastMapConfigurations(final TicketCatalog ticketCatalog) {
final Map<String, MapConfig> mapConfigs = new HashMap<>();
final HazelcastTicketRegistryProperties hz = casProperties.getTicket().getRegistry().getHazelcast();
final HazelcastConfigurationFactory factory = new HazelcastConfigurationFactory();
final Collection<TicketDefinition> definitions = ticketCatalog.findAll();
definitions.forEach(t -> {
final MapConfig mapConfig = factory.buildMapConfig(hz, t.getProperties().getStorageName(), t.getProperties().getStorageTimeout());
LOGGER.debug("Created Hazelcast map configuration for [{}]", t);
mapConfigs.put(t.getProperties().getStorageName(), mapConfig);
});
return mapConfigs;
}
use of org.apereo.cas.configuration.model.support.hazelcast.HazelcastTicketRegistryProperties in project cas by apereo.
the class HazelcastTicketRegistryConfiguration method getConfig.
private Config getConfig(final TicketCatalog ticketCatalog) {
final HazelcastTicketRegistryProperties hz = casProperties.getTicket().getRegistry().getHazelcast();
final Map<String, MapConfig> configs = buildHazelcastMapConfigurations(ticketCatalog);
final HazelcastConfigurationFactory factory = new HazelcastConfigurationFactory();
return factory.build(hz, configs);
}
Aggregations