@Override @SuppressWarnings("unchecked") public <K, V> Boolean execute(RedisOperations<K, V> operations) throws DataAccessException { operations.watch((K) key); if (expect.equals(getter.get())) { operations.multi(); setter.accept(update); if (updateSuccessful(operations.exec())) { return true; } } operations.unwatch(); return false; }
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (oldValue.equals(v)) { ops.multi(); put(key, newValue); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (value.equals(v)) { ops.multi(); remove(key); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public V execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (v != null) { ops.multi(); put(key, value); if (ops.exec(ops.getHashValueSerializer()) != null) { return v; } } else { return null; } } } });
@SuppressWarnings("unchecked") public Object execute(RedisOperations operations) throws DataAccessException { do { operations.watch(key); if (operations.hasKey(key)) { operations.multi(); operations.rename(key, newKey); } else { operations.multi(); } } while (operations.exec() == null); return null; } });
@Override public void watch(String key) { ops.watch(key); }
@Override @SuppressWarnings("unchecked") public <K, V> Boolean execute(RedisOperations<K, V> operations) throws DataAccessException { operations.watch((K) key); if (expect.equals(getter.get())) { operations.multi(); setter.accept(update); if (updateSuccessful(operations.exec())) { return true; } } operations.unwatch(); return false; }
@Override @SuppressWarnings("unchecked") public <K, V> Boolean execute(RedisOperations<K, V> operations) throws DataAccessException { operations.watch((K) key); if (expect.equals(getter.get())) { operations.multi(); setter.accept(update); if (updateSuccessful(operations.exec())) { return true; } } operations.unwatch(); return false; }
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (value.equals(v)) { ops.multi(); remove(key); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (oldValue.equals(v)) { ops.multi(); put(key, newValue); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (value.equals(v)) { ops.multi(); remove(key); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Boolean execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (oldValue.equals(v)) { ops.multi(); put(key, newValue); if (ops.exec(ops.getHashValueSerializer()) != null) { return true; } } else { return false; } } } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public V execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (v != null) { ops.multi(); put(key, value); if (ops.exec(ops.getHashValueSerializer()) != null) { return v; } } else { return null; } } } });
@SuppressWarnings("unchecked") public Object execute(RedisOperations operations) throws DataAccessException { do { operations.watch(key); if (operations.hasKey(key)) { operations.multi(); operations.rename(key, newKey); } else { operations.multi(); } } while (operations.exec() == null); return null; } });
@SuppressWarnings("unchecked") public Object execute(RedisOperations operations) throws DataAccessException { do { operations.watch(key); if (operations.hasKey(key)) { operations.multi(); operations.rename(key, newKey); } else { operations.multi(); } } while (operations.exec() == null); return null; } });
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public V execute(RedisOperations ops) { for (;;) { ops.watch(Collections.singleton(getKey())); V v = get(key); if (v != null) { ops.multi(); put(key, value); if (ops.exec(ops.getHashValueSerializer()) != null) { return v; } } else { return null; } } } });