Example usage for org.springframework.data.redis.connection RedisConnection scriptExists

List of usage examples for org.springframework.data.redis.connection RedisConnection scriptExists

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection scriptExists.

Prototype

@Nullable
List<Boolean> scriptExists(String... scriptShas);

Source Link

Document

Check if given scriptShas exist in script cache.

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Check if given {@code scriptShas} exist in script cache.
 * <p>/*  ww w  .  j  a v a 2  s  .  co  m*/
 * See http://redis.io/commands/script-exits
 * 
 * @param scriptShas scriptShas
 * @return one entry per given scriptSha in returned list.
 */
public static List<Boolean> scriptExists(String... scriptShas) {
    return redisTemplate.execute(new RedisCallback<List<Boolean>>() {
        @Override
        public List<Boolean> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.scriptExists(scriptShas);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Check if given {@code scriptShas} exist in script cache.
 * <p>//  w w w .ja v  a2  s  .  co  m
 * See http://redis.io/commands/script-exits
 * 
 * @param scriptShas scriptShas
 * @return one entry per given scriptSha in returned list.
 */
public List<Boolean> scriptExists(String... scriptShas) {
    return redisTemplate.execute(new RedisCallback<List<Boolean>>() {
        @Override
        public List<Boolean> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.scriptExists(scriptShas);
        }
    });
}