Class CometdOnlyofficeService
java.lang.Object
org.exoplatform.onlyoffice.cometd.CometdOnlyofficeService
- All Implemented Interfaces:
org.picocontainer.Startable
The CometdOnlyofficeService.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThe CometService is responsible for sending messages to Cometd channels when a document is saved. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe channel name.static final StringThe channel name.static final StringThe document changed event.static final StringThe Constant DOCUMENT_CONTENT_UPDATED_EVENT.static final StringThe document deleted event.static final StringThe document link event.static final StringThe document saved event.static final StringThe document title updated event.static final StringThe content was written outside the editor: the open editors show stale content.static final StringThe document usersave event.static final StringThe document version event.static final StringThe editor closed event.protected final OnlyofficeEditorServiceThe Onlyoffice editor service.protected final ExecutorServiceThe call handlers.protected final org.mortbay.cometd.continuation.EXoContinuationBayeuxThe exo bayeux.protected final org.exoplatform.services.jcr.RepositoryServiceThe jcr service.static final intMaximum threads per CPU for thread executors of document changes channel.static final intMinimal number of threads maximum possible for document updates thread executors.static final intBase minimum number of threads for document updates thread executors.static final intQueue size per CPU for thread executors of document updates channel.protected final CometdOnlyofficeService.CometdServiceThe service.static final intThread idle time for thread executors (in seconds).static final StringThread name used for the executor. -
Constructor Summary
ConstructorsConstructorDescriptionCometdOnlyofficeService(org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeux, OnlyofficeEditorService onlyofficeEditorService, org.exoplatform.services.jcr.RepositoryService jcrService) Instantiates the CometdOnlyofficeService. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringchannelsAsString(Set<org.cometd.bayeux.server.ServerChannel> channels) Channels as string.protected ExecutorServicecreateThreadExecutor(String threadNamePrefix, int maxFactor, int queueFactor) Create a new thread executor service.Gets the cometd server path.protected StringgetDisplayName(String userId) Gets user's display name.getUserToken(String userId) Gets the user token.voidstart()voidstop()
-
Field Details
-
CHANNEL_NAME
-
CHANNEL_NAME_PARAMS
-
DOCUMENT_SAVED_EVENT
-
DOCUMENT_DELETED_EVENT
-
DOCUMENT_CHANGED_EVENT
-
DOCUMENT_VERSION_EVENT
-
DOCUMENT_LINK_EVENT
-
DOCUMENT_TITLE_UPDATED
-
DOCUMENT_USERSAVED
-
EDITOR_CLOSED_EVENT
-
DOCUMENT_CONTENT_UPDATED_EVENT
The Constant DOCUMENT_CONTENT_UPDATED_EVENT.- See Also:
-
DOCUMENT_UPDATED_OUTSIDE_EVENT
The content was written outside the editor: the open editors show stale content.- See Also:
-
MIN_THREADS
public static final int MIN_THREADSBase minimum number of threads for document updates thread executors.- See Also:
-
MIN_MAX_THREADS
public static final int MIN_MAX_THREADSMinimal number of threads maximum possible for document updates thread executors.- See Also:
-
THREAD_IDLE_TIME
public static final int THREAD_IDLE_TIMEThread idle time for thread executors (in seconds).- See Also:
-
MAX_FACTOR
public static final int MAX_FACTORMaximum threads per CPU for thread executors of document changes channel.- See Also:
-
QUEUE_FACTOR
public static final int QUEUE_FACTORQueue size per CPU for thread executors of document updates channel.- See Also:
-
THREAD_PREFIX
-
editors
The Onlyoffice editor service. -
exoBayeux
protected final org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeuxThe exo bayeux. -
service
The service. -
eventsHandlers
The call handlers. -
jcrService
protected final org.exoplatform.services.jcr.RepositoryService jcrServiceThe 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 exoBayeuxonlyofficeEditorService- the onlyoffice editor servicejcrService- the jcr service
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
channelsAsString
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getCometdServerPath
-
getUserToken
-
createThreadExecutor
protected ExecutorService createThreadExecutor(String threadNamePrefix, int maxFactor, int queueFactor) Create a new thread executor service.- Parameters:
threadNamePrefix- the thread name prefixmaxFactor- - max processes per CPU corequeueFactor- - queue size per CPU core- Returns:
- the executor service
-
getDisplayName
-