private static ClientOptions.Builder initializeClientOptionsBuilder(final BaseRedisProperties redis) {
        val cluster = isRedisClusteringEnabled(redis);
        if (cluster) {
            val refreshBuilder = ClusterTopologyRefreshOptions.builder()
                .dynamicRefreshSources(redis.getCluster().isDynamicRefreshSources());
            if (StringUtils.hasText(redis.getCluster().getTopologyRefreshPeriod())) {
                refreshBuilder.enablePeriodicRefresh(Beans.newDuration(redis.getCluster().getTopologyRefreshPeriod()));
            }
            if (redis.getCluster().isAdaptiveTopologyRefresh()) {
                refreshBuilder.enableAllAdaptiveRefreshTriggers();
            }
            val clusterClientOptionsBuilder = ClusterClientOptions.builder();
            return clusterClientOptionsBuilder.topologyRefreshOptions(refreshBuilder.build());
        }
        return ClientOptions.builder();
    }
New client options.

@param redis         the redis
@param casSslContext the cas ssl context
@return the client options
@throws Exception the exception
support/cas-server-support-redis-core/src/main/java/org/apereo/cas/redis/core/RedisObjectFactory.java