Package org.redisson.api
Interface RSetCacheReactive<V>
- Type Parameters:
V- value
- All Superinterfaces:
RCollectionReactive<V>,RDestroyable,RExpirableReactive,RObjectReactive
Reactive interface for RSetCache object
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Boolean> Stores value with specified time to live.reactor.core.publisher.Mono<Integer> Adds all elements contained in the specified map to this sorted set.reactor.core.publisher.Mono<Integer> addAllIfAbsent(Map<V, Duration> objects) Adds elements to this set only if they haven't been added before.reactor.core.publisher.Mono<Integer> addAllIfExist(Map<V, Duration> objects) Adds elements to this set only if they already exist.reactor.core.publisher.Mono<Integer> addAllIfGreater(Map<V, Duration> objects) Adds elements to this set only if new ttl greater than current ttl of existed elements.reactor.core.publisher.Mono<Integer> addAllIfLess(Map<V, Duration> objects) Adds elements to this set only if new ttl less than current ttl of existed elements.reactor.core.publisher.Mono<Boolean> addIfAbsent(Duration ttl, V object) Adds element to this set only if has not been added before.reactor.core.publisher.Mono<Boolean> addIfAbsent(Map<V, Duration> objects) Adds elements to this set only if all of them haven't been added before.reactor.core.publisher.Mono<Boolean> addIfExists(Duration ttl, V object) Adds element to this set only if it's already exists.reactor.core.publisher.Mono<Boolean> addIfGreater(Duration ttl, V object) Adds element to this set only if new ttl greater than current ttl of existed element.reactor.core.publisher.Mono<Boolean> Adds element to this set only if new ttl less than current ttl of existed element.reactor.core.publisher.Mono<Integer> addListener(ObjectListener listener) Adds object event listenergetFairLock(V value) ReturnsRLockinstance associated withvalueReturns lock instance associated withvaluegetPermitExpirableSemaphore(V value) ReturnsRPermitExpirableSemaphoreinstance associated withvaluegetReadWriteLock(V value) ReturnsRReadWriteLockinstance associated withvaluegetSemaphore(V value) ReturnsRSemaphoreinstance associated withvaluereadAll()Read all elements at oncereactor.core.publisher.Mono<Integer> size()Returns the number of elements in cache.reactor.core.publisher.Mono<Boolean> Deprecated.reactor.core.publisher.Mono<Boolean> Tries to add elements only if none of them in set.Methods inherited from interface org.redisson.api.RCollectionReactive
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAllMethods inherited from interface org.redisson.api.RDestroyable
destroyMethods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RObjectReactive
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
getPermitExpirableSemaphore
ReturnsRPermitExpirableSemaphoreinstance associated withvalue- Parameters:
value- - set value- Returns:
- RPermitExpirableSemaphore object
-
getSemaphore
ReturnsRSemaphoreinstance associated withvalue- Parameters:
value- - set value- Returns:
- RSemaphore object
-
getFairLock
ReturnsRLockinstance associated withvalue- Parameters:
value- - set value- Returns:
- RLock object
-
getReadWriteLock
ReturnsRReadWriteLockinstance associated withvalue- Parameters:
value- - set value- Returns:
- RReadWriteLock object
-
getLock
Returns lock instance associated withvalue- Parameters:
value- - set value- Returns:
- RLock object
-
add
Stores value with specified time to live. Value expires after specified time to live.- Parameters:
value- to addttl- - time to live for key\value entry. If0then stores infinitely.unit- - time unit- Returns:
trueif value has been added.falseif value already been in collection.
-
size
reactor.core.publisher.Mono<Integer> size()Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.- Specified by:
sizein interfaceRCollectionReactive<V>- Returns:
- size of collection
-
readAll
Read all elements at once- Returns:
- values
-
tryAdd
Tries to add elements only if none of them in set.- Parameters:
values- - values to add- Returns:
trueif elements successfully added, otherwisefalse.
-
tryAdd
Deprecated.UseaddIfAbsent(Map)instead Tries to add elements only if none of them in set.- Parameters:
ttl- - time to live for value. If0then stores infinitely.unit- - time unitvalues- - values to add- Returns:
trueif elements successfully added, otherwisefalse.
-
addIfAbsent
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfAbsent
Adds elements to this set only if all of them haven't been added before.Requires Redis 3.0.2 and higher.
- Parameters:
objects- map of elements to add- Returns:
trueif elements added andfalseif not.
-
addIfExists
Adds element to this set only if it's already exists.Requires Redis 3.0.2 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfLess
Adds element to this set only if new ttl less than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfGreater
Adds element to this set only if new ttl greater than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addAll
Adds all elements contained in the specified map to this sorted set. Map contains of ttl mapped by object.- Parameters:
objects- - map of elements to add- Returns:
- amount of added elements, not including already existing in this sorted set
-
addAllIfAbsent
Adds elements to this set only if they haven't been added before.Requires Redis 3.0.2 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfExist
Adds elements to this set only if they already exist.Requires Redis 3.0.2 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfGreater
Adds elements to this set only if new ttl greater than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfLess
Adds elements to this set only if new ttl less than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addListener
Adds object event listener- Specified by:
addListenerin interfaceRObjectReactive- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-