com.sap.ip.collaboration.room.api
Interface IRoomUsers


public interface IRoomUsers

Interface describing a snapshot of the current user-role assignments in a room.

To create a new instance of IRoomUsers (containing no users or roles) you may call IRoomsSystem.createRoomUsersObject()

To obtain a snapshot of all user-role assignments in an existing room call IRoom.getRoomUsers()

You can modify such an instance of IRoomUsers using this API and then put it back into any existing room by calling IRoom.setRoomUsers(IRoomUsers, boolean). This will apply any changes you did on the IRoomUsers object (add new users, change user roles or remove users) to the room.
Note: Adding new users to a room will result in an invitation email to the new users. Removed users will also get a notification email.

Important: All calls to changing methods in this interface will change only the snapshot in memory. No existing room is affected until IRoom.setRoomUsers(IRoomUsers, boolean) is called.


Method Summary
 IUserRoles addUserRole(java.lang.String userId, com.sap.ip.collaboration.room.api.template.IRoomRole role)
          Assign a new role to a user.
 void addUserRoles(IRoomUsers refUsers)
           
 IUserRoles addUserRoles(java.lang.String userId, com.sap.ip.collaboration.room.api.template.IRoomRole[] roles)
          Assign multiple roles to a user.
 boolean containsUser(java.lang.String userId)
          Check if a user is contained
 boolean deleteAllUsers()
          Remove all users from all roles in this snapshot
 boolean deleteUser(java.lang.String userId)
          Remove a specific user from all roles in this snapshot
 boolean deleteUserRoles(java.lang.String userId)
          Same as deleteUser(String): Remove a specific user from all roles in this snapshot
 java.lang.String[] getAllUsers()
          Get the ids of all users
 com.sap.ip.collaboration.room.api.template.IRoomRole[] getUserRoles(java.lang.String userId)
          Get all roles a specific user is assigned to
 IUserRoles getUserRolesObject(java.lang.String userId)
          Get a specific user and all assigned roles to the user
 boolean hasUserRole(java.lang.String userId, com.sap.ip.collaboration.room.api.template.IRoomRole role)
          Check if a user is assigned to a specific role
 boolean removeUserRole(java.lang.String userId, com.sap.ip.collaboration.room.api.template.IRoomRole role)
          Remove a specific role from a user
 

Method Detail

getAllUsers

public java.lang.String[] getAllUsers()
Get the ids of all users
Returns:
Array containing all user ids

containsUser

public boolean containsUser(java.lang.String userId)
Check if a user is contained
Parameters:
userId - the id of the user
Returns:
true if the given user is assigned to one or more roles, false otherwise

getUserRolesObject

public IUserRoles getUserRolesObject(java.lang.String userId)
Get a specific user and all assigned roles to the user
Parameters:
userId - the id of the user
Returns:
IUserRoles object for the given user or null if the user is not assigned to any role

getUserRoles

public com.sap.ip.collaboration.room.api.template.IRoomRole[] getUserRoles(java.lang.String userId)
Get all roles a specific user is assigned to
Parameters:
userId - the id of the user
Returns:
Array containing all roles the given user is assigned to

hasUserRole

public boolean hasUserRole(java.lang.String userId,
                           com.sap.ip.collaboration.room.api.template.IRoomRole role)
Check if a user is assigned to a specific role
Parameters:
userId - the id of the user
role - the role object
Returns:
true if the given user is assigned to the given role, false otherwise

addUserRole

public IUserRoles addUserRole(java.lang.String userId,
                              com.sap.ip.collaboration.room.api.template.IRoomRole role)
Assign a new role to a user. If the user was already assigned to the given role before the call, nothing happens.
Parameters:
userId - the id of the user
role - the role object
Returns:
IUserRoles object for the given user reflecting the change in the role assignments

addUserRoles

public IUserRoles addUserRoles(java.lang.String userId,
                               com.sap.ip.collaboration.room.api.template.IRoomRole[] roles)
Assign multiple roles to a user. If the user was already assigned to one or more of the given roles before the call, only the remaining roles are assigned.
Parameters:
userId - the id of the user
roles - Array containing the new roles for the user
Returns:
IUserRoles object for the given user reflecting the changes in the role assignments

addUserRoles

public void addUserRoles(IRoomUsers refUsers)

deleteAllUsers

public boolean deleteAllUsers()
Remove all users from all roles in this snapshot
Returns:
true if removal was successful, false otherwise

deleteUser

public boolean deleteUser(java.lang.String userId)
Remove a specific user from all roles in this snapshot
Parameters:
userId - the id of the user to be removed
Returns:
true if removal was successful, false otherwise

deleteUserRoles

public boolean deleteUserRoles(java.lang.String userId)
Same as deleteUser(String): Remove a specific user from all roles in this snapshot
Parameters:
userId - the id of the user to be removed
Returns:
true if removal was successful, false otherwise

removeUserRole

public boolean removeUserRole(java.lang.String userId,
                              com.sap.ip.collaboration.room.api.template.IRoomRole role)
Remove a specific role from a user
Parameters:
userId - the id of the user
role - the role to be removed from the user
Returns:
true if removal was successful, false otherwise