Package org.exoplatform.webconferencing
Class WebConferencingService
- java.lang.Object
-
- org.exoplatform.webconferencing.WebConferencingService
-
- All Implemented Interfaces:
org.picocontainer.Startable
public class WebConferencingService extends Object implements 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 Classes Modifier and Type Class Description classWebConferencingService.RoomInfoRepresent Chat room in calls.classWebConferencingService.SpaceEventInfoRepresent Space event call.classWebConferencingService.SpaceInfoRepresent Space in calls.
-
Field Summary
Fields Modifier and Type Field Description static StringALL_USERSThe Constant ALL_USERS.static intARG_MAX_LENGTHThe Constant ARG_MAX_LENGTH.protected org.exoplatform.services.security.AuthenticatorauthenticatorThe authenticator.protected static StringCALL_ID_SCOPE_NAMEThe Constant CALL_ID_SCOPE_NAME.protected static StringCALL_OWNER_SCOPE_NAMEThe Constant CALL_OWNER_SCOPE_NAME.protected CallDAOcallStorageThe calls storage.static StringCMS_GROUPS_PATHThe Constant CMS_GROUPS_PATH.static intDATA_MAX_LENGTHThe Constant DATA_MAX_LENGTH.static StringEVENT_CALL_CREATEDstatic StringEVENT_CALL_JOINDEDstatic StringEVENT_CALL_LEFTstatic StringEVENT_CALL_RECORDEDstatic StringEVENT_CALL_STARTEDstatic StringEVENT_CALL_STOPPEDstatic StringEXO_RSS_ENABLE_PROPThe Constant EXO_RSS_ENABLE_PROP.static StringEXO_TITLE_PROPThe Constant EXO_TITLE_PROP.static StringGROUPThe Constant GROUP.static intID_MAX_LENGTHThe Constant ID_MAX_LENGTH.protected org.exoplatform.services.security.IdentityRegistryidentityRegistryThe identity registry.protected InviteDAOinviteStorageThe invite storage.static StringJCR_CONTENTThe Constant JCR_CONTENT.static StringJCR_DATAThe Constant JCR_DATA.static StringJCR_LAST_MODIFIED_PROPThe Constant JCR_LAST_MODIFIED_PROP.static StringJCR_MIME_TYPEThe Constant JCR_MIME_TYPE.protected static StringJWT_CONFIGURATION_PROPERTIESThe Constant JWT_CONFIGURATION_PROPERTIES.protected org.exoplatform.services.cms.link.LinkManagerlinkManagerThe Link manager.protected org.exoplatform.services.listener.ListenerServicelistenerServiceThe listener service.protected static org.exoplatform.services.log.LogLOGThe Constant LOG.static intMAX_RESULT_SIZEThe Constant MAX_RESULT_SIZE.static StringMIX_PRIVILEGEABLEThe Constant MIX_PRIVILEGEABLE.protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreatornodeCreatorThe node creator.static StringNT_FILEThe Constant NT_FILE.static StringNT_RESOURCEThe Constant NT_RESOURCE.static StringOPERATION_CALL_ADDEDThe operation call added.static StringOPERATION_CALL_DELETEDThe operation call deleted.static StringOPERATION_CALL_JOINEDThe operation call joined.static StringOPERATION_CALL_LEAVEDThe operation call leaved.static StringOPERATION_CALL_RECORDEDThe operation call recorded.static StringOPERATION_CALL_STARTEDThe operation call started.static StringOPERATION_CALL_STOPPEDThe operation call stopped.protected org.exoplatform.services.organization.OrganizationServiceorganizationThe organization.protected OriginDAOoriginsStorageThe call origins storage.static StringOWNER_TYPE_CHATROOMThe Constant OWNER_TYPE_CHATROOM.static StringOWNER_TYPE_SPACEThe Constant OWNER_TYPE_SPACE.static StringOWNER_TYPE_SPACEEVENTThe Constant OWNER_TYPE_SPACEEVENT.static StringOWNER_TYPE_USERThe Constant OWNER_TYPE_USER.protected ParticipantDAOparticipantsStorageThe participants storage.protected static StringPROVIDER_SCOPE_NAMEThe Constant PROVIDER_SCOPE_NAME.protected Map<String,CallProvider>providersThe providers.protected org.exoplatform.services.jcr.RepositoryServicerepositoryServiceThe repository service.protected static StringSECRET_KEYThe Constant SECRET_KEY.protected StringsecretKeyThe secret key.static StringSESSION_TOKEN_COOKIEThe Constant SESSION_TOKEN_COOKIE.protected org.exoplatform.services.jcr.ext.app.SessionProviderServicesessionProvidersThe session providers.protected org.exoplatform.commons.api.settings.SettingServicesettingServiceThe settings service.protected org.exoplatform.wcm.ext.component.document.service.ShareDocumentServiceshareServiceThe share service.protected org.exoplatform.social.core.manager.IdentityManagersocialIdentityManagerThe social identity manager.protected org.exoplatform.social.core.space.spi.SpaceServicespaceServiceThe space service.static StringSTATUS_OKThe status ok.static intTEXT_MAX_LENGTHThe Constant TEXT_MAX_LENGTH.protected org.exoplatform.upload.UploadServiceuploadServiceThe upload service.static StringUSERThe Constant USER.protected static StringUSER_CALLS_SCOPE_NAMEThe Constant USER_CALLS_SCOPE_NAME.protected Map<String,Set<UserCallListener>>userListenersThe user listeners.
-
Constructor Summary
Constructors Constructor Description WebConferencingService(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)Instantiates a new web conferencing service.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CallInfoaddCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds)Adds the call to list of active and fires STARTED event.CallInfoaddGuest(String callIId, String guestId)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 voidclearStorage()Deprecated.CallInfocreateCall(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.protected Set<UserInfo>createParticipants(String providerType, Collection<String> partIds)Make call's direct participants from its IDs.protected StringcurrentUserId()Current user id.protected intdeleteAllUserCalls()Delete all user calls.protected voiddeleteCall(String id)Delete call.protected <C extends SQLException>
CexceptionCause(javax.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.List<IdentityData>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.protected Collection<CallInfo>findUserGroupCalls(String userId)Find user group calls in calls storage.protected List<IdentityData>findUsers(String name, int count)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.CallInfogetCall(String id)Gets an active call info.protected StringgetInviteId(String callId)Gets the invite id.CallProvidergetProvider(String type)Gets the provider.CallProviderConfigurationgetProviderConfiguration(String providerType, Locale locale)Gets the provider configuration.Set<CallProviderConfiguration>getProviderConfigurations()Gets the provider configurations.Set<CallProviderConfiguration>getProviderConfigurations(Locale locale)Gets the provider configurations.WebConferencingService.RoomInfogetRoomInfo(String id, String title, String[] members)Gets the room info.StringgetSecretKey()Gets the JWT secret key.WebConferencingService.SpaceEventInfogetSpaceEventInfo(String spaceIdentityId, String[] partIds, String[] spacesPrettyName)Gets the space event info, it will return actual event participants at the moment of invocation.WebConferencingService.SpaceInfogetSpaceInfo(String spacePrettyName)Gets the space info, it will return actual space members at the moment of invocation.protected Set<String>getSpaceMembers(String spacePrettyName)Gets the space members.CallState[]getUserCalls(String userId)Gets the user calls.protected List<UserInfo.IMInfo>getUserIMs(org.exoplatform.social.core.identity.model.Profile profile)Gets the user IM accounts.UserInfogetUserInfo(String id)Gets the user info.voidinitializeStartedCallsState()initialize all saved started calls state.protected voidinvalidateCall(String id, boolean isGroup)Invalidate a call by an ID.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 booleanisValidId(String id)Checks 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).CallInfojoinCall(String callId, String partId, String clientId)Join a call if it is started or start already stopped one.protected CallProviderConfigurationjsonToProviderConfig(org.json.JSONObject json)Json to provider config.CallInfoleaveCall(String callId, String partId, String clientId)If call started, then notify all its parties that given participant leaved.protected StringmetricMessage(String userId, CallInfo call, String operation, String status, Long duration, String error)Metric message for reporting to the stats logger.protected voidnotifyUserCallStateChanged(CallInfo call, String initiatorId, String state)Notify user call state changed.protected org.json.JSONObjectproviderConfigToJson(CallProviderConfiguration conf)Provider 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.RoomInforoomInfo(String id, String title, String[] members, String callId)Room info.voidsaveProviderConfiguration(CallProviderConfiguration conf)Save provider configuration.protected WebConferencingService.SpaceEventInfospaceEventInfo(String spaceIdentityId, String callId, String[] participants, String[] spaces)Space event info.protected WebConferencingService.SpaceInfospaceInfo(String spacePrettyName, String callId)Space info.voidstart()CallInfostartCall(String callId, String clientId)Starts existing call and fires STARTED event.protected voidstartCall(CallInfo call, String partId, String clientId, boolean notifyStarted)Start existing call.voidstop()CallInfostopCall(String callId, boolean remove)Removes the call info from active and fires STOPPED event.protected voidstopCall(CallInfo call, String userId, boolean remove)Stop call.protected voidsyncCallEntity(CallInfo call, CallEntity entity)Update call entity from given CallInfo instance.protected voidsyncMembersAndParticipants(CallInfo call)Sync 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 inttxDeleteAllUserCalls()Delete 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 voidtxSyncMembersAndParticipants(CallInfo call)Sync group members and participants.protected voidtxUpdateCall(CallInfo call)Update existing call (mark it started, stopped etc) in a single transaction.protected voidtxUpdateCallAndOrigins(CallInfo call)Tx update call and its origins.protected voidtxUpdateCallAndParticipants(CallInfo call)Update 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.CallInfoupdateCall(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 voidupdateCallAndParticipants(CallInfo call)Update call and all its participants.CallInfoupdateInvites(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.CallInfoupdateParticipants(String callId, List<String> partIds)Update participants of the call.voiduploadFile(UploadFileInfo uploadInfo, javax.servlet.http.HttpServletRequest request)Upload recording of the call.protected org.exoplatform.services.security.IdentityuserIdentity(String userId)Find or create user identity.protected UserInfouserInfo(String id)
-
-
-
Field Detail
-
ID_MAX_LENGTH
public static final int ID_MAX_LENGTH
The Constant ID_MAX_LENGTH.- See Also:
- Constant Field Values
-
TEXT_MAX_LENGTH
public static final int TEXT_MAX_LENGTH
The Constant TEXT_MAX_LENGTH.- See Also:
- Constant Field Values
-
ARG_MAX_LENGTH
public static final int ARG_MAX_LENGTH
The Constant ARG_MAX_LENGTH.- See Also:
- Constant Field Values
-
DATA_MAX_LENGTH
public static final int DATA_MAX_LENGTH
The Constant DATA_MAX_LENGTH.- See Also:
- Constant Field Values
-
MAX_RESULT_SIZE
public static final int MAX_RESULT_SIZE
The Constant MAX_RESULT_SIZE.- See Also:
- Constant Field Values
-
SESSION_TOKEN_COOKIE
public static final String SESSION_TOKEN_COOKIE
The Constant SESSION_TOKEN_COOKIE.
-
OPERATION_CALL_ADDED
public static final String OPERATION_CALL_ADDED
The operation call added.- See Also:
- Constant Field Values
-
OPERATION_CALL_STARTED
public static final String OPERATION_CALL_STARTED
The operation call started.- See Also:
- Constant Field Values
-
OPERATION_CALL_JOINED
public static final String OPERATION_CALL_JOINED
The operation call joined.- See Also:
- Constant Field Values
-
OPERATION_CALL_LEAVED
public static final String OPERATION_CALL_LEAVED
The operation call leaved.- See Also:
- Constant Field Values
-
OPERATION_CALL_STOPPED
public static final String OPERATION_CALL_STOPPED
The operation call stopped.- See Also:
- Constant Field Values
-
OPERATION_CALL_DELETED
public static final String OPERATION_CALL_DELETED
The operation call deleted.- See Also:
- Constant Field Values
-
OPERATION_CALL_RECORDED
public static final String OPERATION_CALL_RECORDED
The operation call recorded.- See Also:
- Constant Field Values
-
STATUS_OK
public static final String STATUS_OK
The status ok.- See Also:
- Constant Field Values
-
EVENT_CALL_CREATED
public static final String EVENT_CALL_CREATED
- See Also:
- Constant Field Values
-
EVENT_CALL_STARTED
public static final String EVENT_CALL_STARTED
- See Also:
- Constant Field Values
-
EVENT_CALL_JOINDED
public static final String EVENT_CALL_JOINDED
- See Also:
- Constant Field Values
-
EVENT_CALL_LEFT
public static final String EVENT_CALL_LEFT
- See Also:
- Constant Field Values
-
EVENT_CALL_STOPPED
public static final String EVENT_CALL_STOPPED
- See Also:
- Constant Field Values
-
EVENT_CALL_RECORDED
public static final String EVENT_CALL_RECORDED
- See Also:
- Constant Field Values
-
CALL_OWNER_SCOPE_NAME
protected static final String CALL_OWNER_SCOPE_NAME
The Constant CALL_OWNER_SCOPE_NAME.
-
CALL_ID_SCOPE_NAME
protected static final String CALL_ID_SCOPE_NAME
The Constant CALL_ID_SCOPE_NAME.
-
USER_CALLS_SCOPE_NAME
protected static final String USER_CALLS_SCOPE_NAME
The Constant USER_CALLS_SCOPE_NAME.
-
PROVIDER_SCOPE_NAME
protected static final String PROVIDER_SCOPE_NAME
The Constant PROVIDER_SCOPE_NAME.
-
JWT_CONFIGURATION_PROPERTIES
protected static final String JWT_CONFIGURATION_PROPERTIES
The Constant JWT_CONFIGURATION_PROPERTIES.- See Also:
- Constant Field Values
-
SECRET_KEY
protected static final String SECRET_KEY
The Constant SECRET_KEY.- See Also:
- Constant Field Values
-
ALL_USERS
public static final String ALL_USERS
The Constant ALL_USERS.- See Also:
- Constant Field Values
-
GROUP
public static final String GROUP
The Constant GROUP.- See Also:
- Constant Field Values
-
USER
public static final String USER
The Constant USER.- See Also:
- Constant Field Values
-
OWNER_TYPE_USER
public static final String OWNER_TYPE_USER
The Constant OWNER_TYPE_USER.- See Also:
- Constant Field Values
-
OWNER_TYPE_SPACE
public static final String OWNER_TYPE_SPACE
The Constant OWNER_TYPE_SPACE.- See Also:
- Constant Field Values
-
OWNER_TYPE_SPACEEVENT
public static final String OWNER_TYPE_SPACEEVENT
The Constant OWNER_TYPE_SPACEEVENT.- See Also:
- Constant Field Values
-
OWNER_TYPE_CHATROOM
public static final String OWNER_TYPE_CHATROOM
The Constant OWNER_TYPE_CHATROOM.- See Also:
- Constant Field Values
-
CMS_GROUPS_PATH
public static final String CMS_GROUPS_PATH
The Constant CMS_GROUPS_PATH.- See Also:
- Constant Field Values
-
EXO_TITLE_PROP
public static final String EXO_TITLE_PROP
The Constant EXO_TITLE_PROP.- See Also:
- Constant Field Values
-
NT_FILE
public static final String NT_FILE
The Constant NT_FILE.- See Also:
- Constant Field Values
-
JCR_CONTENT
public static final String JCR_CONTENT
The Constant JCR_CONTENT.- See Also:
- Constant Field Values
-
JCR_DATA
public static final String JCR_DATA
The Constant JCR_DATA.- See Also:
- Constant Field Values
-
JCR_MIME_TYPE
public static final String JCR_MIME_TYPE
The Constant JCR_MIME_TYPE.- See Also:
- Constant Field Values
-
JCR_LAST_MODIFIED_PROP
public static final String JCR_LAST_MODIFIED_PROP
The Constant JCR_LAST_MODIFIED_PROP.- See Also:
- Constant Field Values
-
EXO_RSS_ENABLE_PROP
public static final String EXO_RSS_ENABLE_PROP
The Constant EXO_RSS_ENABLE_PROP.- See Also:
- Constant Field Values
-
NT_RESOURCE
public static final String NT_RESOURCE
The Constant NT_RESOURCE.- See Also:
- Constant Field Values
-
MIX_PRIVILEGEABLE
public static final String MIX_PRIVILEGEABLE
The Constant MIX_PRIVILEGEABLE.- See Also:
- Constant Field Values
-
LOG
protected static final org.exoplatform.services.log.Log LOG
The Constant LOG.
-
secretKey
protected final String secretKey
The secret key.
-
organization
protected final org.exoplatform.services.organization.OrganizationService organization
The organization.
-
socialIdentityManager
protected final org.exoplatform.social.core.manager.IdentityManager socialIdentityManager
The social identity manager.
-
listenerService
protected final org.exoplatform.services.listener.ListenerService listenerService
The listener service.
-
settingService
protected final org.exoplatform.commons.api.settings.SettingService settingService
The settings service.
-
callStorage
protected final CallDAO callStorage
The calls storage.
-
participantsStorage
protected final ParticipantDAO participantsStorage
The participants storage.
-
originsStorage
protected final OriginDAO originsStorage
The call origins storage.
-
inviteStorage
protected final InviteDAO inviteStorage
The invite storage.
-
providers
protected final Map<String,CallProvider> providers
The providers.
-
spaceService
protected org.exoplatform.social.core.space.spi.SpaceService spaceService
The space service.
-
shareService
protected org.exoplatform.wcm.ext.component.document.service.ShareDocumentService shareService
The share service.
-
userListeners
protected final Map<String,Set<UserCallListener>> userListeners
The user listeners.
-
uploadService
protected final org.exoplatform.upload.UploadService uploadService
The upload service.
-
repositoryService
protected final org.exoplatform.services.jcr.RepositoryService repositoryService
The repository service.
-
sessionProviders
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
The session providers.
-
nodeCreator
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeCreator
The node creator.
-
identityRegistry
protected final org.exoplatform.services.security.IdentityRegistry identityRegistry
The identity registry.
-
authenticator
protected final org.exoplatform.services.security.Authenticator authenticator
The authenticator.
-
linkManager
protected final org.exoplatform.services.cms.link.LinkManager linkManager
The Link manager.
-
-
Constructor Detail
-
WebConferencingService
public WebConferencingService(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)Instantiates a new web conferencing service.- Parameters:
organization- the organizationsocialIdentityManager- the social identity managerlistenerService- the listener servicesettingService- the setting servicecallStorage- the call storageparticipantsStorage- the participants storageoriginsStorage- the origins storageinviteStorage- the invite storageuploadService- the upload servicerepositoryService- the repository servicesessionProviders- the session providersnodeCreator- the node creatoridentityRegistry- the identity registryauthenticator- the authenticatorshareService- the share serviceinitParams- the initParamslinkManager- the link manager
-
-
Method Detail
-
isValidId
public static boolean isValidId(String id)
Checks is ID valid (not null, not empty and not longer of 255 chars).- Parameters:
id- the id- Returns:
- true, if is valid id
-
isValidText
public static boolean isValidText(String text)
Checks if is valid text (null, not empty and not longer of 255 chars).- Parameters:
text- the text- Returns:
- true, if is valid text
-
isValidArg
public static boolean isValidArg(String arg)
Checks if argument valid (null or not empty and not longer of 32 chars).- Parameters:
arg- the arg- Returns:
- true, if is valid arg
-
isNotNullArg
public static boolean isNotNullArg(String arg)
Checks if argument not null (also not empty and not longer of 32 chars).- Parameters:
arg- the arg- Returns:
- true, if is not null arg
-
isValidData
public static boolean isValidData(String data) throws UnsupportedEncodingException
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
protected UserInfo userInfo(String id) throws IdentityStateException
- Throws:
IdentityStateException
-
getUserInfo
public UserInfo getUserInfo(String id) throws IdentityStateException
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
public String getSecretKey()
Gets the JWT secret key.- Returns:
- the secret key
-
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:
updateParticipants(String, List)
-
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
public CallInfo getCall(String id) throws InvalidCallException
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.- 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
-
stopCall
protected void stopCall(CallInfo call, String userId, boolean remove) throws StorageException
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.- 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
-
getUserCalls
public CallState[] getUserCalls(String userId) throws StorageException
Gets the user calls.- Parameters:
userId- the user id- Returns:
- the user call states
- Throws:
StorageException- if persistence error happen
-
addUserCallListener
public void addUserCallListener(UserCallListener listener)
Adds the user listener.- Parameters:
listener- the listener
-
removeUserCallListener
public void removeUserCallListener(UserCallListener listener)
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
public void addProvider(CallProvider provider)
Adds the provider.- Parameters:
provider- the provider
-
checkInvite
public boolean checkInvite(String callId, String inviteId, String identity) throws Exception
Check invite.- Parameters:
callId- the call idinviteId- the invite ididentity- the identity- Returns:
- true, if successful
- Throws:
Exception- the exception
-
getProvider
public CallProvider getProvider(String type)
Gets the provider.- Parameters:
type- the type- Returns:
- the provider
-
getProviderConfigurations
public Set<CallProviderConfiguration> getProviderConfigurations(Locale locale)
Gets the provider configurations.- Parameters:
locale- the locale to apply to provider description, ifnulla default one will be used- Returns:
- the provider configurations
-
getProviderConfigurations
public Set<CallProviderConfiguration> getProviderConfigurations()
Gets the provider configurations.- Returns:
- the provider configurations
-
getProviderConfiguration
public CallProviderConfiguration getProviderConfiguration(String providerType, Locale locale)
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) 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
public List<IdentityData> findGroupsAndUsers(String name) throws Exception
Find groups and users.- Parameters:
name- the name- Returns:
- the list
- Throws:
Exception- the exception
-
findUsers
protected List<IdentityData> findUsers(String name, int count) throws Exception
Find users.- Parameters:
name- the namecount- the count- Returns:
- the list
- Throws:
Exception- the exception
-
findGroups
protected List<IdentityData> findGroups(String name, int count) throws Exception
Find groups.- Parameters:
name- the namecount- the count- Returns:
- the list
- Throws:
Exception- the exception
-
uploadFile
public void uploadFile(UploadFileInfo uploadInfo, javax.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
protected org.exoplatform.services.security.Identity userIdentity(String userId)
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
-
isSpaceMember
protected boolean isSpaceMember(String userName, String spacePrettyName)
Checks if is space member.- Parameters:
userName- the user namespacePrettyName- the space pretty name- Returns:
- true, if is space member
-
getSpaceMembers
protected Set<String> getSpaceMembers(String spacePrettyName)
Gets the space members.- Parameters:
spacePrettyName- the space pretty name- Returns:
- the space members
-
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
-
getUserIMs
protected List<UserInfo.IMInfo> getUserIMs(org.exoplatform.social.core.identity.model.Profile profile)
Gets the user IM accounts.- Parameters:
profile- the profile- Returns:
- the user I ms
-
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
protected CallProviderConfiguration readProviderConfig(String type)
Read saved call provider configuration.- Parameters:
type- the type- Returns:
- the configuration
-
currentUserId
protected String currentUserId()
Current user id.- Returns:
- the string
-
notifyUserCallStateChanged
protected void notifyUserCallStateChanged(CallInfo call, String initiatorId, String state)
Notify user call state changed.- Parameters:
call- the callinitiatorId- the initiator idstate- the state
-
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
protected String getInviteId(String callId) throws StorageException
Gets the invite id.- Parameters:
callId- the call id- Returns:
- the invite id
- Throws:
StorageException- the storage exception
-
createCallEntity
protected CallEntity createCallEntity(CallInfo call) throws CallSettingsException
Creates the call entity.- Parameters:
call- the call- Returns:
- the call entity
- Throws:
CallSettingsException- if call entry has wrong settings (chat room title)
-
syncCallEntity
protected void syncCallEntity(CallInfo call, CallEntity entity) throws CallSettingsException
Update call entity from given CallInfo instance.- Parameters:
call- the callentity- the entity- Throws:
CallSettingsException- if call entry has wrong settings (room title)
-
createParticipantEntity
protected ParticipantEntity createParticipantEntity(String callId, UserInfo user)
Creates the participant entity.- Parameters:
callId- the call iduser- the user- Returns:
- the participant entity
-
createOriginEntity
protected OriginEntity createOriginEntity(String callId, OriginInfo origin)
Creates the origin entity.- Parameters:
callId- the call idorigin- the origin- Returns:
- the origin entity
-
exceptionCause
protected <C extends SQLException> C exceptionCause(javax.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, javax.persistence.PersistenceException, CallSettingsException
Creates the call in a single transaction.- Parameters:
call- the call- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- if persistence exception happenCallSettingsException- if call entry has wrong settings (chat room title)- See Also:
ExoTransactional
-
txAddParticipant
protected void txAddParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
Tx add participant.- Parameters:
callId- the call idparticipant- the participant- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- the persistence exception
-
txStopCall
protected void txStopCall(CallInfo call, boolean remove) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
Tx stop call.- Parameters:
call- the callremove- the remove- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- the persistence exception
-
txUpdateCall
protected void txUpdateCall(CallInfo call) throws CallNotFoundException, IllegalArgumentException, IllegalStateException, javax.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 exceptionjavax.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, javax.persistence.PersistenceException
Tx update invites.- Parameters:
callId- the ididentities- the identities- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- the persistence exception
-
txUpdateParticipant
protected void txUpdateParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, javax.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 exceptionjavax.persistence.PersistenceException- the persistence exceptionParticipantNotFoundException- if call participant not found in storage
-
txSyncMembersAndParticipants
protected void txSyncMembersAndParticipants(CallInfo call)
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, javax.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 exceptionjavax.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, javax.persistence.PersistenceException, CallNotFoundException, CallSettingsException, ParticipantNotFoundException
Tx update call and its origins.- Parameters:
call- the call- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.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, javax.persistence.PersistenceException
Delete call within a transaction.- Parameters:
id- the call id- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- the persistence exception
-
txUpdateParticipants
protected void txUpdateParticipants(CallInfo call, List<UserInfo> participants) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
Tx update participants.- Parameters:
call- the callparticipants- the participants- Throws:
IllegalArgumentException- the illegal argument exceptionIllegalStateException- the illegal state exceptionjavax.persistence.PersistenceException- the persistence exception
-
txDeleteAllUserCalls
protected int txDeleteAllUserCalls() throws IllegalArgumentException, IllegalStateException, javax.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 exceptionjavax.persistence.PersistenceException- the persistence exception
-
clearStorage
@Deprecated protected void clearStorage()
Deprecated.Clear JPA storage from stale/cached objects.
-
deleteCall
protected void deleteCall(String id) throws StorageException
Delete call.- Parameters:
id- the id- Throws:
StorageException- if storage error happens
-
deleteAllUserCalls
protected int deleteAllUserCalls() throws StorageExceptionDelete 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
protected void syncMembersAndParticipants(CallInfo call) throws StorageException
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
protected String findGroupCallId(String ownerId) throws StorageException
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
protected String findSpaceCallId(String spaceId) throws StorageException
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
protected String findChatRoomCallId(String roomId) throws StorageException
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
protected String findLastSpaceEventCallId(String ownerId) throws StorageException
Find last space event call id.- Parameters:
ownerId- the owner id- Returns:
- the string
- Throws:
StorageException- the storage exception
-
findUserGroupCalls
protected Collection<CallInfo> findUserGroupCalls(String userId) throws StorageException
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)
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
-
-