class JedisSessionRepositoryFactory extends AbstractRedisSessionRepositoryFactory {

  @Override
  protected RedisFacade getRedisFacade(RedisConfiguration config) {
    JedisPoolConfig poolConfig = configurePool(config);
    switch (config.clusterMode) {
    case "SINGLE":
      return singleInstance(poolConfig, config);
    case "SENTINEL":
      return sentinelFacade(poolConfig, config);
    case "CLUSTER":
      return clusterFacade(poolConfig, config);
    default:
      throw new IllegalArgumentException("Unsupported redis mode: " + config);
    }
  }

}