public class RedissonReliableTopic extends RedissonObject implements RReliableTopic
codec, commandExecutor, name| Constructor and Description |
|---|
RedissonReliableTopic(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
RedissonReliableTopic(CommandAsyncExecutor commandExecutor,
String name) |
| Modifier and Type | Method and Description |
|---|---|
<M> String |
addListener(Class<M> type,
MessageListener<M> listener)
Subscribes to this topic.
|
<M> RFuture<String> |
addListenerAsync(Class<M> type,
MessageListener<M> listener)
Subscribes to this topic.
|
boolean |
clearExpire()
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) |
int |
countListeners()
Returns amount of registered listeners to this topic
|
int |
countSubscribers()
Returns amount of subscribers to this topic across all Redisson instances.
|
RFuture<Integer> |
countSubscribersAsync()
Returns amount of subscribers to this topic across all Redisson instances.
|
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout 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) |
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
protected RFuture<Boolean> |
expireAtAsync(long timestamp,
String... keys) |
protected String |
generateId() |
long |
publish(Object message)
Publish the message to all subscribers of this topic asynchronously.
|
RFuture<Long> |
publishAsync(Object message)
Publish the message to all subscribers of this topic asynchronously.
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
void |
removeAllListeners()
Removes all listeners from this topic
|
RFuture<Void> |
removeAllListenersAsync()
Removes all listeners from this topic
|
void |
removeListener(String... listenerIds)
Removes the listener by
id for listening this topic |
RFuture<Void> |
removeListenerAsync(String... listenerIds)
Removes the listener by
id for listening this topic |
long |
size()
Amount of messages stored in Redis Stream object.
|
RFuture<Long> |
sizeAsync()
Amount of messages stored in Redis Stream object.
|
RFuture<Long> |
sizeInMemoryAsync()
Returns bytes amount used by object in Redis memory.
|
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearExpire, expire, expireAt, expireAt, remainTimeToLiveaddListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkexpireAtAsync, remainTimeToLiveAsyncaddListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsyncpublic RedissonReliableTopic(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public RedissonReliableTopic(CommandAsyncExecutor commandExecutor, String name)
public long publish(Object message)
RReliableTopicpublish in interface RReliableTopicmessage - to sendpublic <M> String addListener(Class<M> type, MessageListener<M> listener)
RReliableTopicMessageListener.onMessage method is called when any message
is published on this topic.
Watchdog is started when listener was registered.
addListener in interface RReliableTopicM - - type of messagetype - - type of messagelistener - for messagesConfig.setReliableTopicWatchdogTimeout(long),
MessageListenerpublic void removeListener(String... listenerIds)
RReliableTopicid for listening this topicremoveListener in interface RReliableTopiclistenerIds - - listener idspublic void removeAllListeners()
RReliableTopicremoveAllListeners in interface RReliableTopicpublic RFuture<Void> removeAllListenersAsync()
RReliableTopicAsyncremoveAllListenersAsync in interface RReliableTopicAsyncpublic long size()
RReliableTopicsize in interface RReliableTopicpublic RFuture<Long> sizeAsync()
RReliableTopicAsyncsizeAsync in interface RReliableTopicAsyncpublic int countListeners()
RReliableTopiccountListeners in interface RReliableTopicpublic RFuture<Long> publishAsync(Object message)
RReliableTopicAsyncpublishAsync in interface RReliableTopicAsyncmessage - to sendprotected String generateId()
public <M> RFuture<String> addListenerAsync(Class<M> type, MessageListener<M> listener)
RReliableTopicAsyncMessageListener.onMessage method is called when any message
is published on this topic.
Watchdog is started when listener was registered.
addListenerAsync in interface RReliableTopicAsyncM - - type of messagetype - - type of messagelistener - for messagesConfig.setReliableTopicWatchdogTimeout(long),
MessageListenerpublic RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsyncdeleteAsync in class RedissonObjecttrue if object was deleted false if notpublic RFuture<Long> sizeInMemoryAsync()
RObjectAsyncsizeInMemoryAsync in interface RObjectAsyncsizeInMemoryAsync in class RedissonObjectpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsyncexpireAsync in interface RExpirableAsynctimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsynctrue if the timeout was cleared and false if notpublic RFuture<Void> removeListenerAsync(String... listenerIds)
RReliableTopicAsyncid for listening this topicremoveListenerAsync in interface RReliableTopicAsynclistenerIds - - listener idspublic int countSubscribers()
RReliableTopiccountSubscribers in interface RReliableTopicpublic RFuture<Integer> countSubscribersAsync()
RReliableTopicAsynccountSubscribersAsync in interface RReliableTopicAsyncpublic boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirablepublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncprotected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
Copyright © 2014–2020 Redisson. All rights reserved.