Package com.vaadin.collaborationengine
Class AbstractCollaborationManager
java.lang.Object
com.vaadin.collaborationengine.AbstractCollaborationManager
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FormManager,MessageManager,PresenceManager
The common abstract superclass of Collaboration Managers.
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe callback executed when the manager is activated, i.e. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCollaborationManager(UserInfo localUser, String topicId, CollaborationEngine collaborationEngine) Deprecated, for removal: This API element is subject to removal in a future version.This constructor is not compatible with serializationprotectedAbstractCollaborationManager(UserInfo localUser, String topicId, SerializableSupplier<CollaborationEngine> ceSupplier) Constructs a new manager instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the manager connection to the topic.protected CollaborationEngineGets theCollaborationEngineof this manager.Gets the local user of this manager.Gets the topic id of this manager.voidonConnectionFailed(TopicConnectionRegistration.ConnectionFailedAction connectionFailedAction) Adds an action to be executed if the topic connection fails.protected voidopenTopicConnection(ConnectionContext context, SerializableFunction<TopicConnection, Registration> connectionActivationCallback) Opens a connection to the topic of this manager using the provided context and activation callback.voidSets a handler that will be executed when the manager is activated, i.e.
-
Constructor Details
-
AbstractCollaborationManager
@Deprecated(since="6.1", forRemoval=true) protected AbstractCollaborationManager(UserInfo localUser, String topicId, CollaborationEngine collaborationEngine) Deprecated, for removal: This API element is subject to removal in a future version.This constructor is not compatible with serializationConstructs a new manager instance.- Parameters:
localUser- the local user, notnulltopicId- the topic id, notnullcollaborationEngine- the Collaboration Engine instance, notnull
-
AbstractCollaborationManager
protected AbstractCollaborationManager(UserInfo localUser, String topicId, SerializableSupplier<CollaborationEngine> ceSupplier) Constructs a new manager instance.- Parameters:
localUser- the local user, notnulltopicId- the topic id, notnullceSupplier- the Collaboration Engine instance, notnull
-
-
Method Details
-
openTopicConnection
protected void openTopicConnection(ConnectionContext context, SerializableFunction<TopicConnection, Registration> connectionActivationCallback) Opens a connection to the topic of this manager using the provided context and activation callback.- Parameters:
context- the connection context, notnullconnectionActivationCallback- the callback to be executed when a connection is activated, notnull
-
setActivationHandler
Sets a handler that will be executed when the manager is activated, i.e. the connection to the topic is established.- Parameters:
handler- the handler,nullto remove an existing handler
-
onConnectionFailed
public void onConnectionFailed(TopicConnectionRegistration.ConnectionFailedAction connectionFailedAction) Adds an action to be executed if the topic connection fails. The connection can fail in production mode if your Collaboration Engine license has expired, or if the number of unique monthly end users has exceeded the quota in your license.If the connection has already failed when calling this method, the action runs immediately.
- Parameters:
connectionFailedAction- the action to handle topic connection failure, ornullto remove an existing action
-
getCollaborationEngine
Gets theCollaborationEngineof this manager.- Returns:
- the
CollaborationEngine, notnull
-
getLocalUser
Gets the local user of this manager.- Returns:
- the local user, not
null
-
getTopicId
Gets the topic id of this manager.- Returns:
- the topic id, not
null
-
close
public void close()Closes the manager connection to the topic. This is typically handled automatically by the connection-context and in most cases is not needed to be done explicitly, e.g. withComponentConnectionContextwhen the component is detached.
-