public class WebConferencingService extends Object implements org.picocontainer.Startable
| Modifier and Type | Class and Description |
|---|---|
class |
WebConferencingService.RoomInfo
Represent Chat room in calls.
|
class |
WebConferencingService.SpaceEventInfo
Represent Space event call.
|
class |
WebConferencingService.SpaceInfo
Represent Space in calls.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_USERS
The Constant ALL_USERS.
|
static int |
ARG_MAX_LENGTH
The Constant ARG_MAX_LENGTH.
|
protected org.exoplatform.services.security.Authenticator |
authenticator
The authenticator.
|
protected static String |
CALL_ID_SCOPE_NAME
The Constant CALL_ID_SCOPE_NAME.
|
protected static String |
CALL_OWNER_SCOPE_NAME
The Constant CALL_OWNER_SCOPE_NAME.
|
protected CallDAO |
callStorage
The calls storage.
|
static String |
CMS_GROUPS_PATH
The Constant CMS_GROUPS_PATH.
|
static int |
DATA_MAX_LENGTH
The Constant DATA_MAX_LENGTH.
|
static String |
EXO_RSS_ENABLE_PROP
The Constant EXO_RSS_ENABLE_PROP.
|
static String |
EXO_TITLE_PROP
The Constant EXO_TITLE_PROP.
|
static String |
GROUP
The Constant GROUP.
|
static int |
ID_MAX_LENGTH
The Constant ID_MAX_LENGTH.
|
protected org.exoplatform.services.security.IdentityRegistry |
identityRegistry
The identity registry.
|
protected InviteDAO |
inviteStorage
The invite storage.
|
static String |
JCR_CONTENT
The Constant JCR_CONTENT.
|
static String |
JCR_DATA
The Constant JCR_DATA.
|
static String |
JCR_LAST_MODIFIED_PROP
The Constant JCR_LAST_MODIFIED_PROP.
|
static String |
JCR_MIME_TYPE
The Constant JCR_MIME_TYPE.
|
protected static String |
JWT_CONFIGURATION_PROPERTIES
The Constant JWT_CONFIGURATION_PROPERTIES.
|
protected org.exoplatform.services.cms.link.LinkManager |
linkManager
The Link manager.
|
protected org.exoplatform.services.listener.ListenerService |
listenerService
The listener service.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
static int |
MAX_RESULT_SIZE
The Constant MAX_RESULT_SIZE.
|
static String |
MIX_PRIVILEGEABLE
The Constant MIX_PRIVILEGEABLE.
|
protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator |
nodeCreator
The node creator.
|
static String |
NT_FILE
The Constant NT_FILE.
|
static String |
NT_RESOURCE
The Constant NT_RESOURCE.
|
static String |
OPERATION_CALL_ADDED
The operation call added.
|
static String |
OPERATION_CALL_DELETED
The operation call deleted.
|
static String |
OPERATION_CALL_JOINED
The operation call joined.
|
static String |
OPERATION_CALL_LEAVED
The operation call leaved.
|
static String |
OPERATION_CALL_RECORDED
The operation call recorded.
|
static String |
OPERATION_CALL_STARTED
The operation call started.
|
static String |
OPERATION_CALL_STOPPED
The operation call stopped.
|
protected org.exoplatform.services.organization.OrganizationService |
organization
The organization.
|
protected OriginDAO |
originsStorage
The call origins storage.
|
static String |
OWNER_TYPE_CHATROOM
The Constant OWNER_TYPE_CHATROOM.
|
static String |
OWNER_TYPE_SPACE
The Constant OWNER_TYPE_SPACE.
|
static String |
OWNER_TYPE_SPACEEVENT
The Constant OWNER_TYPE_SPACEEVENT.
|
static String |
OWNER_TYPE_USER
The Constant OWNER_TYPE_USER.
|
protected ParticipantDAO |
participantsStorage
The participants storage.
|
protected static String |
PROVIDER_SCOPE_NAME
The Constant PROVIDER_SCOPE_NAME.
|
protected Map<String,CallProvider> |
providers
The providers.
|
protected org.exoplatform.services.jcr.RepositoryService |
repositoryService
The repository service.
|
protected static String |
SECRET_KEY
The Constant SECRET_KEY.
|
protected String |
secretKey
The secret key.
|
static String |
SESSION_TOKEN_COOKIE
The Constant SESSION_TOKEN_COOKIE.
|
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders
The session providers.
|
protected org.exoplatform.commons.api.settings.SettingService |
settingService
The settings service.
|
protected org.exoplatform.wcm.ext.component.document.service.ShareDocumentService |
shareService
The share service.
|
protected org.exoplatform.social.core.manager.IdentityManager |
socialIdentityManager
The social identity manager.
|
protected org.exoplatform.social.core.space.spi.SpaceService |
spaceService
The space service.
|
static String |
STATUS_OK
The status ok.
|
static int |
TEXT_MAX_LENGTH
The Constant TEXT_MAX_LENGTH.
|
protected org.exoplatform.upload.UploadService |
uploadService
The upload service.
|
static String |
USER
The Constant USER.
|
protected static String |
USER_CALLS_SCOPE_NAME
The Constant USER_CALLS_SCOPE_NAME.
|
protected Map<String,Set<UserCallListener>> |
userListeners
The user listeners.
|
| Constructor and 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.
|
| Modifier and Type | Method and Description |
|---|---|
CallInfo |
addCall(String id,
String ownerId,
String ownerType,
String title,
String providerType,
Collection<String> partIds)
Adds the call to list of active and fires STARTED event.
|
CallInfo |
addGuest(String callIId,
String guestId)
Adds the guest to call.
|
void |
addParticipant(String callId,
String partId)
Adds the participant to existing call.
|
void |
addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Adds a provider plugin.
|
void |
addProvider(CallProvider provider)
Adds the provider.
|
void |
addUserCallListener(UserCallListener listener)
Adds the user listener.
|
boolean |
checkInvite(String callId,
String inviteId,
String identity)
Check invite.
|
protected void |
clearStorage()
Deprecated.
|
protected void |
createCall(CallInfo call)
Create the call in storage with all its participants.
|
CallInfo |
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 CallEntity |
createCallEntity(CallInfo call)
Creates the call entity.
|
protected OriginEntity |
createOriginEntity(String callId,
OriginInfo origin)
Creates the origin entity.
|
protected Set<OriginInfo> |
createOrigins(String providerType,
Collection<String> partIds,
Collection<String> spacePrettyNames)
Creates the origins.
|
protected IdentityInfo |
createOwner(String ownerId,
String ownerType,
String title,
boolean isUser,
boolean isSpace,
boolean isSpaceEvent,
boolean isRoom)
Creates call owner.
|
protected ParticipantEntity |
createParticipantEntity(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 String |
currentUserId()
Current user id.
|
protected int |
deleteAllUserCalls()
Delete all user calls.
|
protected void |
deleteCall(String id)
Delete call.
|
protected <C extends SQLException> |
exceptionCause(javax.persistence.PersistenceException pe,
Class<C> causeClass)
Find cause exception of given type.
|
protected CallInfo |
findCallById(String id,
boolean withParticipants)
Find call in storage by its ID.
|
protected String |
findChatRoomCallId(String roomId)
Find a call, owned by a space with given ID, in calls storage.
|
protected String |
findGroupCallId(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 String |
findLastSpaceEventCallId(String ownerId)
Find last space event call id.
|
protected String |
findSpaceCallId(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 void |
fireUserCallJoined(String callId,
String providerType,
String ownerId,
String ownerType,
String partId,
String userId)
Fire user call joined a new part.
|
protected void |
fireUserCallLeaved(String callId,
String providerType,
String ownerId,
String ownerType,
String partId,
String userId)
Fire user call part leaved.
|
protected void |
fireUserCallStateChanged(String userId,
String callId,
String providerType,
String callState,
String ownerId,
String ownerType)
Fire user call state.
|
CallInfo |
getCall(String id)
Gets an active call info.
|
protected String |
getInviteId(String callId)
Gets the invite id.
|
CallProvider |
getProvider(String type)
Gets the provider.
|
CallProviderConfiguration |
getProviderConfiguration(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.RoomInfo |
getRoomInfo(String id,
String title,
String[] members)
Gets the room info.
|
String |
getSecretKey()
Gets the JWT secret key.
|
WebConferencingService.SpaceEventInfo |
getSpaceEventInfo(String spacePrettyName,
String[] partIds,
String[] spacesPrettyName)
Gets the space event info, it will return actual event participants at the
moment of invocation.
|
WebConferencingService.SpaceInfo |
getSpaceInfo(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.
|
UserInfo |
getUserInfo(String id)
Gets the user info.
|
protected void |
invalidateCall(String id,
boolean isGroup)
Invalidate a call by an ID.
|
static boolean |
isNotNullArg(String arg)
Checks if argument not null (also not empty and not longer of 32 chars).
|
protected boolean |
isSpaceMember(String userName,
String spacePrettyName)
Checks if is space member.
|
static boolean |
isValidArg(String arg)
Checks if argument valid (null or not empty and not longer of 32 chars).
|
static boolean |
isValidData(String data)
Checks if data valid (null or not empty and not longer of 2000 bytes in UTF8
encoding).
|
static boolean |
isValidId(String id)
Checks is ID valid (not null, not empty and not longer of 255 chars).
|
static boolean |
isValidText(String text)
Checks if is valid text (null, not empty and not longer of 255 chars).
|
CallInfo |
joinCall(String callId,
String partId,
String clientId)
Join a call if it is started or start already stopped one.
|
protected CallProviderConfiguration |
jsonToProviderConfig(org.json.JSONObject json)
Json to provider config.
|
CallInfo |
leaveCall(String callId,
String partId,
String clientId)
If call started, then notify all its parties that given participant leaved.
|
protected String |
metricMessage(String userId,
CallInfo call,
String operation,
String status,
Long duration,
String error)
Metric message for reporting to the stats logger.
|
protected void |
notifyUserCallStateChanged(CallInfo call,
String initiatorId,
String state)
Notify user call state changed.
|
protected org.json.JSONObject |
providerConfigToJson(CallProviderConfiguration conf)
Provider config to json.
|
protected CallInfo |
readCallEntity(CallEntity savedCall,
boolean withParticipants)
Read call entity.
|
protected CallProviderConfiguration |
readProviderConfig(String type)
Read saved call provider configuration.
|
protected void |
removeParticipant(String callId,
UserInfo participant)
Remove call participant (for leaved state) in a single transaction.
|
void |
removeUserCallListener(UserCallListener listener)
Removes the user listener.
|
protected WebConferencingService.RoomInfo |
roomInfo(String id,
String title,
String[] members,
String callId)
Room info.
|
void |
saveProviderConfiguration(CallProviderConfiguration conf)
Save provider configuration.
|
protected WebConferencingService.SpaceEventInfo |
spaceEventInfo(String spacePrettyName,
String callId,
String[] participants,
String[] spaces)
Space event info.
|
protected WebConferencingService.SpaceInfo |
spaceInfo(String spacePrettyName,
String callId)
Space info.
|
void |
start() |
protected void |
startCall(CallInfo call,
String partId,
String clientId,
boolean notifyStarted)
Start existing call.
|
CallInfo |
startCall(String callId,
String clientId)
Starts existing call and fires STARTED event.
|
void |
stop() |
protected void |
stopCall(CallInfo call,
String userId,
boolean remove)
Stop call.
|
CallInfo |
stopCall(String callId,
boolean remove)
Removes the call info from active and fires STOPPED event.
|
protected void |
syncCallEntity(CallInfo call,
CallEntity entity)
Update call entity from given CallInfo instance.
|
protected void |
syncMembersAndParticipants(CallInfo call)
Sync group members and participants.
|
protected void |
txAddParticipant(String callId,
UserInfo participant)
Tx add participant.
|
protected void |
txCreateCall(CallInfo call)
Creates the call in a single transaction.
|
protected int |
txDeleteAllUserCalls()
Delete all user calls (not group ones) within a single transaction.
|
protected void |
txDeleteCall(String id)
Delete call within a transaction.
|
protected void |
txRemoveParticipant(String callId,
String partId)
Remove call participant.
|
protected void |
txStopCall(CallInfo call,
boolean remove)
Tx stop call.
|
protected void |
txSyncMembersAndParticipants(CallInfo call)
Sync group members and participants.
|
protected void |
txUpdateCall(CallInfo call)
Update existing call (mark it started, stopped etc) in a single transaction.
|
protected void |
txUpdateCallAndOrigins(CallInfo call)
Tx update call and its origins.
|
protected void |
txUpdateCallAndParticipants(CallInfo call)
Update call and all its participants in a single transaction.
|
protected void |
txUpdateInvites(String callId,
List<InvitedIdentity> identities)
Tx update invites.
|
protected void |
txUpdateParticipant(String callId,
UserInfo participant)
Update call participant (for joined or leaved state) in a single transaction.
|
protected void |
txUpdateParticipants(CallInfo call,
List<UserInfo> participants)
Tx update participants.
|
protected void |
updateCall(CallInfo call)
Update existing call (mark it started, stopped etc).
|
CallInfo |
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 void |
updateCallAndOrigins(CallInfo call)
Update call and its origins.
|
protected void |
updateCallAndParticipants(CallInfo call)
Update call and all its participants.
|
CallInfo |
updateInvites(String callId,
List<InvitedIdentity> identities)
Update invites.
|
protected void |
updateParticipant(String callId,
UserInfo participant)
Update call participant (for joined or leaved state) in a single transaction.
|
CallInfo |
updateParticipants(String callId,
List<String> partIds)
Update participants of the call.
|
void |
uploadFile(UploadFileInfo uploadInfo,
javax.servlet.http.HttpServletRequest request)
Upload recording of the call.
|
protected org.exoplatform.services.security.Identity |
userIdentity(String userId)
Find or create user identity.
|
protected UserInfo |
userInfo(String id) |
public static final int ID_MAX_LENGTH
public static final int TEXT_MAX_LENGTH
public static final int ARG_MAX_LENGTH
public static final int DATA_MAX_LENGTH
public static final int MAX_RESULT_SIZE
public static final String SESSION_TOKEN_COOKIE
public static final String OPERATION_CALL_ADDED
public static final String OPERATION_CALL_STARTED
public static final String OPERATION_CALL_JOINED
public static final String OPERATION_CALL_LEAVED
public static final String OPERATION_CALL_STOPPED
public static final String OPERATION_CALL_DELETED
public static final String OPERATION_CALL_RECORDED
public static final String STATUS_OK
protected static final String CALL_OWNER_SCOPE_NAME
protected static final String CALL_ID_SCOPE_NAME
protected static final String USER_CALLS_SCOPE_NAME
protected static final String PROVIDER_SCOPE_NAME
protected static final String JWT_CONFIGURATION_PROPERTIES
protected static final String SECRET_KEY
public static final String ALL_USERS
public static final String GROUP
public static final String USER
public static final String OWNER_TYPE_USER
public static final String OWNER_TYPE_SPACE
public static final String OWNER_TYPE_SPACEEVENT
public static final String OWNER_TYPE_CHATROOM
public static final String CMS_GROUPS_PATH
public static final String EXO_TITLE_PROP
public static final String NT_FILE
public static final String JCR_CONTENT
public static final String JCR_DATA
public static final String JCR_MIME_TYPE
public static final String JCR_LAST_MODIFIED_PROP
public static final String EXO_RSS_ENABLE_PROP
public static final String NT_RESOURCE
public static final String MIX_PRIVILEGEABLE
protected static final org.exoplatform.services.log.Log LOG
protected final String secretKey
protected final org.exoplatform.services.organization.OrganizationService organization
protected final org.exoplatform.social.core.manager.IdentityManager socialIdentityManager
protected final org.exoplatform.services.listener.ListenerService listenerService
protected final org.exoplatform.commons.api.settings.SettingService settingService
protected final CallDAO callStorage
protected final ParticipantDAO participantsStorage
protected final OriginDAO originsStorage
protected final InviteDAO inviteStorage
protected final Map<String,CallProvider> providers
protected org.exoplatform.social.core.space.spi.SpaceService spaceService
protected org.exoplatform.wcm.ext.component.document.service.ShareDocumentService shareService
protected final Map<String,Set<UserCallListener>> userListeners
protected final org.exoplatform.upload.UploadService uploadService
protected final org.exoplatform.services.jcr.RepositoryService repositoryService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeCreator
protected final org.exoplatform.services.security.IdentityRegistry identityRegistry
protected final org.exoplatform.services.security.Authenticator authenticator
protected final org.exoplatform.services.cms.link.LinkManager linkManager
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)
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 managerpublic static boolean isValidId(String id)
id - the idpublic static boolean isValidText(String text)
text - the textpublic static boolean isValidArg(String arg)
arg - the argpublic static boolean isNotNullArg(String arg)
arg - the argpublic static boolean isValidData(String data) throws UnsupportedEncodingException
data - the dataUnsupportedEncodingException - if UTF8 encoding not found in runtimeprotected UserInfo userInfo(String id) throws IdentityStateException
IdentityStateExceptionpublic UserInfo getUserInfo(String id) throws IdentityStateException
id - the idIdentityStateException - if error happened during searching the user in Organization Servicepublic WebConferencingService.SpaceInfo getSpaceInfo(String spacePrettyName) throws IdentityStateException, StorageException
spacePrettyName - the space pretty nameIdentityStateException - if error reading space member in Organization ServiceStorageException - if error reading saved group call ID associated with a spacepublic WebConferencingService.SpaceEventInfo getSpaceEventInfo(String spacePrettyName, String[] partIds, String[] spacesPrettyName) throws IdentityStateException, StorageException
spacePrettyName - the space pretty namepartIds - the participants IDs (attendees) added to the event directlyspacesPrettyName - the Social spaces' pretty names for add its members as
participants (attendees) to the eventIdentityStateException - the identity state exceptionStorageException - the storage exceptionpublic String getSecretKey()
protected WebConferencingService.SpaceInfo spaceInfo(String spacePrettyName, String callId) throws IdentityStateException
spacePrettyName - the space pretty namecallId - the call idIdentityStateException - if error reading space member in Organization Serviceprotected WebConferencingService.SpaceEventInfo spaceEventInfo(String spacePrettyName, String callId, String[] participants, String[] spaces) throws IdentityStateException
spacePrettyName - the space pretty namecallId - the call idparticipants - the participants user namesspaces - an array of space pretty namesIdentityStateException - the identity state exceptionpublic WebConferencingService.RoomInfo getRoomInfo(String id, String title, String[] members) throws IdentityStateException, StorageException
id - the idtitle - the titlemembers - the room membersIdentityStateException - if error reading room member in Organization ServiceStorageException - if error reading saved group call ID associated with a roomprotected WebConferencingService.RoomInfo roomInfo(String id, String title, String[] members, String callId) throws IdentityStateException
id - the idtitle - the titlemembers - the memberscallId - the call idIdentityStateException - if user cannot be readpublic CallInfo addCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> partIds) throws CallArgumentException, StorageException, IdentityStateException, CallConflictException, CallSettingsException
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 IDsCallInfoCallArgumentException - 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)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
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, if true then the call will be started (listeners will be notified)CallInfoCallArgumentException - 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)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
updateParticipants(String, List) method for such work.callId - the call idownerId - the owner idnewOwnerType - the owner typenewTitle - the titlenewProviderType - the provider typepartIds - the participantsspaces - the spacesstartDate - the start dateendDate - the end dateInvalidCallException - the invalid call exceptionCallArgumentException - the call argument exceptionCallSettingsException - the call settings exceptionStorageException - the storage exceptionCallNotFoundException - the call not found exceptionIdentityStateException - the identity state exceptionParticipantNotFoundExceptionupdateParticipants(String, List)protected Set<UserInfo> createParticipants(String providerType, Collection<String> partIds) throws IdentityStateException, CallArgumentException
providerType - the provider typepartIds - the participants IDsIdentityStateException - the identity state exceptionCallArgumentException - the call argument exceptionprotected Set<OriginInfo> createOrigins(String providerType, Collection<String> partIds, Collection<String> spacePrettyNames) throws IdentityStateException, CallArgumentException
providerType - the provider typepartIds - the part idsspacePrettyNames - the spaces namesIdentityStateException - the identity state exceptionCallArgumentException - the call argument exceptionprotected IdentityInfo createOwner(String ownerId, String ownerType, String title, boolean isUser, boolean isSpace, boolean isSpaceEvent, boolean isRoom) throws CallArgumentException, IdentityStateException
ownerId - the owner idownerType - the owner typetitle - the titleisUser - the is userisSpace - the is spaceisSpaceEvent - the is space eventisRoom - the is roomCallArgumentException - the call argument exceptionIdentityStateException - the identity state exceptionpublic CallInfo getCall(String id) throws InvalidCallException
id - the idnull if call not foundInvalidCallException - if call in erroneous state, see cause exception for detailspublic CallInfo stopCall(String callId, boolean remove) throws CallNotFoundException, InvalidCallException
callId - the call idremove - the removeCallInfoCallNotFoundException - if call not foundInvalidCallException - if call in erroneous state and cannot be used, details are in caused
exceptionprotected void stopCall(CallInfo call, String userId, boolean remove) throws StorageException
call - the calluserId - the user idremove - the removeStorageException - if persistence exception happenpublic CallInfo startCall(String callId, String clientId) throws CallNotFoundException, InvalidCallException
callId - the call idclientId - the client idCallInfoCallNotFoundException - if call not foundInvalidCallException - if call in erroneous state and cannot be used, details are in caused
exceptionprotected void startCall(CallInfo call, String partId, String clientId, boolean notifyStarted) throws ParticipantNotFoundException, CallSettingsException, StorageException, CallNotFoundException
call - the callpartId - the participant id who started the callclientId - the client idnotifyStarted - if true then all participants will be notified about the started callParticipantNotFoundException - 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 storagepublic CallInfo updateParticipants(String callId, List<String> partIds) throws CallNotFoundException, InvalidCallException, StorageException
callId - the call idpartIds - the participants idsCallNotFoundException - the call not found exceptionInvalidCallException - the invalid call exceptionStorageException - the storage exceptionpublic void addParticipant(String callId, String partId) throws StorageException, CallNotFoundException, InvalidCallException, IdentityStateException, CallArgumentException
callId - the call idpartId - the part idStorageException - the storage exceptionCallNotFoundException - the call not found exceptionInvalidCallException - the invalid call exceptionIdentityStateException - the identity state exceptionCallArgumentException - if participant cannot be foundpublic CallInfo addGuest(String callIId, String guestId) throws StorageException, CallNotFoundException, InvalidCallException, IdentityStateException
callIId - the call idguestId - the guest idStorageException - the storage exceptionCallNotFoundException - the call not found exceptionInvalidCallException - the invalid call exceptionIdentityStateException - the identity state exceptionpublic CallInfo updateInvites(String callId, List<InvitedIdentity> identities) throws CallNotFoundException, InvalidCallException, StorageException
callId - the call ididentities - the invitesCallNotFoundException - the call not found exceptionInvalidCallException - the invalid call exceptionStorageException - the storage exceptionpublic CallInfo joinCall(String callId, String partId, String clientId) throws InvalidCallException, CallNotFoundException, IdentityStateException, CallArgumentException
callId - the call idpartId - the participant idclientId - the client idCallInfoInvalidCallException - 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 foundpublic CallInfo leaveCall(String callId, String partId, String clientId) throws InvalidCallException
null will be returned.callId - the call idpartId - the participant idclientId - the client idnull if call not foundInvalidCallException - if call in erroneous state and cannot be used, details are in caused
exceptionpublic CallState[] getUserCalls(String userId) throws StorageException
userId - the user idStorageException - if persistence error happenpublic void addUserCallListener(UserCallListener listener)
listener - the listenerpublic void removeUserCallListener(UserCallListener listener)
listener - the listenerprotected void fireUserCallStateChanged(String userId, String callId, String providerType, String callState, String ownerId, String ownerType)
userId - the user idcallId - the call idproviderType - the provider typecallState - the call stateownerId - the caller idownerType - the caller typeprotected void fireUserCallJoined(String callId, String providerType, String ownerId, String ownerType, String partId, String userId)
callId - the call idproviderType - the provider typeownerId - the owner idownerType - the owner typepartId - the part iduserId - the user idprotected void fireUserCallLeaved(String callId, String providerType, String ownerId, String ownerType, String partId, String userId)
callId - the call idproviderType - the provider typeownerId - the owner idownerType - the owner typepartId - the part iduserId - the user idpublic void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
CallProvider then it will log a warning and let server continue the start.plugin - the pluginpublic void addProvider(CallProvider provider)
provider - the providerpublic boolean checkInvite(String callId, String inviteId, String identity) throws Exception
callId - the call idinviteId - the invite ididentity - the identityException - the exceptionpublic CallProvider getProvider(String type)
type - the typepublic Set<CallProviderConfiguration> getProviderConfigurations(Locale locale)
locale - the locale to apply to provider description, if null a default one will be
usedpublic Set<CallProviderConfiguration> getProviderConfigurations()
public CallProviderConfiguration getProviderConfiguration(String providerType, Locale locale)
providerType - the provider typelocale - the locale to apply to provider description, if null a default one will be
usednull if provider not foundpublic void saveProviderConfiguration(CallProviderConfiguration conf) throws UnsupportedEncodingException, org.json.JSONException
conf - the configuration to saveUnsupportedEncodingException - if UTF8 not supportedorg.json.JSONException - if cannot serialize to JSONpublic List<IdentityData> findGroupsAndUsers(String name) throws Exception
name - the nameException - the exceptionprotected List<IdentityData> findUsers(String name, int count) throws Exception
name - the namecount - the countException - the exceptionprotected List<IdentityData> findGroups(String name, int count) throws Exception
name - the namecount - the countException - the exceptionpublic void uploadFile(UploadFileInfo uploadInfo, javax.servlet.http.HttpServletRequest request) throws UploadFileException, javax.jcr.RepositoryException
uploadInfo - the upload inforequest - the requestUploadFileException - the upload recording exceptionjavax.jcr.RepositoryException - the repository exceptionprotected org.exoplatform.services.security.Identity userIdentity(String userId)
userId - the user idpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startableprotected boolean isSpaceMember(String userName, String spacePrettyName)
userName - the user namespacePrettyName - the space pretty nameprotected Set<String> getSpaceMembers(String spacePrettyName)
spacePrettyName - the space pretty nameprotected CallProviderConfiguration jsonToProviderConfig(org.json.JSONObject json) throws org.json.JSONException
json - the jsonorg.json.JSONException - the JSON exceptionprotected List<UserInfo.IMInfo> getUserIMs(org.exoplatform.social.core.identity.model.Profile profile)
profile - the profileprotected org.json.JSONObject providerConfigToJson(CallProviderConfiguration conf) throws org.json.JSONException
conf - the conforg.json.JSONException - the JSON exceptionprotected CallProviderConfiguration readProviderConfig(String type)
type - the typeprotected String currentUserId()
protected void notifyUserCallStateChanged(CallInfo call, String initiatorId, String state)
call - the callinitiatorId - the initiator idstate - the stateprotected CallInfo readCallEntity(CallEntity savedCall, boolean withParticipants) throws CallSettingsException, IdentityStateException, CallOwnerException
savedCall - the saved callwithParticipants - the with participantsCallSettingsException - 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)protected String getInviteId(String callId) throws StorageException
callId - the call idStorageException - the storage exceptionprotected CallEntity createCallEntity(CallInfo call) throws CallSettingsException
call - the callCallSettingsException - if call entry has wrong settings (chat room title)protected void syncCallEntity(CallInfo call, CallEntity entity) throws CallSettingsException
call - the callentity - the entityCallSettingsException - if call entry has wrong settings (room title)protected ParticipantEntity createParticipantEntity(String callId, UserInfo user)
callId - the call iduser - the userprotected OriginEntity createOriginEntity(String callId, OriginInfo origin)
callId - the call idorigin - the originprotected <C extends SQLException> C exceptionCause(javax.persistence.PersistenceException pe, Class<C> causeClass)
C - the generic typepe - the pecauseClass - the cause classprotected void txCreateCall(CallInfo call) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, CallSettingsException
call - the callIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - if persistence exception happenCallSettingsException - if call entry has wrong settings (chat room title)ExoTransactionalprotected void txAddParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
callId - the call idparticipant - the participantIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionprotected void txStopCall(CallInfo call, boolean remove) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
call - the callremove - the removeIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionprotected void txUpdateCall(CallInfo call) throws CallNotFoundException, IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, CallSettingsException
call - the callCallNotFoundException - 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)protected void txUpdateInvites(String callId, List<InvitedIdentity> identities) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
callId - the ididentities - the identitiesIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionprotected void txUpdateParticipant(String callId, UserInfo participant) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, ParticipantNotFoundException
callId - the call idparticipant - the participantIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionParticipantNotFoundException - if call participant not found in storageprotected void txSyncMembersAndParticipants(CallInfo call)
call - the callprotected void txRemoveParticipant(String callId, String partId) throws ParticipantNotFoundException
callId - the call idpartId - the participant idParticipantNotFoundException - if participant not foundprotected void txUpdateCallAndParticipants(CallInfo call) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, CallNotFoundException, CallSettingsException, ParticipantNotFoundException
call - the callIllegalArgumentException - 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 storageprotected void txUpdateCallAndOrigins(CallInfo call) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, CallNotFoundException, CallSettingsException, ParticipantNotFoundException
call - the callIllegalArgumentException - 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 exceptionprotected void txDeleteCall(String id) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
id - the call idIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionprotected void txUpdateParticipants(CallInfo call, List<UserInfo> participants) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
call - the callparticipants - the participantsIllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exceptionprotected int txDeleteAllUserCalls()
throws IllegalArgumentException,
IllegalStateException,
javax.persistence.PersistenceException
IllegalArgumentException - the illegal argument exceptionIllegalStateException - the illegal state exceptionjavax.persistence.PersistenceException - the persistence exception@Deprecated protected void clearStorage()
protected void deleteCall(String id) throws StorageException
id - the idStorageException - if storage error happensprotected int deleteAllUserCalls()
throws StorageException
StorageException - if storage error happensprotected void updateCallAndParticipants(CallInfo call) throws StorageException, ParticipantNotFoundException, CallSettingsException, CallNotFoundException
call - the callStorageException - 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 storageprotected void updateCallAndOrigins(CallInfo call) throws StorageException, ParticipantNotFoundException, CallSettingsException, CallNotFoundException
call - the callStorageException - the storage exceptionParticipantNotFoundException - the participant not found exceptionCallSettingsException - the call settings exceptionCallNotFoundException - the call not found exceptionprotected void syncMembersAndParticipants(CallInfo call) throws StorageException
call - the callStorageException - the storage exceptionprotected void updateParticipant(String callId, UserInfo participant) throws ParticipantNotFoundException, StorageException
callId - the call idparticipant - the participantParticipantNotFoundException - if call participant not found in storageStorageException - if storage exception happenprotected void removeParticipant(String callId, UserInfo participant) throws ParticipantNotFoundException, StorageException
callId - the call idparticipant - the participantParticipantNotFoundException - if call participant not found in storageStorageException - if storage exception happenprotected void updateCall(CallInfo call) throws CallNotFoundException, CallSettingsException, StorageException
call - the callCallNotFoundException - if call not found in storageCallSettingsException - if call entry has wrong settings (room call title)StorageException - if storage exception happenprotected CallInfo findCallById(String id, boolean withParticipants) throws IdentityStateException, StorageException, CallSettingsException, CallOwnerException
id - the idwithParticipants - also read participants from the DBIdentityStateException - 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 typeprotected String findGroupCallId(String ownerId) throws StorageException
ownerId - the owner idnull if no call foundStorageException - the storage exceptionprotected String findSpaceCallId(String spaceId) throws StorageException
spaceId - the owner idnull if no call foundStorageException - the storage exceptionprotected String findChatRoomCallId(String roomId) throws StorageException
roomId - the room idnull if no call foundStorageException - the storage exceptionprotected String findLastSpaceEventCallId(String ownerId) throws StorageException
ownerId - the owner idStorageException - the storage exceptionprotected Collection<CallInfo> findUserGroupCalls(String userId) throws StorageException
userId - the user idStorageException - if persistence error happenprotected void createCall(CallInfo call) throws StorageException, CallConflictException, CallSettingsException
CallConflictException will be raised.call - the call infoStorageException - if storage exception happenCallConflictException - the call conflicts with another (same ID) callCallSettingsException - the call settings wrong (chat room title)protected void invalidateCall(String id, boolean isGroup) throws CallConflictException, StorageException
CallConflictException will be thrown. This method designed to be
called just before createCall(CallInfo).id - the idisGroup - the is groupCallConflictException - if call conflict found and existing call cannot be removedStorageException - if storage exception happenprotected String metricMessage(String userId, CallInfo call, String operation, String status, Long duration, String error)
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 be null), it's not a call durationerror - the error if present (can be null)Copyright © 2003–2021 eXo Platform SAS. All rights reserved.