List of usage examples for org.springframework.data.redis.connection RedisConnection restore
default void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(byte[])}. * <p>//w w w .j av a 2 s . c o m * See http://redis.io/commands/restore * * @param key key * @param ttlInMillis ttlInMillis * @param serializedValue serializedValue */ public static void restore(byte[] key, long ttlInMillis, byte[] serializedValue) { redisTemplate.execute(new RedisCallback<Void>() { @Override public Void doInRedis(RedisConnection redis) throws DataAccessException { redis.restore(key, ttlInMillis, serializedValue); return null; } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(byte[])}. * <p>/*from w w w. j av a 2 s . c om*/ * See http://redis.io/commands/restore * * @param key key * @param ttlInMillis ttlInMillis * @param serializedValue serializedValue */ public void restore(byte[] key, long ttlInMillis, byte[] serializedValue) { redisTemplate.execute(new RedisCallback<Void>() { @Override public Void doInRedis(RedisConnection redis) throws DataAccessException { redis.restore(key, ttlInMillis, serializedValue); return null; } }); }