Class RedissonStream<K,V>
- Type Parameters:
K
- key typeV
- value type
- All Implemented Interfaces:
RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RStream<K,
,V> RStreamAsync<K,
V>
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Constructor Summary
ConstructorDescriptionRedissonStream
(Codec codec, CommandAsyncExecutor connectionManager, String name) RedissonStream
(CommandAsyncExecutor connectionManager, String name) -
Method Summary
Modifier and TypeMethodDescriptionlong
ack
(String groupName, StreamMessageId... id) Marks pending messages by group name and streamids
as correctly processed.ackAsync
(String groupName, StreamMessageId... ids) Marks pending messages by group name and streamids
as correctly processed.add
(StreamAddArgs<K, V> args) Appends a new entry/entries and returns generated Stream Message IDvoid
add
(StreamMessageId id, StreamAddArgs<K, V> args) Appends a new entry/entries by specified Stream Message IDaddAsync
(StreamAddArgs<K, V> args) Appends a new entry/entries and returns generated Stream Message IDaddAsync
(StreamMessageId id, StreamAddArgs<K, V> args) Appends a new entry/entries by specified Stream Message ID<R> RFuture
<R> addCustomAsync
(StreamMessageId id, StreamAddArgs<K, V> args) int
addListener
(ObjectListener listener) Adds object event listeneraddListenerAsync
(ObjectListener listener) Adds object event listenerautoClaim
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.autoClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.protected void
protected void
checkValue
(Object value) Map
<StreamMessageId, Map<K, V>> claim
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.claimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.boolean
Clear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync
(String... keys) void
createConsumer
(String groupName, String consumerName) Creates consumer of the group by name.createConsumerAsync
(String groupName, String consumerName) Creates consumer of the group by name.void
Creates consumer group.Creates consumer group.boolean
UseRExpirable.expire(Duration)
insteadboolean
Sets a timeout for this object.boolean
Sets an expiration date for this object.expireAsync
(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)
insteadexpireAsync
(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync
(Duration duration) Set a timeout for object.expireAsync
(Instant instant) Set an expire date for object.boolean
expireAt
(long timestamp) UseRExpirable.expire(Instant)
insteadboolean
UseRExpirable.expire(Instant)
insteadexpireAtAsync
(long timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
(long timestamp, String param, String... keys) expireAtAsync
(Date timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadboolean
expireIfGreater
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.boolean
expireIfGreater
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.boolean
expireIfLess
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.boolean
expireIfLess
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.boolean
expireIfNotSet
(Duration duration) Sets a timeout for this object only if it hasn't been set before.boolean
expireIfNotSet
(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync
(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync
(Instant time) Sets an expiration date for this object only if it hasn't been set before.boolean
expireIfSet
(Duration duration) Sets a timeout for this object only if it has been already set.boolean
expireIfSet
(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync
(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync
(Instant time) Sets an expiration date for this object only if it has been already set.fastAutoClaim
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.fastAutoClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.fastClaim
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.fastClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.long
Expiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutStreamInfo
<K, V> getInfo()
Returns information about this stream.RFuture
<StreamInfo<K, V>> Returns information about this stream.getPendingInfo
(String groupName) Returns common info about pending messages by group name.getPendingInfoAsync
(String groupName) Returns common info about pending messages by group name.listConsumers
(String groupName) Returns list of common info about group customers for specifiedgroupName
.listConsumersAsync
(String groupName) Returns list of objects with information about group customers for specifiedgroupName
.Returns list of common info about groups belonging to this stream.Returns list of objects with information about groups belonging to this stream.listPending
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group and consumer name.listPending
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group and customer name.listPending
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group name.listPending
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group name.listPendingAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group and consumer name.listPendingAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group and consumer name.listPendingAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group name.listPendingAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group name.Map
<StreamMessageId, Map<K, V>> pendingRange
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group and customer name.Map
<StreamMessageId, Map<K, V>> pendingRange
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group and customer name.Map
<StreamMessageId, Map<K, V>> pendingRange
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group name.Map
<StreamMessageId, Map<K, V>> pendingRange
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group name.pendingRangeAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group and customer name.pendingRangeAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group and customer name.pendingRangeAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group name.pendingRangeAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group name.Map
<StreamMessageId, Map<K, V>> range
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).Map
<StreamMessageId, Map<K, V>> range
(StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).rangeAsync
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).rangeAsync
(StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).Map
<StreamMessageId, Map<K, V>> rangeReversed
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).Map
<StreamMessageId, Map<K, V>> rangeReversed
(StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).rangeReversedAsync
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).rangeReversedAsync
(StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).read
(StreamMultiReadArgs args) Read stream data from multiple streams including current.Map
<StreamMessageId, Map<K, V>> read
(StreamReadArgs args) Read stream data from current stream only.readAsync
(StreamMultiReadArgs args) Read stream data from multiple streams including current.readAsync
(StreamReadArgs args) Read stream data from current stream only.readGroup
(String groupName, String consumerName, StreamMultiReadGroupArgs args) Read stream data from consumer group and multiple streams including current.Map
<StreamMessageId, Map<K, V>> readGroup
(String groupName, String consumerName, StreamReadGroupArgs args) Read stream data from consumer group and current stream only.readGroupAsync
(String groupName, String consumerName, StreamMultiReadGroupArgs args) Read stream data from consumer group and multiple streams including current.readGroupAsync
(String groupName, String consumerName, StreamReadGroupArgs args) Read stream data from consumer group and current stream only.long
Remaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutlong
remove
(StreamMessageId... ids) Removes messages by id.removeAsync
(StreamMessageId... ids) Removes messages by id.long
removeConsumer
(String groupName, String consumerName) Removes consumer of the group by name.removeConsumerAsync
(String groupName, String consumerName) Removes consumer of the group by name.void
removeGroup
(String groupName) Removes group by name.removeGroupAsync
(String groupName) Removes group by name.void
removeListener
(int listenerId) Removes object event listenerremoveListenerAsync
(int listenerId) Removes object event listenerlong
size()
Returns number of entries in streamReturns number of entries in streamlong
trim
(StreamTrimArgs args) Trims stream using strict trimming.trimAsync
(StreamTrimArgs args) long
trimNonStrict
(StreamTrimArgs args) Trims stream using non-strict trimming.void
updateGroupMessageId
(String groupName, StreamMessageId id) Updates next message id delivered to consumers.updateGroupMessageIdAsync
(String groupName, StreamMessageId id) Updates next message id delivered to consumers.Methods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, addTrackingListener, addTrackingListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenerAsync, removeTrackingListener, removeTrackingListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Constructor Details
-
RedissonStream
-
RedissonStream
-
-
Method Details
-
checkKey
-
checkValue
-
createGroup
Description copied from interface:RStream
Creates consumer group.Usage examples:
StreamMessageId id = stream.createGroup(StreamCreateGroupArgs.name("test").id(id).makeStream());
- Specified by:
createGroup
in interfaceRStream<K,
V> - Parameters:
args
- method arguments object
-
createGroupAsync
Description copied from interface:RStreamAsync
Creates consumer group.Usage examples:
StreamMessageId id = stream.createGroup(StreamCreateGroupArgs.name("test").id(id).makeStream());
- Specified by:
createGroupAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- method arguments object
-
ackAsync
Description copied from interface:RStreamAsync
Marks pending messages by group name and streamids
as correctly processed.- Specified by:
ackAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupids
- - stream ids- Returns:
- marked messages amount
-
ack
Description copied from interface:RStream
Marks pending messages by group name and streamids
as correctly processed. -
getPendingInfoAsync
Description copied from interface:RStreamAsync
Returns common info about pending messages by group name.- Specified by:
getPendingInfoAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of group- Returns:
- result object
-
getPendingInfo
Description copied from interface:RStream
Returns common info about pending messages by group name.- Specified by:
getPendingInfo
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of group- Returns:
- result object
-
listPendingAsync
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStreamAsync
Returns list of common info about pending messages by group and consumer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
listPendingAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStreamAsync
Returns list of common info about pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
listPendingAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStreamAsync
Returns list of common info about pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
listPendingAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStreamAsync
Returns list of common info about pending messages by group and consumer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
listPendingAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- list
- See Also:
-
listPending
public List<PendingEntry> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStream
Returns list of common info about pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
listPending
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
listPending
public List<PendingEntry> listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStream
Returns list of common info about pending messages by group and consumer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
listPending
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
listPending
public List<PendingEntry> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStream
Returns stream data of pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
listPending
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
listPending
public List<PendingEntry> listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStream
Returns stream data of pending messages by group and customer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
listPending
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
fastClaim
public List<StreamMessageId> fastClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Description copied from interface:RStream
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value. -
fastClaimAsync
public RFuture<List<StreamMessageId>> fastClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Description copied from interface:RStreamAsync
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.- Specified by:
fastClaimAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitids
- - Stream Message IDs- Returns:
- list of Stream Message IDs
-
autoClaim
public AutoClaimResult<K,V> autoClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Description copied from interface:RStream
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value. -
autoClaimAsync
public RFuture<AutoClaimResult<K,V>> autoClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Description copied from interface:RStreamAsync
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.- Specified by:
autoClaimAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitstartId
- - start Stream Message ID- Returns:
- stream data mapped by Stream ID
-
fastAutoClaim
public FastAutoClaimResult fastAutoClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Description copied from interface:RStream
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.- Specified by:
fastAutoClaim
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitstartId
- - start Stream Message ID- Returns:
- list of Stream Message IDs
-
readGroup
public Map<String,Map<StreamMessageId, readGroupMap<K, V>>> (String groupName, String consumerName, StreamMultiReadGroupArgs args) Description copied from interface:RStream
Read stream data from consumer group and multiple streams including current.Usage examples:
Map result = stream.read("group1", "consumer1", StreamMultiReadGroupArgs.greaterThan(id, "stream2", id2));
Map result = stream.read("group1", "consumer1", StreamMultiReadGroupArgs.greaterThan(id, "stream2", id2) .count(100) .timeout(Duration.ofSeconds(5))));
-
readGroup
public Map<StreamMessageId,Map<K, readGroupV>> (String groupName, String consumerName, StreamReadGroupArgs args) Description copied from interface:RStream
Read stream data from consumer group and current stream only.Usage examples:
Map result = stream.read("group1", "consumer1", StreamReadGroupArgs.greaterThan(id));
Map result = stream.read("group1", "consumer1", StreamReadGroupArgs.greaterThan(id) .count(100) .timeout(Duration.ofSeconds(5))));
-
readGroupAsync
public RFuture<Map<String,Map<StreamMessageId, readGroupAsyncMap<K, V>>>> (String groupName, String consumerName, StreamMultiReadGroupArgs args) Description copied from interface:RStreamAsync
Read stream data from consumer group and multiple streams including current.- Specified by:
readGroupAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
readGroupAsync
public RFuture<Map<StreamMessageId,Map<K, readGroupAsyncV>>> (String groupName, String consumerName, StreamReadGroupArgs args) Description copied from interface:RStreamAsync
Read stream data from consumer group and current stream only.- Specified by:
readGroupAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
fastAutoClaimAsync
public RFuture<FastAutoClaimResult> fastAutoClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Description copied from interface:RStreamAsync
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.- Specified by:
fastAutoClaimAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitstartId
- - start Stream Message ID- Returns:
- list of Stream Message IDs
-
claimAsync
public RFuture<Map<StreamMessageId,Map<K, claimAsyncV>>> (String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Description copied from interface:RStreamAsync
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.- Specified by:
claimAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitids
- - Stream Message IDs- Returns:
- stream data mapped by Stream ID
-
claim
public Map<StreamMessageId,Map<K, claimV>> (String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Description copied from interface:RStream
Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value. -
size
public long size()Description copied from interface:RStream
Returns number of entries in stream -
sizeAsync
Description copied from interface:RStreamAsync
Returns number of entries in stream- Specified by:
sizeAsync
in interfaceRStreamAsync<K,
V> - Returns:
- size of stream
-
read
Description copied from interface:RStream
Read stream data from multiple streams including current.Usage examples:
Map result = stream.read(StreamMultiReadArgs.greaterThan(id, "stream2", id2));
Map result = stream.read(StreamMultiReadArgs.greaterThan(id, "stream2", id2) .count(100) .timeout(Duration.ofSeconds(5))));
-
readAsync
Description copied from interface:RStreamAsync
Read stream data from multiple streams including current.- Specified by:
readAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
read
Description copied from interface:RStream
Read stream data from current stream only.Usage examples:
Map result = stream.read(StreamReadArgs.greaterThan(id));
Map result = stream.read(StreamReadArgs.greaterThan(id) .count(100) .timeout(Duration.ofSeconds(5))));
-
readAsync
Description copied from interface:RStreamAsync
Read stream data from current stream only.- Specified by:
readAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
add
Description copied from interface:RStream
Appends a new entry/entries and returns generated Stream Message IDUsage examples:
StreamMessageId id = stream.add(StreamAddArgs.entry(15, 37));
StreamMessageId id = stream.add(StreamAddArgs.entries(15, 37, 23, 43) .trim(TrimStrategy.MAXLEN, 100)));
-
add
Description copied from interface:RStream
Appends a new entry/entries by specified Stream Message IDUsage examples:
stream.add(id, StreamAddArgs.entry(15, 37));
stream.add(id, StreamAddArgs.entries(15, 37, 23, 43) .trim(TrimStrategy.MAXLEN, 100)));
-
addAsync
Description copied from interface:RStreamAsync
Appends a new entry/entries and returns generated Stream Message ID- Specified by:
addAsync
in interfaceRStreamAsync<K,
V> - Parameters:
args
- - method arguments object- Returns:
- Stream Message ID
-
addAsync
Description copied from interface:RStreamAsync
Appends a new entry/entries by specified Stream Message ID- Specified by:
addAsync
in interfaceRStreamAsync<K,
V> - Parameters:
id
- - Stream Message IDargs
- - method arguments object
-
addCustomAsync
-
rangeAsync
public RFuture<Map<StreamMessageId,Map<K, rangeAsyncV>>> (int count, StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStreamAsync
Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).- Specified by:
rangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
range
public Map<StreamMessageId,Map<K, rangeV>> (int count, StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStream
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included). -
rangeReversedAsync
public RFuture<Map<StreamMessageId,Map<K, rangeReversedAsyncV>>> (int count, StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStreamAsync
Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).- Specified by:
rangeReversedAsync
in interfaceRStreamAsync<K,
V> - Parameters:
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
rangeReversed
public Map<StreamMessageId,Map<K, rangeReversedV>> (int count, StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStream
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Specified by:
rangeReversed
in interfaceRStream<K,
V> - Parameters:
count
- - stream data size limitstartId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
rangeAsync
public RFuture<Map<StreamMessageId,Map<K, rangeAsyncV>>> (StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStreamAsync
Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).- Specified by:
rangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
startId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
rangeReversedAsync
public RFuture<Map<StreamMessageId,Map<K, rangeReversedAsyncV>>> (StreamMessageId startId, StreamMessageId endId) Description copied from interface:RStreamAsync
Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).- Specified by:
rangeReversedAsync
in interfaceRStreamAsync<K,
V> - Parameters:
startId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
range
Description copied from interface:RStream
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included). -
rangeReversed
Description copied from interface:RStream
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Specified by:
rangeReversed
in interfaceRStream<K,
V> - Parameters:
startId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
removeAsync
Description copied from interface:RStreamAsync
Removes messages by id.- Specified by:
removeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
ids
- - id of messages to remove- Returns:
- deleted messages amount
-
remove
Description copied from interface:RStream
Removes messages by id. -
removeGroupAsync
Description copied from interface:RStreamAsync
Removes group by name.- Specified by:
removeGroupAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of group- Returns:
- void
-
removeGroup
Description copied from interface:RStream
Removes group by name.- Specified by:
removeGroup
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of group
-
createConsumer
Description copied from interface:RStream
Creates consumer of the group by name.Requires Redis 6.2.0 and higher.
- Specified by:
createConsumer
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumer
-
createConsumerAsync
Description copied from interface:RStreamAsync
Creates consumer of the group by name.Requires Redis 6.2.0 and higher.
- Specified by:
createConsumerAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumer
-
removeConsumerAsync
Description copied from interface:RStreamAsync
Removes consumer of the group by name.- Specified by:
removeConsumerAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumer- Returns:
- number of pending messages owned by consumer
-
removeConsumer
Description copied from interface:RStream
Removes consumer of the group by name.- Specified by:
removeConsumer
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumer- Returns:
- number of pending messages owned by consumer
-
updateGroupMessageIdAsync
Description copied from interface:RStreamAsync
Updates next message id delivered to consumers.- Specified by:
updateGroupMessageIdAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupid
- - Stream Message ID- Returns:
- void
-
updateGroupMessageId
Description copied from interface:RStream
Updates next message id delivered to consumers.- Specified by:
updateGroupMessageId
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupid
- - Stream Message ID
-
getInfo
Description copied from interface:RStream
Returns information about this stream. -
getInfoAsync
Description copied from interface:RStreamAsync
Returns information about this stream.- Specified by:
getInfoAsync
in interfaceRStreamAsync<K,
V> - Returns:
- info object
-
listGroups
Description copied from interface:RStream
Returns list of common info about groups belonging to this stream.- Specified by:
listGroups
in interfaceRStream<K,
V> - Returns:
- list of info objects
-
listGroupsAsync
Description copied from interface:RStreamAsync
Returns list of objects with information about groups belonging to this stream.- Specified by:
listGroupsAsync
in interfaceRStreamAsync<K,
V> - Returns:
- list of info objects
-
listConsumers
Description copied from interface:RStream
Returns list of common info about group customers for specifiedgroupName
.- Specified by:
listConsumers
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of group- Returns:
- list of info objects
-
listConsumersAsync
Description copied from interface:RStreamAsync
Returns list of objects with information about group customers for specifiedgroupName
.- Specified by:
listConsumersAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of group- Returns:
- list of info objects
-
pendingRangeAsync
public RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStreamAsync
Returns stream data of pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
pendingRangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
public RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStreamAsync
Returns stream data of pending messages by group and customer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
pendingRangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
public RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStreamAsync
Returns stream data of pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
pendingRangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
public RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStreamAsync
Returns stream data of pending messages by group and customer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
pendingRangeAsync
in interfaceRStreamAsync<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRange
public Map<StreamMessageId,Map<K, pendingRangeV>> (String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStream
Returns stream data of pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
pendingRange
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRange
public Map<StreamMessageId,Map<K, pendingRangeV>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Description copied from interface:RStream
Returns stream data of pending messages by group and customer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Specified by:
pendingRange
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRange
public Map<StreamMessageId,Map<K, pendingRangeV>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStream
Returns stream data of pending messages by group and customer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
pendingRange
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRange
public Map<StreamMessageId,Map<K, pendingRangeV>> (String groupName, StreamMessageId startId, StreamMessageId endId, int count) Description copied from interface:RStream
Returns stream data of pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Specified by:
pendingRange
in interfaceRStream<K,
V> - Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
trim
Description copied from interface:RStream
Trims stream using strict trimming.Usage example:
long result = stream.trim(StreamTrimArgs.maxLen(100).noLimit());
-
trimAsync
- Specified by:
trimAsync
in interfaceRStreamAsync<K,
V>
-
trimNonStrict
Description copied from interface:RStream
Trims stream using non-strict trimming.Usage example:
long result = stream.trimNonStrict(StreamTrimArgs.maxLen(100).noLimit());
- Specified by:
trimNonStrict
in interfaceRStream<K,
V> - Parameters:
args
- - method arguments object- Returns:
- number of deleted messages
-
trimNonStrictAsync
- Specified by:
trimNonStrictAsync
in interfaceRStreamAsync<K,
V>
-
addListenerAsync
Description copied from interface:RObjectAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Specified by:
addListenerAsync
in interfaceRStreamAsync<K,
V> - Overrides:
addListenerAsync
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
addListener
Description copied from interface:RObject
Adds object event listener- Specified by:
addListener
in interfaceRObject
- Specified by:
addListener
in interfaceRStream<K,
V> - Overrides:
addListener
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObject
Removes object event listener- Specified by:
removeListener
in interfaceRObject
- Overrides:
removeListener
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsync
Removes object event listener- Specified by:
removeListenerAsync
in interfaceRObjectAsync
- Overrides:
removeListenerAsync
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
expire
Description copied from interface:RExpirable
UseRExpirable.expire(Duration)
instead- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Duration)
instead- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirable
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTime
in interfaceRExpirable
- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsync
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsync
in interfaceRExpirableAsync
- Returns:
- expiration time
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-