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 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
The channel name.- See Also:
-
CHANNEL_NAME_PARAMS
The channel name.- See Also:
-
DOCUMENT_SAVED_EVENT
The document saved event.- See Also:
-
DOCUMENT_DELETED_EVENT
The document deleted event.- See Also:
-
DOCUMENT_CHANGED_EVENT
The document changed event.- See Also:
-
DOCUMENT_VERSION_EVENT
The document version event.- See Also:
-
DOCUMENT_LINK_EVENT
The document link event.- See Also:
-
DOCUMENT_TITLE_UPDATED
The document title updated event.- See Also:
-
DOCUMENT_USERSAVED
The document usersave event.- See Also:
-
EDITOR_CLOSED_EVENT
The editor closed event.- See Also:
-
DOCUMENT_CONTENT_UPDATED_EVENT
The Constant DOCUMENT_CONTENT_UPDATED_EVENT.- 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
Thread name used for the executor.- See Also:
-
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
Channels as string.- Parameters:
channels- the channels- Returns:
- the string
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getCometdServerPath
Gets the cometd server path.- Returns:
- the cometd server path
-
getUserToken
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 prefixmaxFactor- - max processes per CPU corequeueFactor- - queue size per CPU core- Returns:
- the executor service
-
getDisplayName
Gets user's display name.- Parameters:
userId- the userId- Returns:
- the displayName
-