com.vaadin.collaborationengine.
Class CollaborationEngineConfiguration
- java.lang.Object
-
- com.vaadin.collaborationengine.CollaborationEngineConfiguration
-
public class CollaborationEngineConfiguration extends Object
Configuration object for
CollaborationEngine
. When running in production mode, it is required to set this configuration for the Collaboration Engine associated with the currentVaadinService
. This should be done by callingCollaborationEngine.configure(VaadinService, CollaborationEngineConfiguration)
in aVaadinServiceInitListener
.Since:
3.0
Author:
Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description CollaborationEngineConfiguration(LicenseEventHandler licenseEventHandler)
Creates a new Collaboration Engine configuration with the provided handler for license events.
-
Method Summary
All Methods Modifier and Type Method Description Backend
getBackend()
Gets the configured backend implementation.
String
getBeaconPath()
Gets the configured beacon path.
String
getDataDir()
Gets the configured data-directory.
ExecutorService
getExecutorService()
Gets the configured
ExecutorService
which will be used to dispatch actions asynchronously.LicenseEventHandler
getLicenseEventHandler()
Gets the license event handler of this configuration.
LicenseStorage
getLicenseStorage()
Gets the configured license-storage implementation.
boolean
isAutomaticallyActivatePush()
Checks whether automatic push activation is enabled.
void
setAutomaticallyActivatePush(boolean automaticallyActivatePush)
Sets whether server push should be automatically activated if needed.
void
setBackend(Backend backend)
Sets the backend implementation to use.
void
setBeaconPath(String beaconPath)
Sets the path that is used for the beacon handler.
void
setDataDir(String dataDir)
Sets the path to the data-directory, which is used by Collaboration Engine to store files.
void
setExecutorService(ExecutorService executorService)
Sets the
ExecutorService
which will be used to dispatch actions asynchronously.void
setLicenseStorage(LicenseStorage licenseStorage)
Sets a configured license-storage implementation.
-
-
-
Constructor Detail
-
CollaborationEngineConfiguration
public CollaborationEngineConfiguration(LicenseEventHandler licenseEventHandler)
Creates a new Collaboration Engine configuration with the provided handler for license events.
The handler will be invoked when license events occur, e.g. when the license is expired or when the end-user quota has entered the grace period. The handler can then be used for example to forward these events via e-mail or to a monitoring application to be alerted about the current status of the license.
See
LicenseEvent.LicenseEventType
for a list of license event types.Parameters:
licenseEventHandler
- the license event handler, notnull
Since:
3.0
-
-
Method Detail
-
getLicenseEventHandler
public LicenseEventHandler getLicenseEventHandler()
Gets the license event handler of this configuration.
Returns:
the license event handler
Since:
3.0
-
getDataDir
public String getDataDir()
Gets the configured data-directory.
Returns:
the data-directory
Since:
3.0
-
setDataDir
public void setDataDir(String dataDir)
Sets the path to the data-directory, which is used by Collaboration Engine to store files.
The data-directory can also be configured by setting the
vaadin.ce.dataDir
system property either in the command line or withSystem.setProperty(String, String)
. If a system property is set, it will take precedence over this setting.Parameters:
dataDir
- path to the data-directorySince:
3.0
-
getBeaconPath
public String getBeaconPath()
Gets the configured beacon path.
Returns:
the beacon path
-
setBeaconPath
public void setBeaconPath(String beaconPath)
Sets the path that is used for the beacon handler. This is used to detect when the user has closed a tab.
The beacon path can also be configured by setting the
vaadin.ce.beaconPath
system property either in the command line or withSystem.setProperty(String, String)
. If a system property is set, it will take precedence over this setting.Parameters:
beaconPath
- path used by the beacon handler
-
setAutomaticallyActivatePush
public void setAutomaticallyActivatePush(boolean automaticallyActivatePush)
Sets whether server push should be automatically activated if needed. When enabled, which is the default, Collaboration Engine will automatically activate
PushMode.AUTOMATIC
if neither push nor polling is active for a UI where CollaborationEngine is used. When disabled, no automatic changes are made to the application's push configuration.Parameters:
automaticallyActivatePush
-true
to automatically activate server push if needed,false
to not make any automatic changes to the push configurationSince:
3.0
-
isAutomaticallyActivatePush
public boolean isAutomaticallyActivatePush()
Checks whether automatic push activation is enabled.
Returns:
true
if automatic server push configuration is enabled,false
if it's no enabledSince:
3.0
See Also:
-
setBackend
public void setBackend(Backend backend)
Sets the backend implementation to use. A backend can be used to distribute changes between multiple nodes in a cluster. By default, a local in-memory backend is used.
This is currently an experimental feature and needs to be explicitly enabled using the Vaadin dev-mode Gizmo, in the experimental features tab, or by adding a
src/main/resources/vaadin-featureflags.properties
file with the following content:com.vaadin.experimental.collaborationEngineBackend=true
Parameters:
backend
- the backend to use, notnull
-
getBackend
public Backend getBackend()
Gets the configured backend implementation.
Returns:
the backend implementation, not
null
See Also:
-
getLicenseStorage
public LicenseStorage getLicenseStorage()
Gets the configured license-storage implementation.
Returns:
the license-storage implementation, or
null
if not configured
-
setLicenseStorage
public void setLicenseStorage(LicenseStorage licenseStorage)
Sets a configured license-storage implementation.
Parameters:
licenseStorage
- the license-storage implementation, ornull
to unset
-
getExecutorService
public ExecutorService getExecutorService()
Gets the configured
ExecutorService
which will be used to dispatch actions asynchronously. A custom executor service can be configured withsetExecutorService(ExecutorService)
.Returns:
the configured executor service, or
null
if not set
-
setExecutorService
public void setExecutorService(ExecutorService executorService)
Sets the
ExecutorService
which will be used to dispatch actions asynchronously. An executor service set with this method won't be shutdown automatically, so the developer should take care of that if needed. If not configured, Collaboration Engine will use a thread pool with a fixed number of threads equal to the number of available processors and will take care of shutting it down.Parameters:
executorService
- the executor service, ornull
to remove a previously configured one
-
-