public class MessageManager extends AbstractCollaborationManager
AbstractCollaborationManager.ActivationHandler| Constructor and Description |
|---|
MessageManager(Component component,
UserInfo localUser,
String topicId)
Creates a new manager for the given component.
|
MessageManager(Component component,
UserInfo localUser,
String topicId,
CollaborationMessagePersister persister)
Creates a new persisting manager for the given component.
|
MessageManager(ConnectionContext context,
UserInfo localUser,
String topicId,
CollaborationEngine collaborationEngine)
Creates a new manager for the given connection context.
|
MessageManager(ConnectionContext context,
UserInfo localUser,
String topicId,
CollaborationMessagePersister persister,
CollaborationEngine collaborationEngine)
Creates a new persisting manager for the given connection context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setMessageHandler(MessageHandler handler)
Sets a handler which will be invoked for all messages already in the
topic and when a new message is submitted.
|
CompletableFuture<Void> |
submit(CollaborationMessage message)
Submits a message to the topic.
|
CompletableFuture<Void> |
submit(String text)
Submits a message to the topic as the current local user.
|
close, getCollaborationEngine, getLocalUser, getTopicId, openTopicConnection, setActivationHandlerpublic MessageManager(Component component, UserInfo localUser, String topicId)
component - the component which holds UI access, not nulllocalUser - the information of the local user, not nulltopicId - the id of the topic to connect to, not nullpublic MessageManager(Component component, UserInfo localUser, String topicId, CollaborationMessagePersister persister)
component - the component which holds UI access, not nulllocalUser - the information of the local user, not nulltopicId - the id of the topic to connect to, not nullpersister - the persister to read/write messages to an external sourcepublic MessageManager(ConnectionContext context, UserInfo localUser, String topicId, CollaborationEngine collaborationEngine)
context - the context that manages connection status, not nulllocalUser - the information of the local user, not nulltopicId - the id of the topic to connect to, not nullcollaborationEngine - the collaboration engine instance to use, not nullpublic MessageManager(ConnectionContext context, UserInfo localUser, String topicId, CollaborationMessagePersister persister, CollaborationEngine collaborationEngine)
context - the context that manages connection status, not nulllocalUser - the information of the local user, not nulltopicId - the id of the topic to connect to, not nullpersister - the persister to read/write messages to an external sourcecollaborationEngine - the collaboration engine instance to use, not nullpublic void setMessageHandler(MessageHandler handler)
The handler accepts a MessageHandler.MessageContext as a parameter which
contains a reference to the sent message.
handler - the message handler, or null to remove an existing
handlerpublic CompletableFuture<Void> submit(String text)
text - the text of the message, not nullnullpublic CompletableFuture<Void> submit(CollaborationMessage message)
message - the message, not nullnullCopyright © 2023. All rights reserved.