public interface CollaborationList extends HasExpirationTimeout
TopicConnection. Changes performed by one user will be
delivered as events to subscribers defined by other users.| Modifier and Type | Method and Description |
|---|---|
default CompletableFuture<Void> |
append(Object item)
Appends the given item to the list.
|
CompletableFuture<Void> |
append(Object item,
EntryScope scope)
Appends the given item to the list with the given scope.
|
TopicConnection |
getConnection()
Gets the topic connection which is used to propagate changes to this
list.
|
Optional<Duration> |
getExpirationTimeout()
Gets the optional expiration timeout of this list.
|
<T> List<T> |
getItems(Class<T> type)
Gets the list items as instances of the given class.
|
<T> List<T> |
getItems(com.fasterxml.jackson.core.type.TypeReference<T> type)
Gets the list items as instances of the given type reference.
|
void |
setExpirationTimeout(Duration expirationTimeout)
Sets the expiration timeout of this list.
|
Registration |
subscribe(ListSubscriber subscriber)
Subscribes to changes to this list.
|
<T> List<T> getItems(Class<T> type)
T - the type of the class given as the argumenttype - the expected type of the itemsJsonConversionException - if one or more values in the list cannot be converted to an
instance of the given class<T> List<T> getItems(com.fasterxml.jackson.core.type.TypeReference<T> type)
T - the type of the reference given as the argumenttype - the reference of the expected type of the itemsJsonConversionException - if one or more values in the list cannot be converted to an
instance of the given type referencedefault CompletableFuture<Void> append(Object item)
The given item must be JSON-serializable so it can be sent over the network when Collaboration Engine is hosted in a standalone server.
item - the item to append, not nullJsonConversionException - if the given item isn't serializable as JSON stringCompletableFuture<Void> append(Object item, EntryScope scope)
The given item must be JSON-serializable so it can be sent over the network when Collaboration Engine is hosted in a standalone server.
The scope parameter specifies the scope of the entry, which
is either one of EntryScope.TOPIC to keep the entry in the list
until explicitly removed, or EntryScope.CONNECTION to
automatically remove the entry when the connection which put the entry is
deactivated.
item - the item to append, not nullscope - the scope of the entry, not nullJsonConversionException - if the given item isn't serializable as JSON stringRegistration subscribe(ListSubscriber subscriber)
subscriber - the subscriber to use, not nullnullTopicConnection getConnection()
nullOptional<Duration> getExpirationTimeout()
Optional is returned if no timeout is set, which means the list
is not cleared when there are no connected users to the related topic
(this is the default).getExpirationTimeout in interface HasExpirationTimeoutvoid setExpirationTimeout(Duration expirationTimeout)
expirationTimeout has passed after the last
connection to the topic this list belongs to is closed. If set to
null, the timeout is cancelled.setExpirationTimeout in interface HasExpirationTimeoutexpirationTimeout - the expiration timeoutCopyright © 2023. All rights reserved.