Class CometdWebConferencingService
java.lang.Object
org.exoplatform.webconferencing.cometd.CometdWebConferencingService
- All Implemented Interfaces:
org.picocontainer.Startable
Created by The eXo Platform SAS.
- Version:
- $Id: CometdWebConferencingService.java 00000 Aug 17, 2017 pnedonosko $
- Author:
- Peter Nedonosko
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Class CallEventProxy.static classThe Class CallParticipantEvent (joined and leaved participant).classThe Class CallService.static classThe Class CallStateEvent (started, stopped calls).static classThe Class CallEventProxy.static classThe Class UserCallProxy. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum threads per CPU for thread executors of user call channel.static final intQueue size per CPU for thread executors of user call channel.static final StringThe Constant CALL_SUBSCRIPTION_CHANNEL_NAME.static final StringThe Constant CALL_SUBSCRIPTION_CHANNEL_NAME_ALL.static final StringThe Constant CALL_SUBSCRIPTION_CHANNEL_NAME_PATTERN.static final StringThread name used for calls executor.protected final ExecutorServiceThe call handlers.protected final CallLogServiceThe call logs.static final StringThe Constant CALLS_CHANNEL_NAME.static final StringThe Constant COMMAND_ADD_GUEST.static final StringThe Constant COMMAND_CHECK_INVITE.static final StringThe Constant COMMAND_CREATE.static final StringThe Constant COMMAND_CREATE_ORIGINS.static final StringThe Constant COMMAND_DELETE.static final StringThe Constant COMMAND_GET.static final StringThe Constant COMMAND_GET_CALLS_STATE.static final StringThe Constant COMMAND_GET_ORG_IDENTITIES.static final StringThe Constant COMMAND_UPDATE.static final StringThe Constant COMMAND_UPDATE_INVITES.static final StringThe Constant EVENT_CALL_JOINED.static final StringThe Constant EVENT_CALL_LEAVED.static final StringThe Constant EVENT_CALL_STATE.protected final org.mortbay.cometd.continuation.EXoContinuationBayeuxThe exo bayeux.protected final org.exoplatform.services.security.IdentityRegistryThe identity registry.static final StringThe Constant LOG_OK.static final StringThe Constant LOGS_CHANNEL_NAME.static final intMinimal number of threads maximum possible for remote calls' thread executors.static final intBase minimum number of threads for remote calls' thread executors.protected final org.exoplatform.services.organization.OrganizationServiceThe organization.protected final CometdWebConferencingService.CallServiceThe service.static final intThread idle time for thread executors (in seconds).static final StringThe Constant USER_CACHE_NAME.static final StringThe Constant USER_SUBSCRIPTION_CHANNEL_NAME.static final StringThe Constant USER_SUBSCRIPTION_CHANNEL_PATTERN.protected final org.exoplatform.services.cache.ExoCache<String, CometdWebConferencingService.UserCallProxy> Cache of connected users.protected final WebConferencingServiceThe web conferencing. -
Constructor Summary
ConstructorsConstructorDescriptionCometdWebConferencingService(org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organization, WebConferencingService webConferencing, org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeux, org.exoplatform.services.cache.CacheService cacheService, CallLogService callLogs) Instantiates a new CometD interaction service for WebConferencing. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanReturn true if it's Boolean instance of TRUE or false if it is not.protected <T> List<T> As list.protected StringReturn object if it's String instance or null if it is not.protected StringCall id.protected StringchannelsAsString(Set<org.cometd.bayeux.server.ServerChannel> channels) Channels as string.protected StringchannelUserId(String channelId) Channel user id.protected ExecutorServicecreateThreadExecutor(String threadNamePrefix, int maxFactor, int queueFactor) Create a new thread executor service.protected StringcurrentUserId(org.cometd.bayeux.server.ServerMessage message) Current user id.Gets the cometd server path.getUserToken(String userId) Gets the user token.protected List<InvitedIdentity> Invited identities list.voidstart()voidstop()
-
Field Details
-
CALLS_CHANNEL_NAME
The Constant CALLS_CHANNEL_NAME.- See Also:
-
LOGS_CHANNEL_NAME
The Constant LOGS_CHANNEL_NAME.- See Also:
-
CALL_SUBSCRIPTION_CHANNEL_NAME
The Constant CALL_SUBSCRIPTION_CHANNEL_NAME.- See Also:
-
CALL_SUBSCRIPTION_CHANNEL_NAME_ALL
The Constant CALL_SUBSCRIPTION_CHANNEL_NAME_ALL.- See Also:
-
CALL_SUBSCRIPTION_CHANNEL_NAME_PATTERN
The Constant CALL_SUBSCRIPTION_CHANNEL_NAME_PATTERN.- See Also:
-
USER_SUBSCRIPTION_CHANNEL_NAME
The Constant USER_SUBSCRIPTION_CHANNEL_NAME.- See Also:
-
USER_SUBSCRIPTION_CHANNEL_PATTERN
The Constant USER_SUBSCRIPTION_CHANNEL_PATTERN.- See Also:
-
USER_CACHE_NAME
The Constant USER_CACHE_NAME. -
COMMAND_GET
The Constant COMMAND_GET.- See Also:
-
COMMAND_CREATE
The Constant COMMAND_CREATE.- See Also:
-
COMMAND_CREATE_ORIGINS
The Constant COMMAND_CREATE_ORIGINS.- See Also:
-
COMMAND_UPDATE
The Constant COMMAND_UPDATE.- See Also:
-
COMMAND_DELETE
The Constant COMMAND_DELETE.- See Also:
-
COMMAND_ADD_GUEST
The Constant COMMAND_ADD_GUEST.- See Also:
-
COMMAND_UPDATE_INVITES
The Constant COMMAND_UPDATE_INVITES.- See Also:
-
COMMAND_CHECK_INVITE
The Constant COMMAND_CHECK_INVITE.- See Also:
-
COMMAND_GET_CALLS_STATE
The Constant COMMAND_GET_CALLS_STATE.- See Also:
-
COMMAND_GET_ORG_IDENTITIES
The Constant COMMAND_GET_ORG_IDENTITIES.- See Also:
-
EVENT_CALL_LEAVED
The Constant EVENT_CALL_LEAVED.- See Also:
-
EVENT_CALL_JOINED
The Constant EVENT_CALL_JOINED.- See Also:
-
EVENT_CALL_STATE
The Constant EVENT_CALL_STATE.- See Also:
-
LOG_OK
The Constant LOG_OK.- See Also:
-
MIN_THREADS
public static final int MIN_THREADSBase minimum number of threads for remote calls' thread executors.- See Also:
-
MIN_MAX_THREADS
public static final int MIN_MAX_THREADSMinimal number of threads maximum possible for remote calls' thread executors.- See Also:
-
THREAD_IDLE_TIME
public static final int THREAD_IDLE_TIMEThread idle time for thread executors (in seconds).- See Also:
-
CALL_MAX_FACTOR
public static final int CALL_MAX_FACTORMaximum threads per CPU for thread executors of user call channel.- See Also:
-
CALL_QUEUE_FACTOR
public static final int CALL_QUEUE_FACTORQueue size per CPU for thread executors of user call channel.- See Also:
-
CALL_THREAD_PREFIX
Thread name used for calls executor.- See Also:
-
webConferencing
The web conferencing. -
exoBayeux
protected final org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeuxThe exo bayeux. -
service
The service. -
organization
protected final org.exoplatform.services.organization.OrganizationService organizationThe organization. -
identityRegistry
protected final org.exoplatform.services.security.IdentityRegistry identityRegistryThe identity registry. -
callLogs
The call logs. -
callHandlers
The call handlers. -
usersCache
protected final org.exoplatform.services.cache.ExoCache<String,CometdWebConferencingService.UserCallProxy> usersCacheCache of connected users.
-
-
Constructor Details
-
CometdWebConferencingService
public CometdWebConferencingService(org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organization, WebConferencingService webConferencing, org.mortbay.cometd.continuation.EXoContinuationBayeux exoBayeux, org.exoplatform.services.cache.CacheService cacheService, CallLogService callLogs) Instantiates a new CometD interaction service for WebConferencing.- Parameters:
identityRegistry- the identity registryorganization- the organizationwebConferencing- the web conferencingexoBayeux- the exo bayeuxcacheService- the cache servicecallLogs- the call logs
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
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 user id- Returns:
- the user token
-
currentUserId
Current user id.- Parameters:
message- the message- Returns:
- the string, if user cannot be defined it will be
IdentityConstants.ANONIM
-
channelUserId
Channel user id. It's assumed an user channelUSER_SUBSCRIPTION_CHANNEL_NAME.- Parameters:
channelId- the channel id- Returns:
- the string
- Throws:
IndexOutOfBoundsException- if channel id doesn't look like an user channel
-
channelsAsString
Channels as string.- Parameters:
channels- the channels- Returns:
- the string
-
callId
Call id.- Parameters:
type- the typeinfo- the id- Returns:
- the string
-
asString
Return object if it's String instance or null if it is not.- Parameters:
obj- the obj- Returns:
- the string or null
-
asBoolean
Return true if it's Boolean instance of TRUE or false if it is not.- Parameters:
obj- the obj- Returns:
- the boolean
-
asList
As list.- Type Parameters:
T- the generic type- Parameters:
obj- the objtype- the type- Returns:
- the list
-
invitedIdentitiesFromJson
Invited identities list.- Parameters:
obj- the obj- Returns:
- the list
-
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
-