Examples of RedisConnectionFailureException


Examples of org.springframework.data.keyvalue.redis.RedisConnectionFailureException

  public static DataAccessException convertJedisAccessException(JedisException ex) {
    if (ex instanceof JedisDataException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof JedisConnectionException) {
      return new RedisConnectionFailureException(ex.getMessage(), ex);
    }

    // fallback to invalid data exception
    return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
  }
View Full Code Here

Examples of org.springframework.data.keyvalue.redis.RedisConnectionFailureException

    return new RedisSystemException("Unknown exception", ex);
  }

  static DataAccessException convertJedisAccessException(IOException ex) {
    if (ex instanceof UnknownHostException) {
      return new RedisConnectionFailureException("Unknown host " + ex.getMessage(), ex);
    }
    return new RedisConnectionFailureException("Could not connect to Redis server", ex);
  }
View Full Code Here

Examples of org.springframework.data.keyvalue.redis.RedisConnectionFailureException

    }
    return new RedisConnectionFailureException("Could not connect to Redis server", ex);
  }

  static DataAccessException convertJedisAccessException(TimeoutException ex) {
    throw new RedisConnectionFailureException("Jedis pool timed out. Could not get Redis Connection", ex);
  }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

  public void redisIsDown() throws Exception {
    RedisConnection redisConnection = mock(RedisConnection.class);
    RedisConnectionFactory redisConnectionFactory = mock(RedisConnectionFactory.class);
    given(redisConnectionFactory.getConnection()).willReturn(redisConnection);
    given(redisConnection.info()).willThrow(
        new RedisConnectionFailureException("Connection failed"));
    RedisHealthIndicator healthIndicator = new RedisHealthIndicator(
        redisConnectionFactory);

    Health health = healthIndicator.health();
    assertEquals(Status.DOWN, health.getStatus());
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

      if (dbIndex > 0) {
        connection.select(dbIndex);
      }
      return connection;
    } catch (RedisException e) {
      throw new RedisConnectionFailureException("Unable to connect to Redis on " + getHostName() + ":" + getPort(), e);
    }
  }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

    if (ex instanceof RedisException) {
      return new RedisSystemException("Redis exception", ex);
    }

    if (ex instanceof ChannelException) {
      return new RedisConnectionFailureException("Redis connection failed", ex);
    }

    if (ex instanceof TimeoutException) {
      return new QueryTimeoutException("Redis command timed out", ex);
    }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

   * @param ex JRedis exception
   * @return converted exception
   */
  public static DataAccessException convertJredisAccessException(ClientRuntimeException ex) {
    if (ex instanceof NotConnectedException) {
      return new RedisConnectionFailureException(ex.getMessage(), ex);
    }
    return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
  }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

    }
    if (ex instanceof JedisDataException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof JedisConnectionException) {
      return new RedisConnectionFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof JedisException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof UnknownHostException) {
      return new RedisConnectionFailureException("Unknown host " + ex.getMessage(), ex);
    }
    if (ex instanceof IOException) {
      return new RedisConnectionFailureException("Could not connect to Redis server", ex);
    }

    return null;
  }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

  public static DataAccessException convertJedisAccessException(JedisException ex) {
    if (ex instanceof JedisDataException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof JedisConnectionException) {
      return new RedisConnectionFailureException(ex.getMessage(), ex);
    }

    // fallback to invalid data exception
    return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
  }
View Full Code Here

Examples of org.springframework.data.redis.RedisConnectionFailureException

    return null;
  }

  static DataAccessException convertJedisAccessException(IOException ex) {
    if (ex instanceof UnknownHostException) {
      return new RedisConnectionFailureException("Unknown host " + ex.getMessage(), ex);
    }
    return new RedisConnectionFailureException("Could not connect to Redis server", ex);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.