List of usage examples for org.springframework.data.redis.connection RedisConnection renameNX
@Nullable Boolean renameNX(byte[] sourceKey, byte[] targetKey);
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Rename key {@code oleName} to {@code newName} only if {@code newName} does not exist. * <p>/*from w w w . ja v a 2 s . c o m*/ * See http://redis.io/commands/renamenx * * @param oldName oldName * @param newName newName * @return Boolean */ public static Boolean renameNX(byte[] oldName, byte[] newName) { return redisTemplate.execute(new RedisCallback<Boolean>() { @Override public Boolean doInRedis(RedisConnection redis) throws DataAccessException { return redis.renameNX(oldName, newName); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Rename key {@code oleName} to {@code newName} only if {@code newName} does not exist. * <p>//from w w w .j ava 2s . c o m * See http://redis.io/commands/renamenx * * @param oldName oldName * @param newName newName * @return Boolean */ public Boolean renameNX(byte[] oldName, byte[] newName) { return redisTemplate.execute(new RedisCallback<Boolean>() { @Override public Boolean doInRedis(RedisConnection redis) throws DataAccessException { return redis.renameNX(oldName, newName); } }); }