Class UserInfo
java.lang.Object
org.exoplatform.webconferencing.IdentityInfo
org.exoplatform.webconferencing.UserInfo
- Direct Known Subclasses:
GuestInfo, ParticipantInfo
Represent eXo user as a conversation participant for calls.
Created by The eXo Platform SAS.
- Version:
- $Id: UserInfo.java 00000 Feb 23, 2017 pnedonosko $
- Author:
- Peter Nedonosko
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest list of client ids kept, the size of the participant's client id column.static final StringThe separator of the client ids in the list.protected static final org.exoplatform.services.log.LogThe Constant LOG.static final StringThe mark of the client the user started the call from, in the list of clients.static final StringThe Constant TYPE_NAME.Fields inherited from class IdentityInfo
avatarLink, EMPTY, id, profileLink, title -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientId(String clientId) Adds a client the user is in the call from.addImAccount(String type, String id) Adds the user IM account.voidaddImAccount(UserInfo.IMInfo... ims) Adds the user IM account(s).Gets the clients of the user in the call, as stored: one id, or several separated byCLIENT_IDS_SEPARATOR.Gets the first name.getImAccount(String type) Gets the IM accounts by type.Gets the im accounts.Gets the last name.getState()Gets the state.getType()Gets the identity type.booleanhasImAccount(String type) Checks for IM account associated with the user.booleanTells if the user is in the call from at least one client, the one they started it from not counted.booleanhasSameClientId(String clientId) Checks if the given client is one of the user's clients in the call, the one they started it from included.booleanisGroup()Checks if it is a group.booleanremoveClientId(String clientId) Removes a client of the user, the one they started the call from included.voidsetClientId(String clientId) Sets the clients of the user in the call, replacing the stored ones.voidsetStarterClientId(String clientId) Sets the client the user started the call from as their only client.voidSets the state.Methods inherited from class IdentityInfo
equals, getAvatarLink, getId, getProfileLink, getTitle, hashCode, setAvatarLink, setProfileLink
-
Field Details
-
TYPE_NAME
The Constant TYPE_NAME. -
CLIENT_IDS_MAX_LENGTH
public static final int CLIENT_IDS_MAX_LENGTHThe longest list of client ids kept, the size of the participant's client id column.- See Also:
-
CLIENT_IDS_SEPARATOR
The separator of the client ids in the list.- See Also:
-
STARTER_CLIENT_PREFIX
The mark of the client the user started the call from, in the list of clients.- See Also:
-
LOG
protected static final org.exoplatform.services.log.Log LOGThe Constant LOG.
-
-
Constructor Details
-
UserInfo
-
-
Method Details
-
isGroup
public boolean isGroup()Checks if it is a group.- Specified by:
isGroupin classIdentityInfo- Returns:
- true, if is a group
-
getType
Gets the identity type.- Specified by:
getTypein classIdentityInfo- Returns:
- the type
-
getFirstName
-
getLastName
-
getImAccounts
Gets the im accounts.- Returns:
- the map of user instant messaging accounts: key is a type, value is a collection of
UserInfo.IMInfo
-
addImAccount
Adds the user IM account.- Parameters:
type- the IM type type (e.g.gtalk)id- the IM id- Returns:
- the added IM info
-
addImAccount
Adds the user IM account(s). Note that if IM with some type already added an another one will be skipped.- Parameters:
ims- the IM account(s) to add to the user profile
-
hasImAccount
Checks for IM account associated with the user.- Parameters:
type- the IM account type- Returns:
true, if successful
-
getImAccount
Gets the IM accounts by type.- Parameters:
type- the type- Returns:
- the IM accounts
-
getState
-
setState
-
getClientId
Gets the clients of the user in the call, as stored: one id, or several separated byCLIENT_IDS_SEPARATOR. The client the user started the call from carriesSTARTER_CLIENT_PREFIX: it is the page that started the call, which the user is not in the call from until it joins it.- Returns:
- the client ids, or
nullwhen the user has no client in the call
-
setClientId
Sets the clients of the user in the call, replacing the stored ones.- Parameters:
clientId- the client ids, asgetClientId()returns them, ornullfor none
-
setStarterClientId
Sets the client the user started the call from as their only client.- Parameters:
clientId- the client id;null, an empty id, or oneaddClientId(String)ignores, leaves the user with no client
-
addClientId
Adds a client the user is in the call from. The client the user started the call from becomes one they are in the call from when it joins it. When the list would exceedCLIENT_IDS_MAX_LENGTH, its oldest clients are dropped: a client whose leave never came, after a crash or a network loss, goes first.- Parameters:
clientId- the client id, ignored whennull, empty, already in the list, too long to fit the column once marked as the starter, or holdingCLIENT_IDS_SEPARATORor starting withSTARTER_CLIENT_PREFIX
-
removeClientId
Removes a client of the user, the one they started the call from included.- Parameters:
clientId- the client id- Returns:
- true, if the client was in the list
-
hasJoinedClientIds
public boolean hasJoinedClientIds()Tells if the user is in the call from at least one client, the one they started it from not counted.- Returns:
- true, if a client joined the call
-
hasSameClientId
Checks if the given client is one of the user's clients in the call, the one they started it from included.- Parameters:
clientId- the client id- Returns:
- true, if the client is in the list
-