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
 boolean addGroupUsersToRole(IGroup group, IRoomRole role, boolean childMembers)
          Assign all users who are member of a given group to a specific room role.
 boolean addGroupUsersToRoles(IGroup group, IRoomRole[] roles, boolean childMembers)
          Assign all users who are member of a given group to a a set of room roles.
 IUserRoles addUserRole(String userId, IRoomRole role)
          Assign a new role to a user.
 boolean addUserRoles(IRoomUsers refUsers)
          Copy all user-role assignments from another IRoomUsers object to this object.
 IUserRoles addUserRoles(String userId, IRoomRole[] roles)
          Assign multiple roles to a user.
 boolean containsUser(String userId)
          Check if a user is contained
 boolean deleteAllUsers()
          Remove all users from all roles in this snapshot
 boolean deleteUser(String userId)
          Remove a specific user from all roles in this snapshot
 boolean deleteUserRoles(String userId)
          Same as deleteUser(String): Remove a specific user from all roles in this snapshot
 String[] getAllUsers()
          Get the ids of all users
 IRoomRole[] getUserRoles(String userId)
          Get all roles a specific user is assigned to
 IUserRoles getUserRolesObject(String userId)
          Get a specific user and all assigned roles to the user
 boolean hasUserRole(String userId, IRoomRole role)
          Check if a user is assigned to a specific role
 boolean removeUserRole(String userId, IRoomRole role)
          Remove a specific role from a user
 

Method Detail

getAllUsers

public String[] getAllUsers()
Get the ids of all users

Returns:
Array containing all user ids

containsUser

public boolean containsUser(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(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 IRoomRole[] getUserRoles(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(String userId,
                           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(String userId,
                              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(String userId,
                               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

addGroupUsersToRole

public boolean addGroupUsersToRole(IGroup group,
                                   IRoomRole role,
                                   boolean childMembers)
Assign all users who are member of a given group to a specific room role. Not the group itself, but its members are assigned to the role. This means if the group is changed later (e.g. new members are invited), this doesn't affect the room role. With the flag childMembers=false only the direct members of the group are assigned. childMembers=true means that also members of sub groups (recursively) are assigned to the room role. If one or more of the group members was already assigned to the given role before the call, this is not an error.

Parameters:
group - the user group
role - the role object
childMembers - false means only direct members of the group are assigned
Returns:
true if the assignment was successful, false otherwise

addGroupUsersToRoles

public boolean addGroupUsersToRoles(IGroup group,
                                    IRoomRole[] roles,
                                    boolean childMembers)
Assign all users who are member of a given group to a a set of room roles. Not the group itself, but its members are assigned to the roles. This means if the group is changed later (e.g. new members are invited), this doesn't affect the room roles. With the flag childMembers=false only the direct members of the group are assigned. childMembers=true means that also members of sub groups (recursively) are assigned to the room roles. If one or more of the group members was already assigned to the given roles before the call, this is not an error.

Parameters:
group - the user group
roles - Array containing the roles for the group users
childMembers - false means only direct members of the group are assigned
Returns:
true if the assignment was successful, false otherwise

addUserRoles

public boolean addUserRoles(IRoomUsers refUsers)
Copy all user-role assignments from another IRoomUsers object to this object. Previously existing assignments on this object are preserved.

Parameters:
refUsers - the IRoomUsers object containing the room-role assignments to be copied

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(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(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(String userId,
                              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


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.