Example usage for Java org.springframework.data.redis.connection RedisConnection fields, constructors, methods, implement or subclass
The text is from its open source code.
Long | append(byte[] key, byte[] value) Append a value to key . |
void | bgReWriteAof() Start an Append Only File rewrite process on server. |
void | bgSave() Start background saving of db on server. |
void | bgWriteAof() Start an Append Only File rewrite process on server. |
Long | bitCount(byte[] key) Count the number of set bits (population counting) in value stored at key . |
Long | bitCount(byte[] key, long start, long end) Count the number of set bits (population counting) of value stored at key between start and end . |
Long | bitOp(BitOperation op, byte[] destination, byte[]... keys) Perform bitwise operations between strings. |
List | bLPop(int timeout, byte[]... keys) Removes and returns first element from lists stored at keys . |
List | bRPop(int timeout, byte[]... keys) Removes and returns last element from lists stored at keys . |
byte[] | bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) Remove the last element from list at srcKey , append it to dstKey and return its value. |
void | close() Closes (or quits) the connection. |
List | closePipeline() Executes the commands in the pipeline and returns their result. |
Long | dbSize() Get the total number of available keys in currently selected database. |
Long | decr(byte[] key) Decrement an integer value stored as string value of key by 1. |
Long | decrBy(byte[] key, long value) Decrement an integer value stored as string value of key by value . |
Long | del(byte[]... keys) Delete given keys . |
void | discard() Discard all commands issued after #multi() . |
byte[] | dump(byte[] key) Retrieve serialized version of the value stored at key . |
byte[] | echo(byte[] message) Returns message via server roundtrip. |
T | eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) Evaluate given script . |
T | evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) Evaluate given scriptSha . |
List | exec() Executes all queued commands in a transaction started with #multi() . |
Object | execute(String command, byte[]... args) 'Native' or 'raw' execution of the given command along-side the given arguments. |
Boolean | exists(byte[] key) Determine if given key exists. |
Boolean | expire(byte[] key, long seconds) Set time to live for given key in seconds. |
Boolean | expireAt(byte[] key, long unixTime) Set the expiration for given key as a UNIX timestamp. |
void | flushAll() Delete all all keys from all databases. |
void | flushDb() Delete all keys of the currently selected database. |
byte[] | get(byte[] key) Get the value of key . |
Boolean | getBit(byte[] key, long offset) Get the bit value at offset of value at key . |
List | getClientList() Request information and statistics about connected clients. |
String | getClientName() Returns the name of the current connection. |
Properties | getConfig(String pattern) Load configuration parameters for given pattern from server. |
Object | getNativeConnection() Returns the native connection (the underlying library/driver object). |
byte[] | getRange(byte[] key, long start, long end) Get a substring of value of key between start and end . |
byte[] | getSet(byte[] key, byte[] value) Set value of key and return its old value. |
Subscription | getSubscription() Returns the current subscription for this connection or null if the connection is not subscribed. |
Long | hDel(byte[] key, byte[]... fields) Delete given hash fields . |
Boolean | hExists(byte[] key, byte[] field) Determine if given hash field exists. |
byte[] | hGet(byte[] key, byte[] field) Get value for given field from hash at key . |
Map | hGetAll(byte[] key) Get entire hash stored at key . |
Long | hIncrBy(byte[] key, byte[] field, long delta) Increment value of a hash field by the given delta . |
Set | hKeys(byte[] key) Get key set (fields) of hash at key . |
Long | hLen(byte[] key) Get size of hash at key . |
List | hMGet(byte[] key, byte[]... fields) Get values for given fields from hash at key . |
void | hMSet(byte[] key, Map Set multiple hash fields to multiple values using data provided in hashes |
Cursor | hScan(byte[] key, ScanOptions options) Use a Cursor to iterate over entries in hash at key . |
Boolean | hSet(byte[] key, byte[] field, byte[] value) Set the value of a hash field . |
Boolean | hSetNX(byte[] key, byte[] field, byte[] value) Set the value of a hash field only if field does not exist. |
List | hVals(byte[] key) Get entry set (values) of hash at field . |
Long | incr(byte[] key) Increment an integer value stored as string value of key by 1. |
Long | incrBy(byte[] key, long value) Increment an integer value stored of key by delta . |
Properties | info() Load default server information like
|
Properties | info(String section) Load server information for given selection . |
boolean | isClosed() Indicates whether the underlying connection is closed or not. |
boolean | isSubscribed() Indicates whether the current connection is subscribed (to at least one channel) or not. |
Set | keys(byte[] pattern) Find all keys matching the given pattern . |
void | killClient(String host, int port) Closes a given client connection identified by host:port . |
Long | lastSave() Get time of last #bgSave() operation in seconds. |
byte[] | lIndex(byte[] key, long index) Get element at index form list at key . |
Long | lInsert(byte[] key, Position where, byte[] pivot, byte[] value) Insert value Position#BEFORE or Position#AFTER existing pivot for key . |
Long | lLen(byte[] key) Get the size of list stored at key . |
byte[] | lPop(byte[] key) Removes and returns first element in list stored at key . |
Long | lPush(byte[] key, byte[]... values) Prepend values to key . |
Long | lPushX(byte[] key, byte[] value) Prepend values to key only if the list exists. |
List | lRange(byte[] key, long start, long end) Get elements between start and end from list at key . |
Long | lRem(byte[] key, long count, byte[] value) Removes the first count occurrences of value from the list stored at key . |
void | lSet(byte[] key, long index, byte[] value) Set the value list element at index . |
void | lTrim(byte[] key, long start, long end) Trim list at key to elements between start and end . |
List | mGet(byte[]... keys) Get multiple keys . |
void | migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option) Atomically transfer a key from a source Redis instance to a destination Redis instance. |
void | migrate(byte[] key, RedisNode target, int dbIndex, @Nullable MigrateOption option, long timeout) Atomically transfer a key from a source Redis instance to a destination Redis instance. |
Boolean | move(byte[] key, int dbIndex) Move given key to database with index . |
Boolean | mSet(Map Set multiple keys to multiple values using key-value pairs provided in tuple . |
Boolean | mSetNX(Map Set multiple keys to multiple values using key-value pairs provided in tuple only if the provided key does not exist. |
void | multi() Mark the start of a transaction block. |
void | openPipeline() Activates the pipeline mode for this connection. |
Boolean | persist(byte[] key) Remove the expiration from given key . |
Boolean | pExpire(byte[] key, long millis) Set time to live for given key in milliseconds. |
Boolean | pExpireAt(byte[] key, long unixTimeInMillis) Set the expiration for given key as a UNIX timestamp in milliseconds. |
Long | pfAdd(byte[] key, byte[]... values) Adds given values to the HyperLogLog stored at given key . |
Long | pfCount(byte[]... keys) Return the approximated cardinality of the structures observed by the HyperLogLog at key(s) . |
void | pfMerge(byte[] destinationKey, byte[]... sourceKeys) Merge N different HyperLogLogs at sourceKeys into a single destinationKey . |
String | ping() Test connection. |
Boolean | pSetEx(byte[] key, long milliseconds, byte[] value) Set the value and expiration in milliseconds for key . |
void | pSubscribe(MessageListener listener, byte[]... patterns) Subscribes the connection to all channels matching the given patterns. |
Long | pTtl(byte[] key) Get the precise time to live for key in milliseconds. |
Long | publish(byte[] channel, byte[] message) Publishes the given message to the given channel. |
byte[] | randomKey() Return a random key from the keyspace. |
void | rename(byte[] sourceKey, byte[] targetKey) Rename key sourceKey to targetKey . |
Boolean | renameNX(byte[] sourceKey, byte[] targetKey) Rename key sourceKey to targetKey only if targetKey does not exist. |
void | resetConfigStats() Reset statistic counters on server. |
void | restore(byte[] key, long ttlInMillis, byte[] serializedValue) Create key using the serializedValue , previously obtained using #dump(byte[]) . |
byte[] | rPop(byte[] key) Removes and returns last element in list stored at key . |
byte[] | rPopLPush(byte[] srcKey, byte[] dstKey) Remove the last element from list at srcKey , append it to dstKey and return its value. |
Long | rPush(byte[] key, byte[]... values) Append values to key . |
Long | rPushX(byte[] key, byte[] value) Append values to key only if the list exists. |
Long | sAdd(byte[] key, byte[]... values) Add given values to set at key . |
void | save() Synchronous save current db snapshot on server. |
Cursor | scan(ScanOptions options) Use a Cursor to iterate over keys. |
Long | sCard(byte[] key) Get size of set at key . |
List | scriptExists(String... scriptShas) Check if given scriptShas exist in script cache. |
void | scriptFlush() Flush lua script cache. |
void | scriptKill() Kill current lua script execution. |
String | scriptLoad(byte[] script) Load lua script into scripts cache, without executing it. Execute the script by calling #evalSha(byte[], ReturnType, int, byte[]...) . |
Set | sDiff(byte[]... keys) Diff all sets for given keys . |
Long | sDiffStore(byte[] destKey, byte[]... keys) Diff all sets for given keys and store result in destKey . |
void | select(int dbIndex) Select the DB with given positive dbIndex . |
Boolean | set(byte[] key, byte[] value) Set value for key . |
Boolean | set(byte[] key, byte[] value, Expiration expiration, SetOption option) Set value for key applying timeouts from expiration if set and inserting/updating values depending on option . |
Boolean | setBit(byte[] key, long offset, boolean value) Sets the bit at offset in value stored at key . |
void | setClientName(byte[] name) Assign given name to current connection. |
void | setConfig(String param, String value) Set server configuration for param to value . |
Boolean | setEx(byte[] key, long seconds, byte[] value) Set the value and expiration in seconds for key . |
Boolean | setNX(byte[] key, byte[] value) Set value for key , only if key does not exist. |
void | setRange(byte[] key, byte[] value, long offset) Overwrite parts of key starting at the specified offset with given value . |
void | shutdown() Shutdown server. |
void | shutdown(ShutdownOption option) Shutdown server. |
Set | sInter(byte[]... keys) Returns the members intersecting all given sets at keys . |
Long | sInterStore(byte[] destKey, byte[]... keys) Intersect all given sets at keys and store result in destKey . |
Boolean | sIsMember(byte[] key, byte[] value) Check if set at key contains value . |
void | slaveOf(String host, int port) Change redis replication setting to new master. |
void | slaveOfNoOne() Change server into master. |
Set | sMembers(byte[] key) Get all elements of set at key . |
Boolean | sMove(byte[] srcKey, byte[] destKey, byte[] value) Move value from srcKey to destKey |
List | sort(byte[] key, SortParameters params) Sort the elements for key . |
Long | sort(byte[] key, SortParameters params, byte[] storeKey) Sort the elements for key and store result in storeKey . |
byte[] | sPop(byte[] key) Remove and return a random member from set at key . |
byte[] | sRandMember(byte[] key) Get random element from set at key . |
List | sRandMember(byte[] key, long count) Get count random elements from set at key . |
Long | sRem(byte[] key, byte[]... values) Remove given values from set at key and return the number of removed elements. |
Cursor | sScan(byte[] key, ScanOptions options) Use a Cursor to iterate over elements in set at key . |
Long | strLen(byte[] key) Get the length of the value stored at key . |
void | subscribe(MessageListener listener, byte[]... channels) Subscribes the connection to the given channels. |
Set | sUnion(byte[]... keys) Union all sets at given keys . |
Long | sUnionStore(byte[] destKey, byte[]... keys) Union all sets at given keys and store result in destKey . |
Long | time() Request server timestamp using TIME command. |
Long | ttl(byte[] key) Get the time to live for key in seconds. |
DataType | type(byte[] key) Determine the type stored at key . |
void | unwatch() Flushes all the previously #watch(byte[]...) keys. |
void | watch(byte[]... keys) Watch given keys for modifications during transaction started with #multi() . |
Boolean | zAdd(byte[] key, double score, byte[] value) Add value to a sorted set at key , or update its score if it already exists. |
Long | zAdd(byte[] key, Set Add tuples to a sorted set at key , or update its score if it already exists. |
Long | zCard(byte[] key) Get the size of sorted set with key . |
Long | zCount(byte[] key, double min, double max) Count number of elements within sorted set with scores between min and max . |
Long | zCount(byte[] key, Range range) Count number of elements within sorted set with scores between Range#min and Range#max . |
Double | zIncrBy(byte[] key, double increment, byte[] value) Increment the score of element with value in sorted set by increment . |
Long | zInterStore(byte[] destKey, byte[]... sets) Intersect sorted sets and store result in destination key . |
Long | zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Intersect sorted sets and store result in destination key . |
Set | zRange(byte[] key, long start, long end) Get elements between start and end from sorted set. |
Set | zRangeByLex(byte[] key, Range range) Get all the elements in Range from the sorted set at key in lexicographical ordering. |
Set | zRangeByLex(byte[] key) Get all the elements in the sorted set at key in lexicographical ordering. |
Set | zRangeByLex(byte[] key, Range range, Limit limit) Get all the elements in Range from the sorted set at key in lexicographical ordering. |
Set | zRangeByScore(byte[] key, double min, double max) Get elements where score is between min and max from sorted set. |
Set | zRangeByScore(byte[] key, double min, double max, long offset, long count) Get elements in range from start to end where score is between min and max from sorted set. |
Set | zRangeByScore(byte[] key, Range range) Get elements where score is between Range#min and Range#max from sorted set. |
Set | zRangeByScoreWithScores(byte[] key, double min, double max) Get set of Tuple s where score is between min and max from sorted set. |
Set | zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) Get set of Tuple s in range from start to end where score is between min and max from sorted set. |
Set | zRangeByScoreWithScores(byte[] key, Range range) Get set of Tuple s where score is between Range#min and Range#max from sorted set. |
Set | zRangeWithScores(byte[] key, long start, long end) Get set of Tuple s between start and end from sorted set. |
Long | zRank(byte[] key, byte[] value) Determine the index of element with value in a sorted set. |
Long | zRem(byte[] key, byte[]... values) Remove values from sorted set. |
Long | zRemRange(byte[] key, long start, long end) Remove elements in range between start and end from sorted set with key . |
Long | zRemRangeByScore(byte[] key, double min, double max) Remove elements with scores between min and max from sorted set with key . |
Long | zRemRangeByScore(byte[] key, Range range) Remove elements with scores between Range#min and Range#max from sorted set with key . |
Set | zRevRange(byte[] key, long start, long end) Get elements in range from start to end from sorted set ordered from high to low. |
Set | zRevRangeByScore(byte[] key, double min, double max) Get elements where score is between min and max from sorted set ordered from high to low. |
Set | zRevRangeByScore(byte[] key, double min, double max, long offset, long count) Get elements in range from start to end where score is between min and max from sorted set ordered high -> low. |
Set | zRevRangeByScore(byte[] key, Range range) Get elements where score is between Range#min and Range#max from sorted set ordered from high to low. |
Set | zRevRangeByScoreWithScores(byte[] key, double min, double max) Get set of Tuple where score is between min and max from sorted set ordered from high to low. |
Set | zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) Get set of Tuple in range from start to end where score is between min and max from sorted set ordered high -> low. |
Set | zRevRangeByScoreWithScores(byte[] key, Range range) Get set of Tuple where score is between Range#min and Range#max from sorted set ordered from high to low. |
Set | zRevRangeWithScores(byte[] key, long start, long end) Get set of Tuple s in range from start to end from sorted set ordered from high to low. |
Long | zRevRank(byte[] key, byte[] value) Determine the index of element with value in a sorted set when scored high to low. |
Cursor | zScan(byte[] key, ScanOptions options) Use a Cursor to iterate over elements in sorted set at key . |
Double | zScore(byte[] key, byte[] value) Get the score of element with value from sorted set with key key . |
Long | zUnionStore(byte[] destKey, byte[]... sets) Union sorted sets and store result in destination key . |
Long | zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Union sorted sets and store result in destination key . |