Package org.redisson
Class RedissonTransferQueue<V>
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonTransferQueue<V>
-
- All Implemented Interfaces:
Iterable<V>,Collection<V>,BlockingQueue<V>,TransferQueue<V>,Queue<V>,RBlockingQueue<V>,RBlockingQueueAsync<V>,RCollectionAsync<V>,RExpirable,RExpirableAsync,RObject,RObjectAsync,RQueue<V>,RQueueAsync<V>,RTransferQueue<V>,RTransferQueueAsync<V>
public class RedissonTransferQueue<V> extends RedissonObject implements RTransferQueue<V>
- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRedissonTransferQueue.TransferQueueServicestatic interfaceRedissonTransferQueue.TransferQueueServiceAsyncstatic classRedissonTransferQueue.TransferQueueServiceImpl
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonTransferQueue(Codec codec, CommandAsyncExecutor commandExecutor, String name, RRemoteService remoteService)RedissonTransferQueue(CommandAsyncExecutor commandExecutor, String name, RRemoteService remoteService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(V v)booleanaddAll(Collection<? extends V> c)RFuture<Boolean>addAllAsync(Collection<? extends V> c)Adds all elements contained in the specified collectionRFuture<Boolean>addAsync(V v)Adds element into this collection.voidclear()RFuture<Void>clearAsync()booleanclearExpire()Clear an expire timeout or expire date for object.RFuture<Boolean>clearExpireAsync()Clear an expire timeout or expire date for object in async mode.protected RFuture<Boolean>clearExpireAsync(String... keys)booleancontains(Object o)booleancontainsAll(Collection<?> c)RFuture<Boolean>containsAllAsync(Collection<?> c)Returnstrueif this collection contains all of the elements in the specified collection.RFuture<Boolean>containsAsync(Object o)Returnstrueif this collection contains encoded state of the specified element.intdrainTo(Collection<? super V> c)intdrainTo(Collection<? super V> c, int maxElements)RFuture<Integer>drainToAsync(Collection<? super V> c)Removes all available elements from this queue and adds them to the given collection in async mode.RFuture<Integer>drainToAsync(Collection<? super V> c, int maxElements)Removes at most the given number of available elements from this queue and adds them to the given collection in async mode.Velement()booleanexpire(long timeToLive, TimeUnit timeUnit)Set a timeout for object.booleanexpire(Instant instant)Set an expire date for object.RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit)Set a timeout for object in async mode.protected RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)RFuture<Boolean>expireAsync(Instant instant)Set an expire date for object.booleanexpireAt(long timestamp)UseRExpirable.expire(Instant)insteadbooleanexpireAt(Date timestamp)UseRExpirable.expire(Instant)insteadRFuture<Boolean>expireAtAsync(long timestamp)UseRExpirableAsync.expireAsync(Instant)insteadprotected RFuture<Boolean>expireAtAsync(long timestamp, String... keys)RFuture<Boolean>expireAtAsync(Date timestamp)UseRExpirableAsync.expireAsync(Instant)insteadRFuture<V>getValueAsync(int index)intgetWaitingConsumerCount()booleanhasWaitingConsumer()booleanisEmpty()Iterator<V>iterator()booleanoffer(V v)booleanoffer(V v, long timeout, TimeUnit unit)RFuture<Boolean>offerAsync(V e)Inserts the specified element into this queue.Vpeek()RFuture<V>peekAsync()Retrieves the head of this queue in async mode.Vpoll()List<V>poll(int limit)Retrieves and removes the head elements of this queue.Vpoll(long timeout, TimeUnit unit)RFuture<V>pollAsync()Retrieves and removes the head of this queue in async mode.RFuture<List<V>>pollAsync(int limit)Retrieves and removes the head elements of this queue.RFuture<V>pollAsync(long timeout, TimeUnit unit)Retrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.VpollFromAny(long timeout, TimeUnit unit, String... queueNames)Retrieves and removes first available head element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.RFuture<V>pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)Retrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.VpollLastAndOfferFirstTo(String queueName)Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.VpollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit)Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.RFuture<V>pollLastAndOfferFirstToAsync(String queueName)Retrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.RFuture<V>pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit)Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.voidput(V v)RFuture<Void>putAsync(V value)Inserts the specified element into this queue in async mode, waiting if necessary for space to become available.List<V>readAll()Returns all queue elements at onceRFuture<List<V>>readAllAsync()Returns all queue elements at onceintremainingCapacity()longremainTimeToLive()Remaining time to live of Redisson object that has a timeoutRFuture<Long>remainTimeToLiveAsync()Remaining time to live of Redisson object that has a timeoutVremove()booleanremove(Object o)booleanremoveAll(Collection<?> c)RFuture<Boolean>removeAllAsync(Collection<?> c)Removes all of this collection's elements that are also contained in the specified collection.RFuture<Boolean>removeAsync(Object o)Removes a single instance of the specified element from this collection, if it is present.booleanretainAll(Collection<?> c)RFuture<Boolean>retainAllAsync(Collection<?> c)Retains only the elements in this collection that are contained in the specified collection.intsize()RFuture<Integer>sizeAsync()Returns number of elements in this collection.intsubscribeOnElements(Consumer<V> consumer)Subscribes on elements appeared in this queue.Vtake()RFuture<V>takeAsync()Retrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.VtakeLastAndOfferFirstTo(String queueName)Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.RFuture<V>takeLastAndOfferFirstToAsync(String queueName)Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.Object[]toArray()<T> T[]toArray(T[] a)voidtransfer(V v)RFuture<Void>transferAsync(V v)Transfers the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer.booleantryTransfer(V v)booleantryTransfer(V v, long timeout, TimeUnit unit)RFuture<Boolean>tryTransferAsync(V v)Tries to transfer the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer.RFuture<Boolean>tryTransferAsync(V v, long timeout, TimeUnit unit)Transfers the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer.voidunsubscribe(int listenerId)Un-subscribes defined listener.-
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, 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 java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RQueue
addListener
-
Methods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync
-
-
-
-
Constructor Detail
-
RedissonTransferQueue
public RedissonTransferQueue(Codec codec, CommandAsyncExecutor commandExecutor, String name, RRemoteService remoteService)
-
RedissonTransferQueue
public RedissonTransferQueue(CommandAsyncExecutor commandExecutor, String name, RRemoteService remoteService)
-
-
Method Detail
-
tryTransfer
public boolean tryTransfer(V v)
- Specified by:
tryTransferin interfaceTransferQueue<V>
-
tryTransferAsync
public RFuture<Boolean> tryTransferAsync(V v)
Description copied from interface:RTransferQueueAsyncTries to transfer the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer.- Specified by:
tryTransferAsyncin interfaceRTransferQueueAsync<V>- Parameters:
v- element to transfer- Returns:
trueif element was transferred, otherwisefalse
-
transfer
public void transfer(V v) throws InterruptedException
- Specified by:
transferin interfaceTransferQueue<V>- Throws:
InterruptedException
-
transferAsync
public RFuture<Void> transferAsync(V v)
Description copied from interface:RTransferQueueAsyncTransfers the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer. Waits if necessary for a consumer.- Specified by:
transferAsyncin interfaceRTransferQueueAsync<V>- Parameters:
v- the element to transfer
-
tryTransfer
public boolean tryTransfer(V v, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
tryTransferin interfaceTransferQueue<V>- Throws:
InterruptedException
-
tryTransferAsync
public RFuture<Boolean> tryTransferAsync(V v, long timeout, TimeUnit unit)
Description copied from interface:RTransferQueueAsyncTransfers the element to waiting consumer which invokedRBlockingQueueAsync.takeAsync()orRBlockingQueueAsync.pollAsync(long, java.util.concurrent.TimeUnit)method at the moment of transfer. Waits up to definedtimeoutif necessary for a consumer.- Specified by:
tryTransferAsyncin interfaceRTransferQueueAsync<V>- Parameters:
v- the element to transfertimeout- the maximum time to waitunit- the time unit- Returns:
trueif the element was transferred andfalseotherwise
-
hasWaitingConsumer
public boolean hasWaitingConsumer()
- Specified by:
hasWaitingConsumerin interfaceTransferQueue<V>
-
getWaitingConsumerCount
public int getWaitingConsumerCount()
- Specified by:
getWaitingConsumerCountin interfaceTransferQueue<V>
-
add
public boolean add(V v)
- Specified by:
addin interfaceBlockingQueue<V>- Specified by:
addin interfaceCollection<V>- Specified by:
addin interfaceQueue<V>
-
addAsync
public RFuture<Boolean> addAsync(V v)
Description copied from interface:RCollectionAsyncAdds element into this collection.- Specified by:
addAsyncin interfaceRCollectionAsync<V>- Parameters:
v- - element to add- Returns:
trueif an element was added andfalseif it is already present
-
offer
public boolean offer(V v)
-
pollAsync
public RFuture<V> pollAsync()
Description copied from interface:RQueueAsyncRetrieves and removes the head of this queue in async mode.- Specified by:
pollAsyncin interfaceRQueueAsync<V>- Returns:
- the head of this queue, or
null
-
peekAsync
public RFuture<V> peekAsync()
Description copied from interface:RQueueAsyncRetrieves the head of this queue in async mode.- Specified by:
peekAsyncin interfaceRQueueAsync<V>- Returns:
- the head of this queue, or
null
-
put
public void put(V v) throws InterruptedException
- Specified by:
putin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
offer
public boolean offer(V v, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
offerin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
take
public V take() throws InterruptedException
- Specified by:
takein interfaceBlockingQueue<V>- Throws:
InterruptedException
-
takeAsync
public RFuture<V> takeAsync()
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.- Specified by:
takeAsyncin interfaceRBlockingQueueAsync<V>- Returns:
- the head of this queue
-
poll
public V poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
pollin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
pollAsync
public RFuture<V> pollAsync(long timeout, TimeUnit unit)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfaceBlockingQueue<V>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceBlockingQueue<V>- Specified by:
removein interfaceCollection<V>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<V>
-
addAll
public boolean addAll(Collection<? extends V> c)
- Specified by:
addAllin interfaceCollection<V>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<V>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<V>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<V>
-
size
public int size()
- Specified by:
sizein interfaceCollection<V>
-
sizeAsync
public RFuture<Integer> sizeAsync()
Description copied from interface:RCollectionAsyncReturns number of elements in this collection.- Specified by:
sizeAsyncin interfaceRCollectionAsync<V>- Returns:
- size of collection
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<V>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceBlockingQueue<V>- Specified by:
containsin interfaceCollection<V>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<V>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<V>
-
drainTo
public int drainTo(Collection<? super V> c)
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
public RFuture<Integer> drainToAsync(Collection<? super V> c)
Description copied from interface:RBlockingQueueAsyncRemoves all available elements from this queue and adds them to the given collection in async mode. This operation may be more efficient than repeatedly polling this queue. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements into- Returns:
- the number of elements transferred
-
drainTo
public int drainTo(Collection<? super V> c, int maxElements)
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
public RFuture<Integer> drainToAsync(Collection<? super V> c, int maxElements)
Description copied from interface:RBlockingQueueAsyncRemoves at most the given number of available elements from this queue and adds them to the given collection in async mode. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements intomaxElements- the maximum number of elements to transfer- Returns:
- the number of elements transferred
-
readAll
public List<V> readAll()
Description copied from interface:RTransferQueueReturns all queue elements at once- Specified by:
readAllin interfaceRQueue<V>- Specified by:
readAllin interfaceRTransferQueue<V>- Specified by:
readAllin interfaceRTransferQueueAsync<V>- Returns:
- elements
-
readAllAsync
public RFuture<List<V>> readAllAsync()
Description copied from interface:RQueueAsyncReturns all queue elements at once- Specified by:
readAllAsyncin interfaceRQueueAsync<V>- Returns:
- elements
-
pollFromAny
public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes first available head element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyin interfaceRBlockingQueue<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
pollLastAndOfferFirstTo
public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
takeLastAndOfferFirstTo
public V takeLastAndOfferFirstTo(String queueName) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
takeLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
subscribeOnElements
public int subscribeOnElements(Consumer<V> consumer)
Description copied from interface:RBlockingQueueSubscribes on elements appeared in this queue. Continuously invokesRBlockingQueueAsync.takeAsync()method to get a new element.- Specified by:
subscribeOnElementsin interfaceRBlockingQueue<V>- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
unsubscribe
public void unsubscribe(int listenerId)
Description copied from interface:RBlockingQueueUn-subscribes defined listener.- Specified by:
unsubscribein interfaceRBlockingQueue<V>- Parameters:
listenerId- - id of listener
-
pollLastAndOfferFirstTo
public V pollLastAndOfferFirstTo(String queueName)
Description copied from interface:RQueueRetrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.- Specified by:
pollLastAndOfferFirstToin interfaceRQueue<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
poll
public List<V> poll(int limit)
Description copied from interface:RQueueRetrieves and removes the head elements of this queue. Elements amount limited bylimitparam.
-
pollFromAnyAsync
public RFuture<V> pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- Future object with the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstToAsync
public RFuture<V> pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
takeLastAndOfferFirstToAsync
public RFuture<V> takeLastAndOfferFirstToAsync(String queueName)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
takeLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
putAsync
public RFuture<Void> putAsync(V value)
Description copied from interface:RBlockingQueueAsyncInserts the specified element into this queue in async mode, waiting if necessary for space to become available.- Specified by:
putAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
value- the element to add- Returns:
- void
-
offerAsync
public RFuture<Boolean> offerAsync(V e)
Description copied from interface:RQueueAsyncInserts the specified element into this queue.- Specified by:
offerAsyncin interfaceRQueueAsync<V>- Parameters:
e- the element to add- Returns:
trueif successful, orfalse
-
pollLastAndOfferFirstToAsync
public RFuture<V> pollLastAndOfferFirstToAsync(String queueName)
Description copied from interface:RQueueAsyncRetrieves and removes last available tail element of this queue queue and adds it at the head ofqueueName.- Specified by:
pollLastAndOfferFirstToAsyncin interfaceRQueueAsync<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollAsync
public RFuture<List<V>> pollAsync(int limit)
Description copied from interface:RQueueAsyncRetrieves and removes the head elements of this queue. Elements amount limited bylimitparam.- Specified by:
pollAsyncin interfaceRQueueAsync<V>- Returns:
- list of head elements
-
retainAllAsync
public RFuture<Boolean> retainAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncRetains only the elements in this collection that are contained in the specified collection.- Specified by:
retainAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection containing elements to be retained in this collection- Returns:
trueif this collection changed as a result of the call
-
removeAllAsync
public RFuture<Boolean> removeAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncRemoves all of this collection's elements that are also contained in the specified collection.- Specified by:
removeAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection containing elements to be removed from this collection- Returns:
trueif this collection changed as a result of the call
-
containsAsync
public RFuture<Boolean> containsAsync(Object o)
Description copied from interface:RCollectionAsyncReturnstrueif this collection contains encoded state of the specified element.- Specified by:
containsAsyncin interfaceRCollectionAsync<V>- Parameters:
o- element whose presence in this collection is to be tested- Returns:
trueif this collection contains the specified element andfalseotherwise
-
containsAllAsync
public RFuture<Boolean> containsAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncReturnstrueif this collection contains all of the elements in the specified collection.- Specified by:
containsAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- collection to be checked for containment in this collection- Returns:
trueif this collection contains all of the elements in the specified collection
-
removeAsync
public RFuture<Boolean> removeAsync(Object o)
Description copied from interface:RCollectionAsyncRemoves a single instance of the specified element from this collection, if it is present.- Specified by:
removeAsyncin interfaceRCollectionAsync<V>- Parameters:
o- element to be removed from this collection, if present- Returns:
trueif an element was removed as a result of this call
-
addAllAsync
public RFuture<Boolean> addAllAsync(Collection<? extends V> c)
Description copied from interface:RCollectionAsyncAdds all elements contained in the specified collection- Specified by:
addAllAsyncin interfaceRCollectionAsync<V>- Parameters:
c- - collection of elements to add- Returns:
trueif at least one element was added andfalseif all elements are already present
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)Description copied from interface:RExpirableSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsyncSet a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirableSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
-
-