-
public class RealtimeAnnotationsRealtimeAnnotation provides subscription capabilities for annotations received on a channel. It allows adding or removing listeners to handle annotation events and facilitates broadcasting those events to the appropriate listeners.
Note: This is an experimental API. While the underlying functionality is stable, the public API may change in future releases.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeAnnotations.AnnotationListener
-
Constructor Summary
Constructors Constructor Description RealtimeAnnotations(ChannelBase channel, RestAnnotations restAnnotations)
-
Method Summary
Modifier and Type Method Description voidpublish(String messageSerial, Annotation annotation, CompletionListener listener)Publishes an annotation to the specified channel with the given message serial.Validates and encodes the annotation before sending it as a protocol message. voidpublish(Message message, Annotation annotation, CompletionListener listener)See publish voidpublish(String messageSerial, Annotation annotation)Publishes an annotation to the specified channel with the given message serial.Validates and encodes the annotation before sending it as a protocol message. voidpublish(Message message, Annotation annotation)See publish voiddelete(String messageSerial, Annotation annotation, CompletionListener listener)Deletes an annotation associated with the specified message serial.Sets the annotation action to `ANNOTATION_DELETE` and publishes theupdate to the channel with the given completion listener. voiddelete(Message message, Annotation annotation, CompletionListener listener)See delete voiddelete(String messageSerial, Annotation annotation)voiddelete(Message message, Annotation annotation)See delete PaginatedResult<Annotation>get(String messageSerial, Array<Param> params)Retrieves a paginated list of annotations associated with the specified message serial. PaginatedResult<Annotation>get(Message message, Array<Param> params)See get PaginatedResult<Annotation>get(String messageSerial)Retrieves a paginated list of annotations associated with the specified message serial. PaginatedResult<Annotation>get(Message message)See get voidgetAsync(String messageSerial, Array<Param> params, Callback<AsyncPaginatedResult<Annotation>> callback)Asynchronously retrieves a paginated list of annotations associated with the specified message serial. voidgetAsync(Message message, Array<Param> params, Callback<AsyncPaginatedResult<Annotation>> callback)See getAsync voidgetAsync(String messageSerial, Callback<AsyncPaginatedResult<Annotation>> callback)Asynchronously retrieves a paginated list of annotations associated with the specified message serial. voidgetAsync(Message message, Callback<AsyncPaginatedResult<Annotation>> callback)See getAsync synchronized voidsubscribe(RealtimeAnnotations.AnnotationListener listener)Subscribes the given AnnotationListener to the channel, allowing it to receive annotations.If the channel's attach on subscribe option is enabled, the channel is attached automatically. synchronized voidunsubscribe(RealtimeAnnotations.AnnotationListener listener)Unsubscribes the specified AnnotationListener from the channel, stopping itfrom receiving further annotations. synchronized voidsubscribe(String type, RealtimeAnnotations.AnnotationListener listener)Subscribes the given AnnotationListener to the channel for a specific annotation type,allowing it to receive annotations of the specified type. synchronized voidunsubscribe(String type, RealtimeAnnotations.AnnotationListener listener)Unsubscribes the specified AnnotationListener from receiving annotationsof a particular type within the channel. voidonAnnotation(ProtocolMessage protocolMessage)Internal method. -
-
Constructor Detail
-
RealtimeAnnotations
RealtimeAnnotations(ChannelBase channel, RestAnnotations restAnnotations)
-
-
Method Detail
-
publish
void publish(String messageSerial, Annotation annotation, CompletionListener listener)
Publishes an annotation to the specified channel with the given message serial.Validates and encodes the annotation before sending it as a protocol message.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message to be annotatedannotation- the annotation object associated with the messagelistener- the completion listener to handle success or failure during the publish process
-
publish
void publish(Message message, Annotation annotation, CompletionListener listener)
See publish
-
publish
void publish(String messageSerial, Annotation annotation)
Publishes an annotation to the specified channel with the given message serial.Validates and encodes the annotation before sending it as a protocol message.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message to be annotatedannotation- the annotation object associated with the message
-
publish
void publish(Message message, Annotation annotation)
See publish
-
delete
void delete(String messageSerial, Annotation annotation, CompletionListener listener)
Deletes an annotation associated with the specified message serial.Sets the annotation action to `ANNOTATION_DELETE` and publishes theupdate to the channel with the given completion listener.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message being annotatedannotation- the annotation object to be deletedlistener- the completion listener to handle success or failure during the deletion process
-
delete
void delete(Message message, Annotation annotation, CompletionListener listener)
See delete
-
delete
void delete(String messageSerial, Annotation annotation)
-
delete
void delete(Message message, Annotation annotation)
See delete
-
get
PaginatedResult<Annotation> get(String messageSerial, Array<Param> params)
Retrieves a paginated list of annotations associated with the specified message serial.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message being annotated.params- an array of query parameters for filtering or modifying the request.
-
get
PaginatedResult<Annotation> get(Message message, Array<Param> params)
See get
-
get
PaginatedResult<Annotation> get(String messageSerial)
Retrieves a paginated list of annotations associated with the specified message serial.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message being annotated
-
get
PaginatedResult<Annotation> get(Message message)
See get
-
getAsync
void getAsync(String messageSerial, Array<Param> params, Callback<AsyncPaginatedResult<Annotation>> callback)
Asynchronously retrieves a paginated list of annotations associated with the specified message serial.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message being annotated.params- an array of query parameters for filtering or modifying the request.callback- a callback to handle the result asynchronously, providing an AsyncPaginatedResult containing the matching annotations.
-
getAsync
void getAsync(Message message, Array<Param> params, Callback<AsyncPaginatedResult<Annotation>> callback)
See getAsync
-
getAsync
void getAsync(String messageSerial, Callback<AsyncPaginatedResult<Annotation>> callback)
Asynchronously retrieves a paginated list of annotations associated with the specified message serial.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
messageSerial- the unique serial identifier for the message being annotated.callback- a callback to handle the result asynchronously, providing an AsyncPaginatedResult containing the matching annotations.
-
getAsync
void getAsync(Message message, Callback<AsyncPaginatedResult<Annotation>> callback)
See getAsync
-
subscribe
synchronized void subscribe(RealtimeAnnotations.AnnotationListener listener)
Subscribes the given AnnotationListener to the channel, allowing it to receive annotations.If the channel's attach on subscribe option is enabled, the channel is attached automatically.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
listener- the listener to be subscribed to the channel
-
unsubscribe
synchronized void unsubscribe(RealtimeAnnotations.AnnotationListener listener)
Unsubscribes the specified AnnotationListener from the channel, stopping itfrom receiving further annotations. Any corresponding type-specific listenersassociated with the listener are also removed.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
listener- the AnnotationListener to be unsubscribed
-
subscribe
synchronized void subscribe(String type, RealtimeAnnotations.AnnotationListener listener)
Subscribes the given AnnotationListener to the channel for a specific annotation type,allowing it to receive annotations of the specified type. If the channel's attach on subscribeoption is enabled, the channel is attached automatically.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
type- the specific annotation type to subscribe to; if null, subscribes to all typeslistener- the AnnotationListener to be subscribed
-
unsubscribe
synchronized void unsubscribe(String type, RealtimeAnnotations.AnnotationListener listener)
Unsubscribes the specified AnnotationListener from receiving annotationsof a particular type within the channel. If there are no remaining listenersfor the specified type, the type-specific listener collection is also removed.
Note: This is an experimental API. While the underlying functionality is stable,the public API may change in future releases.
- Parameters:
type- the specific annotation type to unsubscribe from; if null, unsubscribesfrom all annotations associated with the listenerlistener- the AnnotationListener to be unsubscribed
-
onAnnotation
void onAnnotation(ProtocolMessage protocolMessage)
Internal method. Handles incoming annotation messages from the protocol layer.
- Parameters:
protocolMessage- the protocol message containing annotation data
-
-
-
-