Class WebConferencingService
java.lang.Object
org.exoplatform.webconferencing.WebConferencingService
- All Implemented Interfaces:
org.picocontainer.Startable
Created by The eXo Platform SAS.
- Version:
- $Id: SkypeService.java 00000 Feb 22, 2017 pnedonosko $
- Author:
- Peter Nedonosko
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRepresent Chat room in calls.classRepresent Space event call.classRepresent Space in calls. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Constant ALL_USERS.static final intThe Constant ARG_MAX_LENGTH.protected final org.exoplatform.services.security.AuthenticatorThe authenticator.protected static final StringThe Constant CALL_ID_SCOPE_NAME.protected static final StringThe Constant CALL_OWNER_SCOPE_NAME.protected final CallDAOThe calls storage.static final StringThe Constant CMS_GROUPS_PATH.static final intThe Constant DATA_MAX_LENGTH.protected static final longThe default duration, in seconds, of an incoming call alert.protected static final longThe default leave grace time, in seconds.static final Stringstatic final StringBroadcast once per participant who declines a call that alerted its participants.static final StringBroadcast once per call start whose incoming call alert closed with at least one decline: when the alert timed out, or when the call stopped before.static final Stringstatic final Stringstatic final StringBroadcast once per participant who did not answer a call before its incoming call alert timed out, or before the call stopped.static final Stringstatic final Stringstatic final Stringstatic final StringThe key telling, in the data ofEVENT_CALL_MISSED, that a group call had already ended when the participant missed it:"true", absent otherwise.static final StringThe key of the user who started the call, in the data ofEVENT_CALL_MISSED.static final StringThe key of the participant who declined the call, in the data ofEVENT_CALL_DECLINED.static final StringThe key of the participants who declined the call, comma separated, in the data ofEVENT_CALL_DECLINES_CLOSED.static final StringThe key of the user concerned by a call event, in the event data.static final StringThe Constant EXO_RSS_ENABLE_PROP.static final StringThe Constant EXO_TITLE_PROP.static final StringThe Constant GROUP.static final intThe Constant ID_MAX_LENGTH.protected final org.exoplatform.services.security.IdentityRegistryThe identity registry.protected static final StringThe init param holding how long, in seconds, a started call alerts its participants.protected final longHow long, in seconds, a started call alerts its participants before they missed it.protected final InviteDAOThe invite storage.static final StringThe Constant JCR_CONTENT.static final StringThe Constant JCR_DATA.static final StringThe Constant JCR_LAST_MODIFIED_PROP.static final StringThe Constant JCR_MIME_TYPE.protected static final StringThe Constant JWT_CONFIGURATION_PROPERTIES.static final longHow much later than in memory the start date of a call may read from the storage, in milliseconds: a storage keeping whole seconds rounds the fraction up or down.protected static final StringThe init param holding how long, in seconds, the leave of a call window whose connection ended waits, once Cometd detected that end: a window reloaded joins again meanwhile and stays in the call.protected final longHow long, in seconds, the leave of a call window whose connection ended waits.protected final org.exoplatform.services.cms.link.LinkManagerThe Link manager.protected final org.exoplatform.services.listener.ListenerServiceThe listener service.protected static final org.exoplatform.services.log.LogThe Constant LOG.protected static final longThe longest incoming call alert, in seconds: the longest delay a browser timer accepts.static final intThe Constant MAX_RESULT_SIZE.protected static final longHow long after the incoming call alert times out the missed call is checked, in seconds: a client starts its alert once the call state reached it and the call was read, so it may still be answered a little after the timeout counted from the call start.protected static final intThe threads marking and notifying the participants who missed a call: a large space call does not hold up the other calls' notifications, and the conditional marks notify each participant once whatever runs concurrently.protected final ScheduledExecutorServiceRuns the missed call check of each started call once its incoming call alert timed out.static final StringThe Constant MIX_PRIVILEGEABLE.protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreatorThe node creator.static final StringThe Constant NT_FILE.static final StringThe Constant NT_RESOURCE.static final StringThe operation call added.static final StringThe operation call declined.static final StringThe operation call deleted.static final StringThe operation call joined.static final StringThe operation call leaved.static final StringThe operation call missed.static final StringThe operation call recorded.static final StringThe operation call started.static final StringThe operation call stopped.protected final org.exoplatform.services.organization.OrganizationServiceThe organization.protected final OriginDAOThe call origins storage.static final StringThe Constant OWNER_TYPE_CHATROOM.static final StringThe Constant OWNER_TYPE_SPACE.static final StringThe Constant OWNER_TYPE_SPACEEVENT.static final StringThe Constant OWNER_TYPE_USER.protected final ParticipantDAOThe participants storage.protected static final StringThe Constant PROVIDER_SCOPE_NAME.protected final Map<String, CallProvider> The providers.protected final org.exoplatform.services.jcr.RepositoryServiceThe repository service.static final Stringprotected static final StringThe Constant SECRET_KEY.protected final StringThe secret key.static final StringThe Constant SESSION_TOKEN_COOKIE.protected final org.exoplatform.services.jcr.ext.app.SessionProviderServiceThe session providers.protected final org.exoplatform.commons.api.settings.SettingServiceThe settings service.protected org.exoplatform.wcm.ext.component.document.service.ShareDocumentServiceThe share service.protected final org.exoplatform.social.core.manager.IdentityManagerThe social identity manager.protected org.exoplatform.social.core.space.spi.SpaceServiceThe space service.static final StringThe status not ok.static final StringThe status ok.static final intThe Constant TEXT_MAX_LENGTH.protected final org.exoplatform.upload.UploadServiceThe upload service.static final StringThe Constant USER.protected static final StringThe Constant USER_CALLS_SCOPE_NAME.protected final Map<String, Set<UserCallListener>> The user listeners.protected static final String -
Constructor Summary
ConstructorsConstructorDescriptionWebConferencingService(org.exoplatform.services.organization.OrganizationService organization, org.exoplatform.social.core.manager.IdentityManager socialIdentityManager, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.commons.api.settings.SettingService settingService, CallDAO callStorage, ParticipantDAO participantsStorage, OriginDAO originsStorage, InviteDAO inviteStorage, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeCreator, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.security.Authenticator authenticator, org.exoplatform.wcm.ext.component.document.service.ShareDocumentService shareService, org.exoplatform.container.xml.InitParams initParams, org.exoplatform.services.cms.link.LinkManager linkManager, org.exoplatform.web.security.codec.CodecInitializer codecInitializer) Instantiates a new web conferencing service. -
Method Summary
Modifier and TypeMethodDescriptionaddCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds) Adds the call to list of active and fires STARTED event.Adds the guest to call.voidaddParticipant(String callId, String partId) Adds the participant to existing call.voidaddPlugin(org.exoplatform.container.component.ComponentPlugin plugin) Adds a provider plugin.voidaddProvider(CallProvider provider) Adds the provider.voidaddUserCallListener(UserCallListener listener) Adds the user listener.booleancheckInvite(String callId, String inviteId, String identity) Check invite.protected voidcheckMissedCall(String callId, String callerId, Date startedAt) RunsnotifyMissedCall(String, String, Date)from the missed call timer, within a request of the portal container.protected voidcheckStoppedMissedCall(CallInfo call, List<String> invitedIds, boolean removed) RunsnotifyStoppedMissedCall(CallInfo, List, boolean)from the missed call timer, within a request of the portal container.protected voidDeprecated.createCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds, Collection<String> spaces, boolean start, Date startDate, Date endDate) Create the call and add it to list of the existing in storage, optionally start the call and notify its participants.protected voidcreateCall(CallInfo call) Create the call in storage with all its participants.protected CallEntitycreateCallEntity(CallInfo call) Creates the call entity.protected OriginEntitycreateOriginEntity(String callId, OriginInfo origin) Creates the origin entity.protected Set<OriginInfo> createOrigins(String providerType, Collection<String> partIds, Collection<String> spacePrettyNames) Creates the origins.protected IdentityInfocreateOwner(String ownerId, String ownerType, String title, boolean isUser, boolean isSpace, boolean isSpaceEvent, boolean isRoom) Creates call owner.protected ParticipantEntitycreateParticipantEntity(String callId, UserInfo user) Creates the participant entity.createParticipants(String providerType, Collection<String> partIds) Make call's direct participants from its IDs.protected StringCurrent user id.declineCall(String callId, String partId, String clientId) Marks a user participant of a started call as having declined it.protected intDelete all user calls.protected voiddeleteCall(String id) Delete call.protected <C extends SQLException>
CexceptionCause(jakarta.persistence.PersistenceException pe, Class<C> causeClass) Find cause exception of given type.protected CallInfofindCallById(String id, boolean withParticipants) Find call in storage by its ID.protected StringfindChatRoomCallId(String roomId) Find a call, owned by a space with given ID, in calls storage.protected StringfindGroupCallId(String ownerId) Find a call, owned by group with given ID, in calls storage.protected List<IdentityData> findGroups(String name, int count) Find groups.findGroupsAndUsers(String name) Find groups and users.protected StringfindLastSpaceEventCallId(String ownerId) Find last space event call id.protected StringfindSpaceCallId(String spaceId) Find a call, owned by a space with given ID, in calls storage.Reads from the database the participants who declined a call being stopped or removed: the participants this request loaded before may be outdated.protected Collection<CallInfo> findUserGroupCalls(String userId) Find user group calls in calls storage.protected List<IdentityData> Find users.protected voidfireUserCallJoined(String callId, String providerType, String ownerId, String ownerType, String partId, String userId) Fire user call joined a new part.protected voidfireUserCallLeaved(String callId, String providerType, String ownerId, String ownerType, String partId, String userId) Fire user call part leaved.protected voidfireUserCallStateChanged(String userId, String callId, String providerType, String callState, String ownerId, String ownerType) Fire user call state.getActiveProvidersForSpace(String spaceId) Gets an active call info.longGets how long, in seconds, a started call alerts its participants.protected StringgetInviteId(String callId) Gets the invite id.longGets how long, in seconds, the leave of a call window whose connection to its call ended waits before it applies, counted from when Cometd detected that end (its session expiry for a window that unloaded without a word, about 10 seconds over WebSocket): a window reloaded that joins the call again meanwhile from a new client, or a window reconnected that subscribed to the call again with the same client, keeps its user in the call.protected longGets how long after a call starts its missed call check runs: the incoming call timeout, plusMISSED_CALL_CHECK_MARGINfor the clients that started their alert later.getProvider(String type) Gets the provider.getProviderConfiguration(String providerType, Locale locale) Gets the provider configuration.Gets the provider configurations.getProviderConfigurations(Locale locale, String remoteId, boolean ignoreEnabled) Gets the provider configurations.getRecordingUrl(String identity, String fileName, String type) getRoomInfo(String id, String title, String[] members) Gets the room info.Gets the JWT secret key.getSpaceEventInfo(String spaceIdentityId, String[] partIds, String[] spacesPrettyName) Gets the space event info, it will return actual event participants at the moment of invocation.getSpaceInfo(String spacePrettyName) Gets the space info, it will return actual space members at the moment of invocation.getSpaceMembers(String spacePrettyName) Gets the space members.getUserCalls(String userId) Gets the user calls.getUserInfo(String id) Gets the user info.protected booleanhasLeftAlready(CallInfo call, String partId, String clientId) Tells if a leave from a client repeats one already applied: the user left the call and has no client in it, as when a call window leaves the call and then its subscription to the call ends.voidinitialize all saved started calls state.protected voidinvalidateCall(String id, boolean isGroup) Invalidate a call by an ID.protected booleanisAlertedCall(CallInfo call) Tells if starting a call alerts its participants of an incoming call: any call but the one of a planned event.protected booleanisDeclined(UserInfo part) Tells if a call participant declined the call, whether the caller was already sent the email grouping the declines or not.protected booleanTells if a call participant is not in the call: never joined, left or declined it.protected booleanisInCallFromAnotherClient(CallInfo call, String partId, String clientId) Removes a client the participant leaves the call from, and tells if the participant is still in the call from another client.static booleanisNotNullArg(String arg) Checks if argument not null (also not empty and not longer of 32 chars).protected booleanisSpaceMember(String userName, String spacePrettyName) Checks if is space member.static booleanisValidArg(String arg) Checks if argument valid (null or not empty and not longer of 32 chars).static booleanisValidData(String data) Checks if data valid (null or not empty and not longer of 2000 bytes in UTF8 encoding).static booleanChecks is ID valid (not null, not empty and not longer of 255 chars).static booleanisValidText(String text) Checks if is valid text (null, not empty and not longer of 255 chars).booleanisVideoConferenceEnabled(String spaceId) Join a call if it is started or start already stopped one.protected CallProviderConfigurationjsonToProviderConfig(org.json.JSONObject json) Json to provider config.If call started, then notify all its parties that given participant leaved.leaveCallFromClient(String callId, String partId, String clientId) Leaves a call from a client whose connection to it ended, only when the participant is in the call from that client: a leave applied late, once the leave grace time passed (seegetLeaveGraceTime()), changes nothing on a call started again since, which the participant is not in from that client.markDeclinesClosed(CallInfo call, List<String> declinerIds, Date latestStart) Marks as notified of their decline the given participants of a call, each only while still declined and the call still from a start not later than the given date.Marks as notified the participants who declined a call that alerted its participants, when it is stopped or removed: read from the database, each marked only while still declined and the call still from that start.markRemovedCallMissed(CallInfo call, List<String> invitedIds) Marks as missed, before the call is removed with its participants, the participants still invited to it: among the missed call check of the same start, a join or a decline, a participant is marked once.protected StringmetricMessage(String userId, CallInfo call, String operation, String status, Long duration, String error, Double fileSize) Metric message for reporting to the stats logger.protected voidnotifyDeclinesClosed(String callId, String callerId, Date startedAt) Reports to the caller, once the incoming call alert of a call start timed out, the participants who declined it: they are marked as notified, andEVENT_CALL_DECLINES_CLOSEDis broadcast with them, when there is at least one.protected voidnotifyMissedCall(String callId, String callerId, Date startedAt) Marks as missed the participants still invited to a call whose incoming call alert timed out, and broadcastsEVENT_CALL_MISSEDfor each of them.protected voidnotifyStoppedMissedCall(CallInfo call, List<String> invitedIds, boolean removed) Marks as missed the participants still invited to a call when it stopped, and broadcastsEVENT_CALL_MISSEDfor each of them, as the user who started the call (seeCallInfo.getCallerId()), withEVENT_DATA_CALL_ENDEDfor a group call.protected voidnotifyUserCallStateChanged(CallInfo call, String initiatorId, String state) Notify user call state changed.protected org.json.JSONObjectProvider config to json.protected CallInforeadCallEntity(CallEntity savedCall, boolean withParticipants) Read call entity.protected CallProviderConfigurationreadProviderConfig(String type) Read saved call provider configuration.protected voidremoveParticipant(String callId, UserInfo participant) Remove call participant (for leaved state) in a single transaction.voidremoveUserCallListener(UserCallListener listener) Removes the user listener.protected WebConferencingService.RoomInfoRoom info.voidsaveActiveCallProvider(ActiveCallProvider activeCallProvider, String identityId) voidsaveProviderConfiguration(CallProviderConfiguration conf, String spaceId) Save provider configuration.protected voidscheduleMissedCall(String callId, String callerId, Date startedAt) Schedules the missed call check of a call that just started, for when its incoming call alert timed out on every client (seegetMissedCallCheckDelay()).protected voidscheduleStoppedDeclinesClosed(CallInfo call, List<String> declinerIds) Reports to the caller, out of the request that stopped the call, the participants who declined it before it stopped and were marked by the stop (seenotifyDeclinesClosed(String, String, Date)).protected voidscheduleStoppedMissedCall(CallInfo call, List<String> invitedIds, boolean removed) Notifies, out of the request that stopped the call, the participants a call stopped before they answered its incoming call alert, whatever stopped it: the caller hanging up, every other participant leaving, a client stopping or deleting the call, or its call channel ending.protected WebConferencingService.SpaceEventInfospaceEventInfo(String spaceIdentityId, String callId, String[] participants, String[] spaces) Space event info.protected WebConferencingService.SpaceInfoSpace info.voidstart()Starts existing call and fires STARTED event.protected voidStart existing call.voidstop()Removes the call info from active and fires STOPPED event.protected voidStop call.protected StringstoppingUserId(CallInfo call) Returns the user a stop is attributed to, in the call stopped event and its metrics: the current user, or, when the stop runs with no user or as the anonymous one, as when a provider's server reports that its meeting ended, the caller of the call.protected voidsyncCallEntity(CallInfo call, CallEntity entity) Update call entity from given CallInfo instance.protected voidSync group members and participants.protected voidtxAddParticipant(String callId, UserInfo participant) Tx add participant.protected voidtxCreateCall(CallInfo call) Creates the call in a single transaction.protected intDelete all user calls (not group ones) within a single transaction.protected voidtxDeleteCall(String id) Delete call within a transaction.protected voidtxRemoveParticipant(String callId, String partId) Remove call participant.protected voidtxStopCall(CallInfo call, boolean remove) Tx stop call.protected voidSync group members and participants.protected voidtxUpdateCall(CallInfo call) Update existing call (mark it started, stopped etc) in a single transaction.protected voidTx update call and its origins.protected voidUpdate call and all its participants in a single transaction.protected voidtxUpdateInvites(String callId, List<InvitedIdentity> identities) Tx update invites.protected voidtxUpdateParticipant(String callId, UserInfo participant) Update call participant (for joined or leaved state) in a single transaction.protected voidtxUpdateParticipants(CallInfo call, List<UserInfo> participants) Tx update participants.updateCall(String callId, String ownerId, String newOwnerType, String newTitle, String newProviderType, List<String> partIds, List<String> spaces, Date startDate, Date endDate) Updates the existing call information and original settings (initial participants and spaces).protected voidupdateCall(CallInfo call) Update existing call (mark it started, stopped etc).protected voidupdateCallAndOrigins(CallInfo call) Update call and its origins.protected voidUpdate call and all its participants.updateCallProviderUrl(String identityId, ActiveCallProvider activeCallProvider) updateInvites(String callId, List<InvitedIdentity> identities) Update invites.protected voidupdateParticipant(String callId, UserInfo participant) Update call participant (for joined or leaved state) in a single transaction.updateParticipants(String callId, List<String> partIds) Update participants of the call.voidupdateVideoConferenceEnabled(String spaceId, boolean enabled, String provider) voiduploadFile(UploadFileInfo uploadInfo, jakarta.servlet.http.HttpServletRequest request) Upload recording of the call.protected org.exoplatform.services.security.IdentityuserIdentity(String userId) Find or create user identity.protected UserInfo
-
Field Details
-
ID_MAX_LENGTH
public static final int ID_MAX_LENGTHThe Constant ID_MAX_LENGTH.- See Also:
-
TEXT_MAX_LENGTH
public static final int TEXT_MAX_LENGTHThe Constant TEXT_MAX_LENGTH.- See Also:
-
ARG_MAX_LENGTH
public static final int ARG_MAX_LENGTHThe Constant ARG_MAX_LENGTH.- See Also:
-
DATA_MAX_LENGTH
public static final int DATA_MAX_LENGTHThe Constant DATA_MAX_LENGTH.- See Also:
-
MAX_RESULT_SIZE
public static final int MAX_RESULT_SIZEThe Constant MAX_RESULT_SIZE.- See Also:
-
SESSION_TOKEN_COOKIE
The Constant SESSION_TOKEN_COOKIE. -
OPERATION_CALL_ADDED
-
OPERATION_CALL_STARTED
-
OPERATION_CALL_JOINED
-
OPERATION_CALL_LEAVED
-
OPERATION_CALL_DECLINED
-
OPERATION_CALL_MISSED
-
OPERATION_CALL_STOPPED
-
OPERATION_CALL_DELETED
-
OPERATION_CALL_RECORDED
-
STATUS_OK
-
STATUS_NOT_OK
-
EVENT_CALL_CREATED
- See Also:
-
EVENT_CALL_STARTED
- See Also:
-
EVENT_CALL_JOINDED
- See Also:
-
EVENT_CALL_LEFT
- See Also:
-
EVENT_CALL_STOPPED
- See Also:
-
EVENT_CALL_RECORDED
- See Also:
-
EVENT_CALL_MISSED
Broadcast once per participant who did not answer a call before its incoming call alert timed out, or before the call stopped. The source is the call, the data holds the participant inEVENT_DATA_USER_ID, the user who started the call inEVENT_DATA_CALLER_IDand, for a group call that had already ended,EVENT_DATA_CALL_ENDED.- See Also:
-
EVENT_CALL_DECLINED
Broadcast once per participant who declines a call that alerted its participants. The source is the call, the data holds the user who started the call inEVENT_DATA_USER_ID, the one the decline is reported to, and the participant who declined inEVENT_DATA_DECLINER_ID.- See Also:
-
EVENT_CALL_DECLINES_CLOSED
Broadcast once per call start whose incoming call alert closed with at least one decline: when the alert timed out, or when the call stopped before. The source is the call, the data holds the user who started the call inEVENT_DATA_USER_IDand the participants who declined it inEVENT_DATA_DECLINER_IDS.- See Also:
-
EVENT_DATA_USER_ID
The key of the user concerned by a call event, in the event data.- See Also:
-
EVENT_DATA_CALLER_ID
The key of the user who started the call, in the data ofEVENT_CALL_MISSED.- See Also:
-
EVENT_DATA_CALL_ENDED
The key telling, in the data ofEVENT_CALL_MISSED, that a group call had already ended when the participant missed it:"true", absent otherwise.- See Also:
-
EVENT_DATA_DECLINER_ID
The key of the participant who declined the call, in the data ofEVENT_CALL_DECLINED.- See Also:
-
EVENT_DATA_DECLINER_IDS
The key of the participants who declined the call, comma separated, in the data ofEVENT_CALL_DECLINES_CLOSED.- See Also:
-
ROOM_DEFAULT_AVATAR_URL
- See Also:
-
CALL_OWNER_SCOPE_NAME
The Constant CALL_OWNER_SCOPE_NAME. -
CALL_ID_SCOPE_NAME
The Constant CALL_ID_SCOPE_NAME. -
USER_CALLS_SCOPE_NAME
The Constant USER_CALLS_SCOPE_NAME. -
PROVIDER_SCOPE_NAME
The Constant PROVIDER_SCOPE_NAME. -
JWT_CONFIGURATION_PROPERTIES
The Constant JWT_CONFIGURATION_PROPERTIES.- See Also:
-
SECRET_KEY
-
INCOMING_CALL_TIMEOUT
The init param holding how long, in seconds, a started call alerts its participants.- See Also:
-
DEFAULT_INCOMING_CALL_TIMEOUT
protected static final long DEFAULT_INCOMING_CALL_TIMEOUTThe default duration, in seconds, of an incoming call alert.- See Also:
-
LEAVE_GRACE_TIME
The init param holding how long, in seconds, the leave of a call window whose connection ended waits, once Cometd detected that end: a window reloaded joins again meanwhile and stays in the call.- See Also:
-
DEFAULT_LEAVE_GRACE_TIME
protected static final long DEFAULT_LEAVE_GRACE_TIMEThe default leave grace time, in seconds.- See Also:
-
MISSED_CALL_CHECK_MARGIN
protected static final long MISSED_CALL_CHECK_MARGINHow long after the incoming call alert times out the missed call is checked, in seconds: a client starts its alert once the call state reached it and the call was read, so it may still be answered a little after the timeout counted from the call start.- See Also:
-
MISSED_CALL_THREADS
protected static final int MISSED_CALL_THREADSThe threads marking and notifying the participants who missed a call: a large space call does not hold up the other calls' notifications, and the conditional marks notify each participant once whatever runs concurrently.- See Also:
-
MAX_INCOMING_CALL_TIMEOUT
protected static final long MAX_INCOMING_CALL_TIMEOUTThe longest incoming call alert, in seconds: the longest delay a browser timer accepts.- See Also:
-
LAST_DATE_PRECISION
public static final long LAST_DATE_PRECISIONHow much later than in memory the start date of a call may read from the storage, in milliseconds: a storage keeping whole seconds rounds the fraction up or down.- See Also:
-
VIDEO_CONFERENCE_IS_ENABLED
- See Also:
-
ALL_USERS
-
GROUP
-
USER
-
OWNER_TYPE_USER
-
OWNER_TYPE_SPACE
-
OWNER_TYPE_SPACEEVENT
-
OWNER_TYPE_CHATROOM
-
CMS_GROUPS_PATH
-
EXO_TITLE_PROP
-
NT_FILE
-
JCR_CONTENT
-
JCR_DATA
-
JCR_MIME_TYPE
-
JCR_LAST_MODIFIED_PROP
-
EXO_RSS_ENABLE_PROP
-
NT_RESOURCE
-
MIX_PRIVILEGEABLE
-
LOG
protected static final org.exoplatform.services.log.Log LOGThe Constant LOG. -
secretKey
The secret key. -
incomingCallTimeout
protected final long incomingCallTimeoutHow long, in seconds, a started call alerts its participants before they missed it. -
leaveGraceTime
protected final long leaveGraceTimeHow long, in seconds, the leave of a call window whose connection ended waits. -
missedCallTimer
Runs the missed call check of each started call once its incoming call alert timed out. -
organization
protected final org.exoplatform.services.organization.OrganizationService organizationThe organization. -
listenerService
protected final org.exoplatform.services.listener.ListenerService listenerServiceThe listener service. -
settingService
protected final org.exoplatform.commons.api.settings.SettingService settingServiceThe settings service. -
callStorage
The calls storage. -
participantsStorage
The participants storage. -
originsStorage
The call origins storage. -
inviteStorage
The invite storage. -
providers
The providers. -
spaceService
protected org.exoplatform.social.core.space.spi.SpaceService spaceServiceThe space service. -
userListeners
The user listeners. -
uploadService
protected final org.exoplatform.upload.UploadService uploadServiceThe upload service. -
repositoryService
protected final org.exoplatform.services.jcr.RepositoryService repositoryServiceThe repository service. -
sessionProviders
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProvidersThe session providers. -
nodeCreator
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeCreatorThe node creator. -
identityRegistry
protected final org.exoplatform.services.security.IdentityRegistry identityRegistryThe identity registry. -
authenticator
protected final org.exoplatform.services.security.Authenticator authenticatorThe authenticator. -
linkManager
protected final org.exoplatform.services.cms.link.LinkManager linkManagerThe Link manager.
-
-
Constructor Details
-
Method Details
-
isValidId
-
isValidText
-
isValidArg
-
isNotNullArg
-
isValidData
Checks if data valid (null or not empty and not longer of 2000 bytes in UTF8 encoding).- Parameters:
data- the data- Returns:
- true, if is valid data
- Throws:
UnsupportedEncodingException- if UTF8 encoding not found in runtime
-
userInfo
- Throws:
IdentityStateException
-
getUserInfo
Gets the user info.- Parameters:
id- the id- Returns:
- the user info
- Throws:
IdentityStateException- if error happened during searching the user in Organization Service
-
getSpaceInfo
public WebConferencingService.SpaceInfo getSpaceInfo(String spacePrettyName) throws IdentityStateException, StorageException Gets the space info, it will return actual space members at the moment of invocation.- Parameters:
spacePrettyName- the space pretty name- Returns:
- the space info
- Throws:
IdentityStateException- if error reading space member in Organization ServiceStorageException- if error reading saved group call ID associated with a space
-
getSpaceEventInfo
public WebConferencingService.SpaceEventInfo getSpaceEventInfo(String spaceIdentityId, String[] partIds, String[] spacesPrettyName) throws IdentityStateException, StorageException Gets the space event info, it will return actual event participants at the moment of invocation. Even participants will be resolved from the owner and given spaces' members plus given participants IDs.- Parameters:
spaceIdentityId- the space identity idpartIds- the participants IDs (attendees) added to the event directlyspacesPrettyName- the Social spaces' pretty names for add its members as participants (attendees) to the event- Returns:
- the space event info
- Throws:
IdentityStateException- the identity state exceptionStorageException- the storage exception
-
getSecretKey
-
spaceInfo
protected WebConferencingService.SpaceInfo spaceInfo(String spacePrettyName, String callId) throws IdentityStateException Space info.- Parameters:
spacePrettyName- the space pretty namecallId- the call id- Returns:
- the space info
- Throws:
IdentityStateException- if error reading space member in Organization Service
-
spaceEventInfo
protected WebConferencingService.SpaceEventInfo spaceEventInfo(String spaceIdentityId, String callId, String[] participants, String[] spaces) throws IdentityStateException Space event info.- Parameters:
spaceIdentityId- the space identity idcallId- the call idparticipants- the participants user namesspaces- an array of space pretty names- Returns:
- the space info
- Throws:
IdentityStateException- the identity state exception
-
getRoomInfo
public WebConferencingService.RoomInfo getRoomInfo(String id, String title, String[] members) throws IdentityStateException, StorageException Gets the room info.- Parameters:
id- the idtitle- the titlemembers- the room members- Returns:
- the room info
- Throws:
IdentityStateException- if error reading room member in Organization ServiceStorageException- if error reading saved group call ID associated with a room
-
roomInfo
protected WebConferencingService.RoomInfo roomInfo(String id, String title, String[] members, String callId) throws IdentityStateException Room info.- Parameters:
id- the idtitle- the titlemembers- the memberscallId- the call id- Returns:
- the room info
- Throws:
IdentityStateException- if user cannot be read
-
addCall
public CallInfo addCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds) throws CallArgumentException, StorageException, IdentityStateException, CallConflictException, CallSettingsException Adds the call to list of active and fires STARTED event.- Parameters:
id- the id of the callownerId- the owner id of the callownerType- the owner typetitle- the title of the callproviderType- the provider typepartIds- the participants IDs- Returns:
- the call info object of type
CallInfo - Throws:
CallArgumentException- if call argument has wrong value (failed validation)StorageException- if error reading, adding or updating call information in persistent storageIdentityStateException- if error reading room member in Organization ServiceCallConflictException- if such call already exists and has active state (started and/or running)CallSettingsException- if call entry has wrong settings (it's for Chat room call, the title - too long or has bad value)
-
createCall
public CallInfo createCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds, Collection<String> spaces, boolean start, Date startDate, Date endDate) throws CallArgumentException, StorageException, IdentityStateException, CallConflictException, CallSettingsException Create the call and add it to list of the existing in storage, optionally start the call and notify its participants.- Parameters:
id- the id of the callownerId- the owner id of the callownerType- the owner typetitle- the title of the callproviderType- the provider typepartIds- the original participants collectionspaces- the original spaces (pretty names collection) with members allowed for participating the callstart- the start flag, iftruethen the call will be started (listeners will be notified)- Returns:
- the call info object of type
CallInfo - Throws:
CallArgumentException- if call argument has wrong value (failed validation)StorageException- if error reading, adding or updating call information in persistent storageIdentityStateException- if error reading room member in Organization ServiceCallConflictException- if such call already exists and has active state (started and/or running)CallSettingsException- if call entry has wrong settings (it's for Chat room call, the title - too long or has bad value)
-
updateCall
public CallInfo updateCall(String callId, String ownerId, String newOwnerType, String newTitle, String newProviderType, List<String> partIds, List<String> spaces, Date startDate, Date endDate) throws InvalidCallException, CallArgumentException, CallSettingsException, StorageException, CallNotFoundException, IdentityStateException, ParticipantNotFoundException Updates the existing call information and original settings (initial participants and spaces). Note: this method will not update the call actual participants states (who is running the call right now or leaved it), seeupdateParticipants(String, List)method for such work.- Parameters:
callId- the call idownerId- the owner idnewOwnerType- the owner typenewTitle- the titlenewProviderType- the provider typepartIds- the participantsspaces- the spacesstartDate- the start dateendDate- the end date- Returns:
- the call info
- Throws:
InvalidCallException- the invalid call exceptionCallArgumentException- the call argument exceptionCallSettingsException- the call settings exceptionStorageException- the storage exceptionCallNotFoundException- the call not found exceptionIdentityStateException- the identity state exceptionParticipantNotFoundException- See Also:
-
createParticipants
protected Set<UserInfo> createParticipants(String providerType, Collection<String> partIds) throws IdentityStateException, CallArgumentException Make call's direct participants from its IDs.- Parameters:
providerType- the provider typepartIds- the participants IDs- Returns:
- the participants
- Throws:
IdentityStateException- the identity state exceptionCallArgumentException- the call argument exception
-
createOrigins
protected Set<OriginInfo> createOrigins(String providerType, Collection<String> partIds, Collection<String> spacePrettyNames) throws IdentityStateException, CallArgumentException Creates the origins.- Parameters:
providerType- the provider typepartIds- the part idsspacePrettyNames- the spaces names- Returns:
- the sets of origins built from participants and spaces
- Throws:
IdentityStateException- the identity state exceptionCallArgumentException- the call argument exception
-
createOwner
protected IdentityInfo createOwner(String ownerId, String ownerType, String title, boolean isUser, boolean isSpace, boolean isSpaceEvent, boolean isRoom) throws CallArgumentException, IdentityStateException Creates call owner.- Parameters:
ownerId- the owner idownerType- the owner typetitle- the titleisUser- the is userisSpace- the is spaceisSpaceEvent- the is space eventisRoom- the is room- Returns:
- the call owner
- Throws:
CallArgumentException- the call argument exceptionIdentityStateException- the identity state exception
-
getCall
Gets an active call info.- Parameters:
id- the id- Returns:
- the call info or
nullif call not found - Throws:
InvalidCallException- if call in erroneous state, see cause exception for details
-
initializeStartedCallsState
public void initializeStartedCallsState()initialize all saved started calls state. -
stopCall
public CallInfo stopCall(String callId, boolean remove) throws CallNotFoundException, InvalidCallException Removes the call info from active and fires STOPPED event. The stop is attributed to the current user, or to the caller of the call when it runs with no user (seestoppingUserId(CallInfo)).- Parameters:
callId- the call idremove- the remove- Returns:
- the call info object of type
CallInfo - Throws:
CallNotFoundException- if call not foundInvalidCallException- if call in erroneous state and cannot be used, details are in caused exception
-
stoppingUserId
Returns the user a stop is attributed to, in the call stopped event and its metrics: the current user, or, when the stop runs with no user or as the anonymous one, as when a provider's server reports that its meeting ended, the caller of the call.- Parameters:
call- the call to stop- Returns:
- the user id,
nullorIdentityConstants.ANONIMwhen there is neither a current user nor a caller
-
stopCall
Stop call.- Parameters:
call- the calluserId- the user idremove- the remove- Throws:
StorageException- if persistence exception happen
-
startCall
public CallInfo startCall(String callId, String clientId) throws CallNotFoundException, InvalidCallException Starts existing call and fires STARTED event. It's actual for group calls.- Parameters:
callId- the call idclientId- the client id- Returns:
- the call info object of type
CallInfo - Throws:
CallNotFoundException- if call not foundInvalidCallException- if call in erroneous state and cannot be used, details are in caused exception
-
startCall
protected void startCall(CallInfo call, String partId, String clientId, boolean notifyStarted) throws ParticipantNotFoundException, CallSettingsException, StorageException, CallNotFoundException Start existing call.- Parameters:
call- the callpartId- the participant id who started the callclientId- the client idnotifyStarted- iftruethen all participants will be notified about the started call- Throws:
ParticipantNotFoundException- if call or its participants not found in storageCallSettingsException- if call entry has wrong settings (room title, owner type etc)StorageException- if storage exception happenCallNotFoundException- if call not found in storage
-
updateParticipants
public CallInfo updateParticipants(String callId, List<String> partIds) throws CallNotFoundException, InvalidCallException, StorageException Update participants of the call. Used to update current participants of call with provided user IDs. Use this method to sycn a group call associated with external apps like eXo Chat.- Parameters:
callId- the call idpartIds- the participants ids- Returns:
- the call info
- Throws:
CallNotFoundException- the call not found exceptionInvalidCallException- the invalid call exceptionStorageException- the storage exception
-
addParticipant
public void addParticipant(String callId, String partId) throws StorageException, CallNotFoundException, InvalidCallException, IdentityStateException, CallArgumentException Adds the participant to existing call.- Parameters:
callId- the call idpartId- the part id- Throws:
StorageException- the storage exceptionCallNotFoundException- the call not found exceptionInvalidCallException- the invalid call exceptionIdentityStateException- the identity state exceptionCallArgumentException- if participant cannot be found
-
addGuest
public CallInfo addGuest(String callIId, String guestId) throws StorageException, CallNotFoundException, InvalidCallException, IdentityStateException Adds the guest to call. Adds guest as a participant to the call.- Parameters:
callIId- the call idguestId- the guest id- Returns:
- the call info
- Throws:
StorageException- the storage exceptionCallNotFoundException- the call not found exceptionInvalidCallException- the invalid call exceptionIdentityStateException- the identity state exception
-
updateInvites
public CallInfo updateInvites(String callId, List<InvitedIdentity> identities) throws CallNotFoundException, InvalidCallException, StorageException Update invites. Updates list of invited users/groups for the call that can join by invite link.- Parameters:
callId- the call ididentities- the invites- Returns:
- the call info
- Throws:
CallNotFoundException- the call not found exceptionInvalidCallException- the invalid call exceptionStorageException- the storage exception
-
joinCall
public CallInfo joinCall(String callId, String partId, String clientId) throws InvalidCallException, CallNotFoundException, IdentityStateException, CallArgumentException Join a call if it is started or start already stopped one.- Parameters:
callId- the call idpartId- the participant idclientId- the client id- Returns:
- the call info object of type
CallInfo - Throws:
InvalidCallException- if call in erroneous state and cannot be used, details are in caused exceptionCallNotFoundException- if call not foundIdentityStateException- the identity state exceptionCallArgumentException- if participant cannot be found
-
leaveCall
public CallInfo leaveCall(String callId, String partId, String clientId) throws InvalidCallException If call started, then notify all its parties that given participant leaved. If call not found thennullwill be returned. A participant in the call from several clients (devices or browser tabs) leaves it only with the last of them: the leave of another client only removes that client, and a leave from a client the participant is not in the call from changes nothing. A leave with no client id makes the participant leave from all their clients.- Parameters:
callId- the call idpartId- the participant idclientId- the client id- Returns:
- the call info or
nullif call not found - Throws:
InvalidCallException- if call in erroneous state and cannot be used, details are in caused exception
-
leaveCallFromClient
public CallInfo leaveCallFromClient(String callId, String partId, String clientId) throws InvalidCallException Leaves a call from a client whose connection to it ended, only when the participant is in the call from that client: a leave applied late, once the leave grace time passed (seegetLeaveGraceTime()), changes nothing on a call started again since, which the participant is not in from that client.- Parameters:
callId- the call idpartId- the participant idclientId- the client whose connection ended- Returns:
- the call info or
nullif call not found - Throws:
InvalidCallException- if call in erroneous state and cannot be used, details are in caused exception
-
declineCall
public CallInfo declineCall(String callId, String partId, String clientId) throws CallNotFoundException, ParticipantNotFoundException, InvalidCallException Marks a user participant of a started call as having declined it. The call goes on for its other participants, a P2P one included: its state is unchanged and it is never stopped here. Only the user listeners of the decliner are notified, as having left the call, so that the incoming call alert closes on every client of that user. A participant read as joined is left untouched: the decline comes from an alert still shown after a join from another client. On a call that alerted nobody, the read and the write take no lock, as injoinCall(String, String, String)andleaveCall(String, String, String): a join of the same user committed between them is overwritten. The decliner can still join the call later. On a call that alerted its participants (seeCallInfo.getCallerId()), a participant declines while still invited and the call still started, both checked by the storage when the participant is marked, and the decline is broadcast asEVENT_CALL_DECLINEDonce committed: a decline racing the missed call check, a join or the stop of the call is broadcast only when it is marked first. The decline of a participant who already declined, missed the call or left it, from an alert still shown on another client, changes nothing but that alert. On another call, a participant who did not decline yet is marked declined.- Parameters:
callId- the call idpartId- the participant id, the user declining the callclientId- the client id- Returns:
- the call info
- Throws:
CallNotFoundException- if call not foundParticipantNotFoundException- if the user is not a participant of the callInvalidCallException- if call in erroneous state and cannot be used, details are in caused exception
-
isDeclined
Tells if a call participant declined the call, whether the caller was already sent the email grouping the declines or not.- Parameters:
part- the participant- Returns:
trueif the participant declined the call
-
isInCallFromAnotherClient
protected boolean isInCallFromAnotherClient(CallInfo call, String partId, String clientId) throws ParticipantNotFoundException, StorageException Removes a client the participant leaves the call from, and tells if the participant is still in the call from another client. A client the participant is not in the call from is not removed, and still tells so while the participant has other clients. The remaining clients are saved when the leaving one was removed. The client the participant started the call from does not count as one they are in the call from. The clients are read, changed and saved with no lock, as the state inleaveCall(String, String, String): two clients of one user leaving at once can each save the other's client, which keeps the user in the call.- Parameters:
call- the callpartId- the participant idclientId- the client the participant leaves from,nullto leave from all their clients- Returns:
trueif the participant is still in the call from another client- Throws:
ParticipantNotFoundException- if the participant cannot be found in storageStorageException- if storage exception happen
-
hasLeftAlready
Tells if a leave from a client repeats one already applied: the user left the call and has no client in it, as when a call window leaves the call and then its subscription to the call ends.- Parameters:
call- the callpartId- the participant idclientId- the client the participant leaves from,nullto leave from all their clients- Returns:
trueif the user already left the call from all their clients
-
isGone
Tells if a call participant is not in the call: never joined, left or declined it.- Parameters:
part- the participant- Returns:
trueif the participant is not in the call
-
isAlertedCall
Tells if starting a call alerts its participants of an incoming call: any call but the one of a planned event.- Parameters:
call- the call- Returns:
trueif the participants are alerted when the call starts
-
scheduleMissedCall
Schedules the missed call check of a call that just started, for when its incoming call alert timed out on every client (seegetMissedCallCheckDelay()). The check runs on this server only: a restart stops every started call anyway (seeinitializeStartedCallsState()). A participant who answered the alert but whose join reaches the server after the check still gets the missed call notification.- Parameters:
callId- the call idcallerId- the user who started the callstartedAt- the start date of the call
-
markRemovedCallMissed
Marks as missed, before the call is removed with its participants, the participants still invited to it: among the missed call check of the same start, a join or a decline, a participant is marked once. It runs one conditional update per invited participant, each telling whether this call marked that participant: a single update of all of them would not tell which ones another writer marked meanwhile. Its cost is bounded by the participants the call holds when it is removed, whatever added them (its start, a participants update, a guest): for a space call, up to the members of the space.- Parameters:
call- the call to removeinvitedIds- the participants invited to the call- Returns:
- the participants marked missed by this call, to notify once the call is removed, or when its removal fails: the missed call check of the same start no longer finds them invited
-
scheduleStoppedMissedCall
Notifies, out of the request that stopped the call, the participants a call stopped before they answered its incoming call alert, whatever stopped it: the caller hanging up, every other participant leaving, a client stopping or deleting the call, or its call channel ending. A call stopped when the server starts (seeinitializeStartedCallsState()) or deleted as outdated does not get here.- Parameters:
call- the stopped call, as it was when it stoppedinvitedIds- the participants still invited when the call stoppedremoved-truewhen the call was removed with its participants
-
checkStoppedMissedCall
RunsnotifyStoppedMissedCall(CallInfo, List, boolean)from the missed call timer, within a request of the portal container.- Parameters:
call- the stopped call, as it was when it stoppedinvitedIds- the participants still invited when the call stoppedremoved-truewhen the call was removed with its participants
-
notifyStoppedMissedCall
Marks as missed the participants still invited to a call when it stopped, and broadcastsEVENT_CALL_MISSEDfor each of them, as the user who started the call (seeCallInfo.getCallerId()), withEVENT_DATA_CALL_ENDEDfor a group call. A participant of a group call is marked only while still invited and the call still stopped, from a start not later than the stopped one by more thanLAST_DATE_PRECISION, checked by the storage when the participant is marked: with the missed call check of the same start, a join or a later start, the event is broadcast at most once per participant. The participants of a removed call were marked before it was removed (seemarkRemovedCallMissed(CallInfo, List)): they are notified without a mark. The event of a participant is broadcast after the mark is committed: a call started again in between does not withhold it. A participant who cannot be marked is logged and not notified.- Parameters:
call- the stopped call, as it was when it stoppedinvitedIds- the participants still invited when the call stoppedremoved-truewhen the call was removed with its participants
-
getMissedCallCheckDelay
protected long getMissedCallCheckDelay()Gets how long after a call starts its missed call check runs: the incoming call timeout, plusMISSED_CALL_CHECK_MARGINfor the clients that started their alert later.- Returns:
- the delay in milliseconds
-
checkMissedCall
RunsnotifyMissedCall(String, String, Date)from the missed call timer, within a request of the portal container.- Parameters:
callId- the call idcallerId- the user who started the callstartedAt- the start date of the call
-
notifyDeclinesClosed
protected void notifyDeclinesClosed(String callId, String callerId, Date startedAt) throws InvalidCallException Reports to the caller, once the incoming call alert of a call start timed out, the participants who declined it: they are marked as notified, andEVENT_CALL_DECLINES_CLOSEDis broadcast with them, when there is at least one. Nothing is done for a call no longer started, or started again after the given start date, the declines of that later start being its own: a call stopped meanwhile marked its declines once it stopped (seestopCall(CallInfo, String, boolean)), so that the caller gets one email; a removed call marked those read before its removal, a decline marked meanwhile is in none. Each participant is marked only while still declined and the call still from that start, checked by the storage: with the report of a stop running at the same time, a participant is reported once.- Parameters:
callId- the call idcallerId- the user who started the callstartedAt- the start date of the call the check was scheduled for- Throws:
InvalidCallException- if the call cannot be read
-
scheduleStoppedDeclinesClosed
Reports to the caller, out of the request that stopped the call, the participants who declined it before it stopped and were marked by the stop (seenotifyDeclinesClosed(String, String, Date)).- Parameters:
call- the stopped call, as it was when it stoppeddeclinerIds- the participants marked as notified of their decline when the call stopped
-
markDeclinesClosedOnStop
Marks as notified the participants who declined a call that alerted its participants, when it is stopped or removed: read from the database, each marked only while still declined and the call still from that start. A stopped call is marked once it stopped, in the request that stopped it, when no decline can be marked any more (seedeclineCall(String, String, String)), but for a decline marked against the call still started and committed after this read, its transaction overlapping the stop: the storage does not order the two, the stop writing the call alone. A removed call loses its participants and is marked before its removal: a decline marked after this read, before the removal, is in no report.- Parameters:
call- the call stopped or to remove- Returns:
- the participants marked, to report to the caller
-
findStoppedCallDeclinerIds
Reads from the database the participants who declined a call being stopped or removed: the participants this request loaded before may be outdated. A read that fails is logged and reports no decline, so that the stop or the removal goes on.- Parameters:
call- the call being stopped or removed- Returns:
- the ids of the participants who declined the call and whose caller was not notified yet
-
markDeclinesClosed
protected List<String> markDeclinesClosed(CallInfo call, List<String> declinerIds, Date latestStart) Marks as notified of their decline the given participants of a call, each only while still declined and the call still from a start not later than the given date. It runs one conditional update per participant, each telling whether this call marked that participant, so that a decline is reported to the caller once whatever the concurrent writers. Its cost is bounded by the participants who declined the call.- Parameters:
call- the calldeclinerIds- the participants who declined the calllatestStart- the latest start date of the call the participants may be marked for- Returns:
- the participants marked by this call, to report to the caller
-
notifyMissedCall
protected void notifyMissedCall(String callId, String callerId, Date startedAt) throws InvalidCallException Marks as missed the participants still invited to a call whose incoming call alert timed out, and broadcastsEVENT_CALL_MISSEDfor each of them. Nothing is done when the call is over, or was started again after the given start date, that later start having its own check. Each participant is marked only while still invited and the call still started from that start, both checked by the storage when the participant is marked: among concurrent checks, with a join or a decline committed meanwhile, or the call stopped or started again meanwhile, the event is broadcast at most once per participant, and never for a start later than the checked one by more thanLAST_DATE_PRECISION, the precision of a start date stored in whole seconds: a call started again within that second has its invitees marked by this check, up to a second before its own alert times out. The event of a participant is broadcast after the mark is committed: a join, a decline or a stop committed in between does not withhold it. A participant who cannot be marked is logged and not notified, and the check goes on with the other participants.- Parameters:
callId- the call idcallerId- the user who started the callstartedAt- the start date of the call the check was scheduled for- Throws:
InvalidCallException- if the call cannot be read
-
getUserCalls
Gets the user calls.- Parameters:
userId- the user id- Returns:
- the user call states
- Throws:
StorageException- if persistence error happen
-
addUserCallListener
Adds the user listener.- Parameters:
listener- the listener
-
removeUserCallListener
Removes the user listener.- Parameters:
listener- the listener
-
fireUserCallStateChanged
protected void fireUserCallStateChanged(String userId, String callId, String providerType, String callState, String ownerId, String ownerType) Fire user call state.- Parameters:
userId- the user idcallId- the call idproviderType- the provider typecallState- the call stateownerId- the caller idownerType- the caller type
-
fireUserCallJoined
protected void fireUserCallJoined(String callId, String providerType, String ownerId, String ownerType, String partId, String userId) Fire user call joined a new part.- Parameters:
callId- the call idproviderType- the provider typeownerId- the owner idownerType- the owner typepartId- the part iduserId- the user id
-
fireUserCallLeaved
protected void fireUserCallLeaved(String callId, String providerType, String ownerId, String ownerType, String partId, String userId) Fire user call part leaved.- Parameters:
callId- the call idproviderType- the provider typeownerId- the owner idownerType- the owner typepartId- the part iduserId- the user id
-
addPlugin
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin) Adds a provider plugin. This method is safe in runtime: if configured provider is not an instance ofCallProviderthen it will log a warning and let server continue the start.- Parameters:
plugin- the plugin
-
addProvider
Adds the provider.- Parameters:
provider- the provider
-
checkInvite
-
getProvider
Gets the provider.- Parameters:
type- the type- Returns:
- the provider
-
getProviderConfigurations
public Set<CallProviderConfiguration> getProviderConfigurations(Locale locale, String remoteId, boolean ignoreEnabled) Gets the provider configurations.- Parameters:
locale- the locale to apply to provider description, ifnulla default one will be used- Returns:
- the provider configurations
-
getProviderConfigurations
Gets the provider configurations.- Returns:
- the provider configurations
-
getProviderConfiguration
Gets the provider configuration.- Parameters:
providerType- the provider typelocale- the locale to apply to provider description, ifnulla default one will be used- Returns:
- the provider configuration or
nullif provider not found
-
saveProviderConfiguration
public void saveProviderConfiguration(CallProviderConfiguration conf, String spaceId) throws UnsupportedEncodingException, org.json.JSONException Save provider configuration.- Parameters:
conf- the configuration to save- Throws:
UnsupportedEncodingException- if UTF8 not supportedorg.json.JSONException- if cannot serialize to JSON
-
findGroupsAndUsers
Find groups and users.- Parameters:
name- the name- Returns:
- the list
- Throws:
Exception- the exception
-
findUsers
Find users.- Parameters:
name- the namecount- the count- Returns:
- the list
- Throws:
Exception- the exception
-
findGroups
Find groups.- Parameters:
name- the namecount- the count- Returns:
- the list
- Throws:
Exception- the exception
-
uploadFile
public void uploadFile(UploadFileInfo uploadInfo, jakarta.servlet.http.HttpServletRequest request) throws UploadFileException, javax.jcr.RepositoryException Upload recording of the call.- Parameters:
uploadInfo- the upload inforequest- the request- Throws:
UploadFileException- the upload recording exceptionjavax.jcr.RepositoryException- the repository exception
-
userIdentity
Find or create user identity.- Parameters:
userId- the user id- Returns:
- the identity can be null if not found and cannot be created via current authenticator
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getIncomingCallTimeout
public long getIncomingCallTimeout()Gets how long, in seconds, a started call alerts its participants. Past it, a participant who neither joined nor declined the call missed it.- Returns:
- the incoming call timeout in seconds
-
getLeaveGraceTime
public long getLeaveGraceTime()Gets how long, in seconds, the leave of a call window whose connection to its call ended waits before it applies, counted from when Cometd detected that end (its session expiry for a window that unloaded without a word, about 10 seconds over WebSocket): a window reloaded that joins the call again meanwhile from a new client, or a window reconnected that subscribed to the call again with the same client, keeps its user in the call.0applies the leave once that end is detected.- Returns:
- the leave grace time in seconds
-
isSpaceMember
-
getSpaceMembers
-
jsonToProviderConfig
protected CallProviderConfiguration jsonToProviderConfig(org.json.JSONObject json) throws org.json.JSONException Json to provider config.- Parameters:
json- the json- Returns:
- the call provider configuration
- Throws:
org.json.JSONException- the JSON exception
-
providerConfigToJson
protected org.json.JSONObject providerConfigToJson(CallProviderConfiguration conf) throws org.json.JSONException Provider config to json.- Parameters:
conf- the conf- Returns:
- the JSON object
- Throws:
org.json.JSONException- the JSON exception
-
readProviderConfig
Read saved call provider configuration.- Parameters:
type- the type- Returns:
- the configuration
-
currentUserId
-
notifyUserCallStateChanged
-
readCallEntity
protected CallInfo readCallEntity(CallEntity savedCall, boolean withParticipants) throws CallSettingsException, IdentityStateException, CallOwnerException Read call entity.- Parameters:
savedCall- the saved callwithParticipants- the with participants- Returns:
- the call info
- Throws:
CallSettingsException- if call entry has wrong settings (Chat room call title too long or has bad value)IdentityStateException- if error reading call owner or participantCallOwnerException- if call owner is of wrong type or cannot be found (as an identity)
-
getInviteId
Gets the invite id.- Parameters:
callId- the call id- Returns:
- the invite id
- Throws:
StorageException- the storage exception
-
createCallEntity
Creates the call entity.- Parameters:
call- the call- Returns:
- the call entity
- Throws:
CallSettingsException- if call entry has wrong settings (chat room title)
-
syncCallEntity
Update call entity from given CallInfo instance.- Parameters:
call- the callentity- the entity- Throws:
CallSettingsException- if call entry has wrong settings (room title)
-
createParticipantEntity
Creates the participant entity.- Parameters:
callId- the call iduser- the user- Returns:
- the participant entity
-
createOriginEntity
Creates the origin entity.- Parameters:
callId- the call idorigin- the origin- Returns:
- the origin entity
-
exceptionCause
protected <C extends SQLException> C exceptionCause(jakarta.persistence.PersistenceException pe, Class<C> causeClass) Find cause exception of given type.- Type Parameters:
C- the generic type- Parameters:
pe- the pecauseClass- the cause class- Returns:
- the c
-
txCreateCall
protected void txCreateCall(CallInfo call) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException, CallSettingsException Creates the call in a single transaction.- Parameters:
call- the call- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- if persistence exception happenCallSettingsException- if call entry has wrong settings (chat room title)- See Also:
-
txAddParticipant
protected void txAddParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException Tx add participant.- Parameters:
callId- the call idparticipant- the participant- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
txStopCall
protected void txStopCall(CallInfo call, boolean remove) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException Tx stop call.- Parameters:
call- the callremove- the remove- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
txUpdateCall
protected void txUpdateCall(CallInfo call) throws CallNotFoundException, IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException, CallSettingsException Update existing call (mark it started, stopped etc) in a single transaction.- Parameters:
call- the call- Throws:
CallNotFoundException- if call not found in storageIllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exceptionCallSettingsException- if call entry has wrong settings (room call title)
-
txUpdateInvites
protected void txUpdateInvites(String callId, List<InvitedIdentity> identities) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException Tx update invites.- Parameters:
callId- the ididentities- the identities- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
txUpdateParticipant
protected void txUpdateParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException, ParticipantNotFoundException Update call participant (for joined or leaved state) in a single transaction.- Parameters:
callId- the call idparticipant- the participant- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exceptionParticipantNotFoundException- if call participant not found in storage
-
txSyncMembersAndParticipants
Sync group members and participants.- Parameters:
call- the call
-
txRemoveParticipant
protected void txRemoveParticipant(String callId, String partId) throws ParticipantNotFoundException Remove call participant.- Parameters:
callId- the call idpartId- the participant id- Throws:
ParticipantNotFoundException- if participant not found
-
txUpdateCallAndParticipants
protected void txUpdateCallAndParticipants(CallInfo call) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException, CallNotFoundException, CallSettingsException, ParticipantNotFoundException Update call and all its participants in a single transaction.- Parameters:
call- the call- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exceptionCallNotFoundException- if call or its participants not found in storageCallSettingsException- if call entry has wrong settings (room call title)ParticipantNotFoundException- if call participant not found in storage
-
txUpdateCallAndOrigins
protected void txUpdateCallAndOrigins(CallInfo call) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException, CallNotFoundException, CallSettingsException, ParticipantNotFoundException Tx update call and its origins.- Parameters:
call- the call- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exceptionCallNotFoundException- the call not found exceptionCallSettingsException- the call settings exceptionParticipantNotFoundException- the participant not found exception
-
txDeleteCall
protected void txDeleteCall(String id) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException Delete call within a transaction.- Parameters:
id- the call id- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
txUpdateParticipants
protected void txUpdateParticipants(CallInfo call, List<UserInfo> participants) throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceException Tx update participants.- Parameters:
call- the callparticipants- the participants- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
txDeleteAllUserCalls
protected int txDeleteAllUserCalls() throws IllegalArgumentException, IllegalStateException, jakarta.persistence.PersistenceExceptionDelete all user calls (not group ones) within a single transaction.- Returns:
- number of deleted calls
- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjakarta.persistence.PersistenceException- the persistence exception
-
clearStorage
-
deleteCall
Delete call.- Parameters:
id- the id- Throws:
StorageException- if storage error happens
-
deleteAllUserCalls
Delete all user calls. This will not touch any group call. For use on server start to cleanup the storage.- Returns:
- number of deleted calls
- Throws:
StorageException- if storage error happens
-
updateCallAndParticipants
protected void updateCallAndParticipants(CallInfo call) throws StorageException, ParticipantNotFoundException, CallSettingsException, CallNotFoundException Update call and all its participants.- Parameters:
call- the call- Throws:
StorageException- if storage exception happenParticipantNotFoundException- if call or its participants not found in storageCallSettingsException- if call entry has wrong settings (room call title)CallNotFoundException- if call not found in storage
-
updateCallAndOrigins
protected void updateCallAndOrigins(CallInfo call) throws StorageException, ParticipantNotFoundException, CallSettingsException, CallNotFoundException Update call and its origins.- Parameters:
call- the call- Throws:
StorageException- the storage exceptionParticipantNotFoundException- the participant not found exceptionCallSettingsException- the call settings exceptionCallNotFoundException- the call not found exception
-
syncMembersAndParticipants
Sync group members and participants.- Parameters:
call- the call- Throws:
StorageException- the storage exception
-
updateParticipant
protected void updateParticipant(String callId, UserInfo participant) throws ParticipantNotFoundException, StorageException Update call participant (for joined or leaved state) in a single transaction.- Parameters:
callId- the call idparticipant- the participant- Throws:
ParticipantNotFoundException- if call participant not found in storageStorageException- if storage exception happen
-
removeParticipant
protected void removeParticipant(String callId, UserInfo participant) throws ParticipantNotFoundException, StorageException Remove call participant (for leaved state) in a single transaction.- Parameters:
callId- the call idparticipant- the participant- Throws:
ParticipantNotFoundException- if call participant not found in storageStorageException- if storage exception happen
-
updateCall
protected void updateCall(CallInfo call) throws CallNotFoundException, CallSettingsException, StorageException Update existing call (mark it started, stopped etc).- Parameters:
call- the call- Throws:
CallNotFoundException- if call not found in storageCallSettingsException- if call entry has wrong settings (room call title)StorageException- if storage exception happen
-
findCallById
protected CallInfo findCallById(String id, boolean withParticipants) throws IdentityStateException, StorageException, CallSettingsException, CallOwnerException Find call in storage by its ID.- Parameters:
id- the idwithParticipants- also read participants from the DB- Returns:
- the call info
- Throws:
IdentityStateException- if error reading call owner or participantStorageException- if persistent error happensCallSettingsException- if call entry has wrong settings (Chat room call title too long or has bad value)CallOwnerException- if call owner type of unknown type
-
findGroupCallId
Find a call, owned by group with given ID, in calls storage.- Parameters:
ownerId- the owner id- Returns:
- the string or
nullif no call found - Throws:
StorageException- the storage exception
-
findSpaceCallId
Find a call, owned by a space with given ID, in calls storage.- Parameters:
spaceId- the owner id- Returns:
- the string or
nullif no call found - Throws:
StorageException- the storage exception
-
findChatRoomCallId
Find a call, owned by a space with given ID, in calls storage.- Parameters:
roomId- the room id- Returns:
- the string or
nullif no call found - Throws:
StorageException- the storage exception
-
findLastSpaceEventCallId
Find last space event call id.- Parameters:
ownerId- the owner id- Returns:
- the string
- Throws:
StorageException- the storage exception
-
findUserGroupCalls
Find user group calls in calls storage.- Parameters:
userId- the user id- Returns:
- the collection
- Throws:
StorageException- if persistence error happen
-
createCall
protected void createCall(CallInfo call) throws StorageException, CallConflictException, CallSettingsException Create the call in storage with all its participants. If such call (by ID) already exists aCallConflictExceptionwill be raised.- Parameters:
call- the call info- Throws:
StorageException- if storage exception happenCallConflictException- the call conflicts with another (same ID) callCallSettingsException- the call settings wrong (chat room title)
-
invalidateCall
protected void invalidateCall(String id, boolean isGroup) throws CallConflictException, StorageException Invalidate a call by an ID. If such call (by ID) already found and, it's P2P call but not active - it will be removed, otherwiseCallConflictExceptionwill be thrown. This method designed to be called just beforecreateCall(CallInfo).- Parameters:
id- the idisGroup- the is group- Throws:
CallConflictException- if call conflict found and existing call cannot be removedStorageException- if storage exception happen
-
metricMessage
protected String metricMessage(String userId, CallInfo call, String operation, String status, Long duration, String error, Double fileSize) Metric message for reporting to the stats logger.- Parameters:
userId- the user id of the operationcall- the call in the operationoperation- the operation namestatus- the status of operationduration- the operation duration in millseconds (can benull), it's not a call durationerror- the error if present (can benull)- Returns:
- the string combining all given parameters in specified format according https://community.exoplatform.com/portal/g/:spaces:exo_itop/exo_itop/wiki/SPEC_-_logging_for_monitoring
-
getRecordingUrl
-
getActiveProvidersForSpace
-
saveActiveCallProvider
-
updateCallProviderUrl
public ActiveCallProvider updateCallProviderUrl(String identityId, ActiveCallProvider activeCallProvider) -
updateVideoConferenceEnabled
-
isVideoConferenceEnabled
-
socialIdentityManager