K - V - public interface RedisAPI<K,V>
extends java.io.Closeable
支持的日志操作:restore, dump, execute, delete, expire, keys, hasKey, getExpire, rename, renameIfAbsent, sort, randomKey, persist, expireAt
支持的审计操作:put, delete, set, rename, persist, expireAt
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭相关连接资源
|
long |
delete(java.util.Collection<K> keys)
Delete given
keys. |
long |
delete(K key)
Delete given
key. |
void |
discard()
Discard all commands issued after
multi(). |
byte[] |
dump(K key)
Retrieve serialized version of the value stored at
key. |
<T> T |
execute(<any> action)
执行含有RedisConnection对象的回调方法
|
java.lang.Boolean |
expire(K key,
long timeout,
java.util.concurrent.TimeUnit unit)
Set time to live for given
key.. |
java.lang.Boolean |
expireAt(K key,
java.util.Date date)
Set the expiration for given
key as a date timestamp. |
java.lang.Long |
getExpire(K key)
Get the time to live for
key in seconds. |
java.lang.Long |
getExpire(K key,
java.util.concurrent.TimeUnit timeUnit)
Get the time to live for
key in and convert it to the given TimeUnit. |
<any> |
getHashKeySerializer() |
<any> |
getHashValueSerializer() |
<any> |
getKeySerializer() |
<any> |
getValueSerializer() |
java.lang.Boolean |
hasKey(K key)
Determine if given
key exists. |
java.util.Set<K> |
keys(K pattern)
Find all keys matching the given
pattern. |
void |
multi()
Mark the start of a transaction block.
|
<HK,HV> <any> |
opsForHash()
Returns the operations performed on hash values.
|
<any> |
opsForList()
Returns the operations performed on list values.
|
<any> |
opsForSet()
Returns the operations performed on set values.
|
<any> |
opsForValue()
Returns the operations performed on simple values (or Strings in Redis terminology).
|
<any> |
opsForZSet()
Returns the operations performed on zset values (also known as sorted sets).
|
<HK,HV> <any> |
opsHash(K key)
Returns the operations performed on hash values bound to the given key.
|
<any> |
opsList(K key)
Returns the operations performed on list values bound to the given key.
|
<any> |
opsSet(K key)
Returns the operations performed on set values bound to the given key.
|
<any> |
opsValue(K key)
Returns the operations performed on simple values (or Strings in Redis terminology) bound to the given key.
|
<any> |
opsZSet(K key)
Returns the operations performed on zset values (also known as sorted sets) bound to the given key.
|
java.lang.Boolean |
persist(K key)
Remove the expiration from given
key. |
K |
randomKey()
Return a random key from the keyspace.
|
void |
rename(K oldKey,
K newKey)
Rename key
oldKey to newKey. |
java.lang.Boolean |
renameIfAbsent(K oldKey,
K newKey)
Rename key
oleName to newKey only if newKey does not exist. |
void |
restore(K key,
byte[] value,
long timeToLive,
java.util.concurrent.TimeUnit unit)
|
RedisAPI<K,V> |
serializer(<any> defSerializer)
设置默认Serializer
|
RedisAPI<K,V> |
serializer(<any> keySerializer,
<any> valueSerializer)
设置key,value Serializer
|
RedisAPI<K,V> |
serializer(<any> keySerializer,
<any> valueSerializer,
<any> hashKeySerializer,
<any> hashValueSerializer)
设置key,value,hashKey,hashValue Serializer
|
java.util.List<V> |
sort(<any> query)
Sort the elements for
query. |
<T> java.util.List<T> |
sort(<any> query,
<any> resultSerializer)
Sort the elements for
query applying Serializer. |
<T> java.util.List<T> |
sort(<any> query,
<any> bulkMapper)
Sort the elements for
query applying BulkMapper. |
<T,S> java.util.List<T> |
sort(<any> query,
<any> bulkMapper,
<any> resultSerializer)
Sort the elements for
query applying BulkMapper and Serializer. |
java.lang.Long |
sort(<any> query,
K storeKey)
Sort the elements for
query and store result in storeKey. |
void |
unwatch()
Flushes all the previously
watch(Object) keys. |
void |
watch(java.util.Collection<K> keys)
Watch given
keys for modifications during transaction started with multi(). |
void |
watch(K key)
Watch given
key for modifications during transaction started with multi(). |
void close()
close 在接口中 java.lang.AutoCloseableclose 在接口中 java.io.Closeablebyte[] dump(K key)
key.key - must not be null.void restore(K key, byte[] value, long timeToLive, java.util.concurrent.TimeUnit unit)
key - must not be null.value - must not be null.timeToLive - unit - must not be null.<any> getKeySerializer()
Serializer.<any> getValueSerializer()
Serializer.<any> getHashKeySerializer()
Serializer.<any> getHashValueSerializer()
Serializer.<any> opsForValue()
<any> opsForSet()
<any> opsForZSet()
<any> opsForList()
<HK,HV> <any> opsForHash()
HK - hash key (or field) typeHV - hash value type<HK,HV> <any> opsHash(K key)
HK - hash key (or field) typeHV - hash value typekey - Redis key<any> opsList(K key)
key - Redis key<any> opsSet(K key)
key - Redis key<any> opsValue(K key)
key - Redis key<any> opsZSet(K key)
key - Redis key<T> T execute(<any> action)
long delete(K key)
key.key - must not be null.long delete(java.util.Collection<K> keys)
keys.keys - must not be null.java.lang.Boolean expire(K key, long timeout, java.util.concurrent.TimeUnit unit)
key..key - must not be null.timeout - 超时时间值unit - must not be null.java.lang.Boolean expireAt(K key, java.util.Date date)
key as a date timestamp.key - must not be null.date - must not be null.java.lang.Boolean persist(K key)
key.key - must not be null.java.lang.Long getExpire(K key)
key in seconds.key - must not be null.java.lang.Long getExpire(K key, java.util.concurrent.TimeUnit timeUnit)
key in and convert it to the given TimeUnit.key - must not be null.timeUnit - must not be null.java.lang.Boolean hasKey(K key)
key exists.key - must not be null.java.util.Set<K> keys(K pattern)
pattern.pattern - must not be null.K randomKey()
void rename(K oldKey, K newKey)
oldKey to newKey.oldKey - must not be null.newKey - must not be null.java.lang.Boolean renameIfAbsent(K oldKey, K newKey)
oleName to newKey only if newKey does not exist.oldKey - must not be null.newKey - must not be null.java.util.List<V> sort(<any> query)
query.query - must not be null.<T> java.util.List<T> sort(<any> query,
<any> resultSerializer)
query applying Serializer.query - must not be null.<T> java.util.List<T> sort(<any> query,
<any> bulkMapper)
query applying BulkMapper.query - must not be null.<T,S> java.util.List<T> sort(<any> query,
<any> bulkMapper,
<any> resultSerializer)
query applying BulkMapper and Serializer.query - must not be null.java.lang.Long sort(<any> query,
K storeKey)
query and store result in storeKey.query - must not be null.storeKey - must not be null.void watch(K key)
key for modifications during transaction started with multi().key - must not be null.void watch(java.util.Collection<K> keys)
keys for modifications during transaction started with multi().keys - must not be null.void unwatch()
watch(Object) keys.void multi()
#exec() or rolled back using discard()
void discard()
multi().RedisAPI<K,V> serializer(<any> keySerializer, <any> valueSerializer)
Copyright © Actionsoft Co., Ltd. All Rights Reserved.