Class CometdOnlyofficeService

  • All Implemented Interfaces:
    org.picocontainer.Startable

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

      • DOCUMENT_DELETED_EVENT

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

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

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

        public static final String DOCUMENT_TITLE_UPDATED
        The document title updated event.
        See Also:
        Constant Field Values
      • DOCUMENT_CONTENT_UPDATED_EVENT

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

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

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

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

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

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

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

        protected final ExecutorService eventsHandlers
        The call handlers.
      • jcrService

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

      • 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 Detail

      • 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