All Downloads are FREE. Search and download functionalities are using the official Maven repository.

apoc.redis.IRedisConnection Maven / Gradle / Ivy

package apoc.redis;

import io.lettuce.core.ScriptOutputType;

import java.util.List;
import java.util.Map;

public interface IRedisConnection extends AutoCloseable {
    // -- String
    T get(T key);
    T getSet(T key, T value);
    long append(T key, T value);
    long incrby(T key, long amount);

    // -- Hashes
    long hdel(T key, List fields);
    boolean hexists(T key, T field);
    T hget(T key, T field);
    long hincrby(T key, T field, long amount);
    boolean hset(T key, T field, T value);
    Map hgetall(T key);

    // -- Lists
    long push(T key, List values);
    T pop(T key);
    List lrange(T key, long start, long stop);

    // -- Sets
    long sadd(T key, List members);
    T spop(T key);
    long scard(T key);
    List smembers(T key);
    List sunion(List keys);

    // -- Sorted Sets
    long zadd(T key, Object... scoresAndMembers);
    long zcard(T key);
    List zrangebyscore(T source, long min, long max);
    long zrem(T source, List members);

    // -- Script
    T eval(String script, ScriptOutputType outputType, List keys, List values);

    // -- Key
    boolean copy(T source, T destination);
    long exists(List key);
    boolean pexpire(T key, long time, boolean isExpireAt);
    boolean persist(T key);
    long pttl(T key);

    // -- Server
    String info();
    String configSet(String parameter, String value);
    Map configGet(String parameter);
}