Class CometdOnlyofficeService

java.lang.Object
org.exoplatform.onlyoffice.cometd.CometdOnlyofficeService
All Implemented Interfaces:
org.picocontainer.Startable

public class CometdOnlyofficeService extends Object implements org.picocontainer.Startable
The CometdOnlyofficeService.
  • Field Details

    • CHANNEL_NAME

      public static final String CHANNEL_NAME
      The channel name.
      See Also:
    • CHANNEL_NAME_PARAMS

      public static final String CHANNEL_NAME_PARAMS
      The channel name.
      See Also:
    • DOCUMENT_SAVED_EVENT

      public static final String DOCUMENT_SAVED_EVENT
      The document saved event.
      See Also:
    • DOCUMENT_DELETED_EVENT

      public static final String DOCUMENT_DELETED_EVENT
      The document deleted event.
      See Also:
    • DOCUMENT_CHANGED_EVENT

      public static final String DOCUMENT_CHANGED_EVENT
      The document changed event.
      See Also:
    • DOCUMENT_VERSION_EVENT

      public static final String DOCUMENT_VERSION_EVENT
      The document version event.
      See Also:
    • DOCUMENT_TITLE_UPDATED

      public static final String DOCUMENT_TITLE_UPDATED
      The document title updated event.
      See Also:
    • DOCUMENT_USERSAVED

      public static final String DOCUMENT_USERSAVED
      The document usersave event.
      See Also:
    • EDITOR_CLOSED_EVENT

      public static final String EDITOR_CLOSED_EVENT
      The editor closed event.
      See Also:
    • DOCUMENT_CONTENT_UPDATED_EVENT

      public static final String DOCUMENT_CONTENT_UPDATED_EVENT
      The Constant DOCUMENT_CONTENT_UPDATED_EVENT.
      See Also:
    • MIN_THREADS

      public static final int MIN_THREADS
      Base minimum number of threads for document updates thread executors.
      See Also:
    • MIN_MAX_THREADS

      public static final int MIN_MAX_THREADS
      Minimal number of threads maximum possible for document updates thread executors.
      See Also:
    • THREAD_IDLE_TIME

      public static final int THREAD_IDLE_TIME
      Thread idle time for thread executors (in seconds).
      See Also:
    • MAX_FACTOR

      public static final int MAX_FACTOR
      Maximum threads per CPU for thread executors of document changes channel.
      See Also:
    • QUEUE_FACTOR

      public static final int QUEUE_FACTOR
      Queue size per CPU for thread executors of document updates channel.
      See Also:
    • THREAD_PREFIX

      public static final String THREAD_PREFIX
      Thread name used for the executor.
      See Also:
    • editors

      protected final OnlyofficeEditorService editors
      The Onlyoffice editor service.
    • exoBayeux

      protected final org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeux
      The exo bayeux.
    • service

      protected final CometdOnlyofficeService.CometdService service
      The service.
    • eventsHandlers

      protected final ExecutorService eventsHandlers
      The call handlers.
    • jcrService

      protected final org.exoplatform.services.jcr.RepositoryService jcrService
      The jcr service.
  • Constructor Details

    • CometdOnlyofficeService

      public CometdOnlyofficeService(org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeux, OnlyofficeEditorService onlyofficeEditorService, org.exoplatform.services.jcr.RepositoryService jcrService)
      Instantiates the CometdOnlyofficeService.
      Parameters:
      exoBayeux - the exoBayeux
      onlyofficeEditorService - the onlyoffice editor service
      jcrService - the jcr service
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • channelsAsString

      protected String channelsAsString(Set<org.cometd.bayeux.server.ServerChannel> channels)
      Channels as string.
      Parameters:
      channels - the channels
      Returns:
      the string
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • getCometdServerPath

      public String getCometdServerPath()
      Gets the cometd server path.
      Returns:
      the cometd server path
    • getUserToken

      public String getUserToken(String userId)
      Gets the user token.
      Parameters:
      userId - the userId
      Returns:
      the token
    • createThreadExecutor

      protected ExecutorService createThreadExecutor(String threadNamePrefix, int maxFactor, int queueFactor)
      Create a new thread executor service.
      Parameters:
      threadNamePrefix - the thread name prefix
      maxFactor - - max processes per CPU core
      queueFactor - - queue size per CPU core
      Returns:
      the executor service
    • getDisplayName

      protected String getDisplayName(String userId)
      Gets user's display name.
      Parameters:
      userId - the userId
      Returns:
      the displayName