Class UserInfo

java.lang.Object
org.exoplatform.webconferencing.IdentityInfo
org.exoplatform.webconferencing.UserInfo
Direct Known Subclasses:
GuestInfo, ParticipantInfo

public class UserInfo extends IdentityInfo
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
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      The Constant TYPE_NAME.
    • CLIENT_IDS_MAX_LENGTH

      public static final int CLIENT_IDS_MAX_LENGTH
      The longest list of client ids kept, the size of the participant's client id column.
      See Also:
    • CLIENT_IDS_SEPARATOR

      public static final String CLIENT_IDS_SEPARATOR
      The separator of the client ids in the list.
      See Also:
    • STARTER_CLIENT_PREFIX

      public static final String 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 LOG
      The Constant LOG.
  • Constructor Details

    • UserInfo

      public UserInfo(String userId, String firstName, String lastName)
      Instantiates a new user info.
      Parameters:
      userId - the user id in the system
      firstName - the first type
      lastName - the last type
  • Method Details

    • isGroup

      public boolean isGroup()
      Checks if it is a group.
      Specified by:
      isGroup in class IdentityInfo
      Returns:
      true, if is a group
    • getType

      public String getType()
      Gets the identity type.
      Specified by:
      getType in class IdentityInfo
      Returns:
      the type
    • getFirstName

      public String getFirstName()
      Gets the first name.
      Returns:
      the firstName
    • getLastName

      public String getLastName()
      Gets the last name.
      Returns:
      the lastName
    • getImAccounts

      public Map<String, Collection<UserInfo.IMInfo>> 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

      public UserInfo.IMInfo addImAccount(String type, String id)
      Adds the user IM account.
      Parameters:
      type - the IM type type (e.g. gtalk)
      id - the IM id
      Returns:
      the added IM info
    • addImAccount

      public void addImAccount(UserInfo.IMInfo... ims)
      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

      public boolean hasImAccount(String type)
      Checks for IM account associated with the user.
      Parameters:
      type - the IM account type
      Returns:
      true, if successful
    • getImAccount

      public Collection<UserInfo.IMInfo> getImAccount(String type)
      Gets the IM accounts by type.
      Parameters:
      type - the type
      Returns:
      the IM accounts
    • getState

      public String getState()
      Gets the state.
      Returns:
      the state
    • setState

      public void setState(String state)
      Sets the state.
      Parameters:
      state - the new state
    • getClientId

      public String getClientId()
      Gets the clients of the user in the call, as stored: one id, or several separated by CLIENT_IDS_SEPARATOR. The client the user started the call from carries STARTER_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 null when the user has no client in the call
    • setClientId

      public void setClientId(String clientId)
      Sets the clients of the user in the call, replacing the stored ones.
      Parameters:
      clientId - the client ids, as getClientId() returns them, or null for none
    • setStarterClientId

      public void setStarterClientId(String clientId)
      Sets the client the user started the call from as their only client.
      Parameters:
      clientId - the client id; null, an empty id, or one addClientId(String) ignores, leaves the user with no client
    • addClientId

      public void addClientId(String clientId)
      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 exceed CLIENT_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 when null, empty, already in the list, too long to fit the column once marked as the starter, or holding CLIENT_IDS_SEPARATOR or starting with STARTER_CLIENT_PREFIX
    • removeClientId

      public boolean removeClientId(String clientId)
      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

      public boolean hasSameClientId(String clientId)
      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