com.vaadin.collaborationengine.
Class AbstractCollaborationManager
- java.lang.Object
-
- com.vaadin.collaborationengine.AbstractCollaborationManager
-
Direct Known Subclasses:
public abstract class AbstractCollaborationManager extends Object
The common abstract superclass of Collaboration Managers.
Author:
Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractCollaborationManager.ActivationHandler
The callback executed when the manager is activated, i.e.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCollaborationManager(UserInfo localUser, String topicId, CollaborationEngine collaborationEngine)
Constructs a new manager instance.
-
Method Summary
All Methods Modifier and Type Method Description void
close()
Closes the manager connection to the topic.
protected CollaborationEngine
getCollaborationEngine()
Gets the
CollaborationEngine
of this manager.UserInfo
getLocalUser()
Gets the local user of this manager.
String
getTopicId()
Gets the topic id of this manager.
void
onConnectionFailed(TopicConnectionRegistration.ConnectionFailedAction connectionFailedAction)
Adds an action to be executed if the topic connection fails.
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.
void
setActivationHandler(AbstractCollaborationManager.ActivationHandler handler)
Sets a handler that will be executed when the manager is activated, i.e.
-
-
-
Constructor Detail
-
AbstractCollaborationManager
protected AbstractCollaborationManager(UserInfo localUser, String topicId, CollaborationEngine collaborationEngine)
Constructs a new manager instance.
Parameters:
localUser
- the local user, notnull
topicId
- the topic id, notnull
collaborationEngine
- the Collaboration Engine instance, notnull
-
-
Method Detail
-
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, notnull
connectionActivationCallback
- the callback to be executed when a connection is activated, notnull
-
setActivationHandler
public void setActivationHandler(AbstractCollaborationManager.ActivationHandler handler)
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,null
to 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, ornull
to remove an existing action
-
getCollaborationEngine
protected CollaborationEngine getCollaborationEngine()
Gets the
CollaborationEngine
of this manager.Returns:
the
CollaborationEngine
, notnull
-
getLocalUser
public UserInfo getLocalUser()
Gets the local user of this manager.
Returns:
the local user, not
null
-
getTopicId
public String 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. with
ComponentConnectionContext
when the component is detached.
-
-