public class VideoCallsService extends Object implements org.picocontainer.Startable
| Modifier and Type | Class and Description |
|---|---|
class |
VideoCallsService.RoomInfo
The Class RoomInfo.
|
class |
VideoCallsService.SpaceInfo
The Class SpaceInfo.
|
| Modifier and Type | Field and Description |
|---|---|
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.
|
static String |
CHAT_ROOM_TYPE_NAME
The Constant CHAT_ROOM_TYPE_NAME.
|
protected org.exoplatform.services.cms.drives.ManageDriveService |
driveService
The drive service.
|
protected static String |
GROUP_CALL_TYPE
The Constant GROUP_CALL_TYPE.
|
protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator |
hierarchyCreator
The hierarchy owner.
|
protected org.exoplatform.services.jcr.RepositoryService |
jcrService
The jcr service.
|
protected org.exoplatform.services.listener.ListenerService |
listenerService
The listener service.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
protected org.exoplatform.services.organization.OrganizationService |
organization
The organization.
|
static String |
OWNER_TYPE_CHATROOM
The Constant OWNER_TYPE_CHATROOM.
|
static String |
OWNER_TYPE_SPACE
The Constant OWNER_TYPE_SPACE.
|
protected Map<String,VideoCallsProvider> |
providers
The providers.
|
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.social.core.manager.IdentityManager |
socialIdentityManager
The social identity manager.
|
static String |
SPACE_TYPE_NAME
The Constant SPACE_TYPE_NAME.
|
protected org.exoplatform.social.core.space.spi.SpaceService |
spaceService
The space service.
|
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 |
|---|
VideoCallsService(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.social.core.manager.IdentityManager socialIdentityManager,
org.exoplatform.services.cms.drives.ManageDriveService driveService,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.commons.api.settings.SettingService settingService)
Instantiates a new VideoCalls service.
|
| Modifier and Type | Method and Description |
|---|---|
CallInfo |
addCall(String id,
String ownerId,
String ownerType,
String title,
String providerType,
Collection<String> parts)
Adds the call to list of active and fires STARTED event.
|
void |
addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Adds the plugin.
|
void |
addProvider(VideoCallsProvider provider)
Adds the provider.
|
void |
addUserCallListener(UserCallListener listener)
Adds the user listener.
|
protected org.json.JSONObject |
callToJSON(CallInfo call)
Call to JSON.
|
protected String |
currentUserId()
Current user id.
|
protected void |
deleteCall(CallInfo call)
Delete call.
|
protected CallInfo |
deleteCallById(String id)
Delete call by id.
|
protected void |
deleteOwnerCallId(String ownerId)
Delete owner call id.
|
protected void |
fireUserCallJoined(String callId,
String providerType,
String partId,
String userId)
Fire user call joined a new part.
|
protected void |
fireUserCallLeaved(String callId,
String providerType,
String partId,
String userId)
Fire user call part leaved.
|
protected void |
fireUserCallState(String userId,
String callId,
String providerType,
String callState,
String callerId,
String callerType)
Fire user call state.
|
CallInfo |
getCall(String id)
Gets an active call info.
|
VideoCallsProvider |
getProvider(String type)
Gets the provider.
|
VideoCallsService.RoomInfo |
getRoomInfo(String id,
String name,
String title,
String[] members)
Gets the room info.
|
VideoCallsService.SpaceInfo |
getSpaceInfo(String spacePrettyName)
Gets the space info.
|
protected Set<String> |
getSpaceMembers(String spacePrettyName)
Gets the space members.
|
CallState[] |
getUserCalls(String userId)
Gets the user calls.
|
UserInfo |
getUserInfo(String id)
Gets the user info.
|
protected boolean |
isSpaceMember(String userName,
String spacePrettyName)
Checks if is space member.
|
CallInfo |
joinCall(String id,
String userId)
If call started, then notify all its parties that given participant joined.
|
protected CallInfo |
jsonToCall(org.json.JSONObject json)
Json to call.
|
CallInfo |
leaveCall(String id,
String userId)
If call started, then notify all its parties that given participant leaved.
|
protected void |
notifyUserCallState(CallInfo call,
String initiatorId,
String state)
Notify user call state.
|
protected CallInfo |
readCallById(String id)
Read call by id.
|
protected CallInfo |
readCallByOwnerId(String ownerId)
Read call by owner id.
|
protected String |
readOwnerCallId(String ownerId)
Read owner call id.
|
protected String[] |
readUserGroupCallIds(String userId)
Read user group call ids.
|
void |
removeUserCallListener(UserCallListener listener)
Removes the user listener.
|
protected void |
removeUserGroupCallId(String userId,
String callId)
Removes the user group call id.
|
protected VideoCallsService.RoomInfo |
roomInfo(String id,
String name,
String title,
String[] members,
String callId)
Room info.
|
protected void |
saveCall(CallInfo call)
Save call.
|
protected void |
saveOwnerCallId(String ownerId,
String callId)
Save owner call id.
|
protected void |
saveUserGroupCallId(String userId,
String callId)
Save user group call id.
|
void |
start() |
CallInfo |
startCall(String id)
Removes the call info from active and fires STOPPED event.
|
void |
stop() |
protected CallInfo |
stopCall(CallInfo call,
String userId,
boolean remove) |
CallInfo |
stopCall(String id,
boolean remove)
Removes the call info from active and fires STOPPED event.
|
public static final String SPACE_TYPE_NAME
public static final String CHAT_ROOM_TYPE_NAME
protected static final String GROUP_CALL_TYPE
protected static final String CALL_OWNER_SCOPE_NAME
protected static final String CALL_ID_SCOPE_NAME
protected static final String USER_CALLS_SCOPE_NAME
public static final String OWNER_TYPE_SPACE
public static final String OWNER_TYPE_CHATROOM
protected static final org.exoplatform.services.log.Log LOG
protected final org.exoplatform.services.jcr.RepositoryService jcrService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator
protected final org.exoplatform.services.organization.OrganizationService organization
protected final org.exoplatform.social.core.manager.IdentityManager socialIdentityManager
protected final org.exoplatform.services.cms.drives.ManageDriveService driveService
protected final org.exoplatform.services.listener.ListenerService listenerService
protected final org.exoplatform.commons.api.settings.SettingService settingService
protected final Map<String,VideoCallsProvider> providers
protected org.exoplatform.social.core.space.spi.SpaceService spaceService
protected final Map<String,Set<UserCallListener>> userListeners
public VideoCallsService(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.social.core.manager.IdentityManager socialIdentityManager,
org.exoplatform.services.cms.drives.ManageDriveService driveService,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.commons.api.settings.SettingService settingService)
jcrService - the jcr servicesessionProviders - the session providershierarchyCreator - the hierarchy ownerorganization - the organizationsocialIdentityManager - the social identity managerdriveService - the drive servicelistenerService - the listener servicesettingService - the settings servicepublic UserInfo getUserInfo(String id) throws Exception
id - the idException - the exceptionpublic VideoCallsService.SpaceInfo getSpaceInfo(String spacePrettyName) throws Exception
spacePrettyName - the space pretty nameException - the exceptionpublic VideoCallsService.RoomInfo getRoomInfo(String id, String name, String title, String[] members) throws Exception
id - the idname - the nametitle - the titlemembers - the room membersException - the exceptionpublic CallInfo addCall(String id, String ownerId, String ownerType, String title, String providerType, Collection<String> parts) throws Exception
id - the idownerId - the owner idownerType - the owner typetitle - the titleproviderType - the provider typeparts - the partsException - the exceptionpublic CallInfo getCall(String id) throws Exception
id - the idnull if call not foundException - the exceptionpublic CallInfo stopCall(String id, boolean remove) throws Exception
id - the idremove - the removenull if call not foundException - the exceptionprotected CallInfo stopCall(CallInfo call, String userId, boolean remove) throws Exception
Exceptionpublic CallInfo startCall(String id) throws Exception
id - the idnull if call not foundException - the exceptionpublic CallInfo joinCall(String id, String userId) throws Exception
InvalidCallStateException will be thrown.id - the idnull if call not foundException - the exceptionpublic CallInfo leaveCall(String id, String userId) throws Exception
InvalidCallStateException will be thrown.id - the idnull if call not foundException - the exceptionpublic CallState[] getUserCalls(String userId) throws Exception
userId - the user idException - the exceptionpublic void addUserCallListener(UserCallListener listener)
listener - the listenerpublic void removeUserCallListener(UserCallListener listener)
listener - the listenerprotected void fireUserCallState(String userId, String callId, String providerType, String callState, String callerId, String callerType)
userId - the user idcallId - the call idproviderType - the provider typecallState - the call statecallerId - the caller idcallerType - the caller typeprotected void fireUserCallJoined(String callId, String providerType, String partId, String userId)
callId - the call idproviderType - the provider typepartId - the part iduserId - the user idprotected void fireUserCallLeaved(String callId, String providerType, String partId, String userId)
callId - the call idproviderType - the provider typepartId - the part iduserId - the user idpublic void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
plugin - the pluginpublic void addProvider(VideoCallsProvider provider)
provider - the providerpublic VideoCallsProvider getProvider(String type)
type - the typepublic 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 org.json.JSONObject callToJSON(CallInfo call) throws org.json.JSONException
call - the callorg.json.JSONException - the JSON exceptionprotected CallInfo jsonToCall(org.json.JSONObject json) throws Exception
json - the jsonException - the exceptionprotected void saveCall(CallInfo call) throws Exception
call - the callException - the exceptionprotected CallInfo readCallByOwnerId(String ownerId) throws Exception
ownerId - the owner idException - the exceptionprotected CallInfo readCallById(String id) throws Exception
id - the idException - the exceptionprotected void deleteCall(CallInfo call) throws Exception
call - the callException - the exceptionprotected CallInfo deleteCallById(String id) throws Exception
id - the idException - the exceptionprotected void saveOwnerCallId(String ownerId, String callId)
ownerId - the owner idcallId - the call idprotected String readOwnerCallId(String ownerId)
ownerId - the owner idprotected void deleteOwnerCallId(String ownerId)
ownerId - the owner idprotected String[] readUserGroupCallIds(String userId)
userId - the user idprotected void saveUserGroupCallId(String userId, String callId)
userId - the user idcallId - the call idprotected void removeUserGroupCallId(String userId, String callId)
userId - the user idcallId - the call idprotected VideoCallsService.RoomInfo roomInfo(String id, String name, String title, String[] members, String callId) throws Exception
id - the idname - the nametitle - the titlemembers - the memberscallId - the call idException - the exceptionprotected String currentUserId()
Copyright © 2003–2017 eXo Platform SAS. All rights reserved.