com.atlassian.confluence.it.usermanagement
Interface UserManagementHelper

All Known Implementing Classes:
CrowdUserManagementHelper, DefaultUserManagementHelper, LdapUserManagementHelper

public interface UserManagementHelper

Abstracts the process of creating/removing/updating users and groups so that we can use external user management in test cases.


Method Summary
 void addGroupToGroup(Group childGroup, Group parentGroup)
          Add childGroup to parentGroup.
 void addUserToGroup(String userName, String groupName)
           
 void addUserToGroup(User user, Group group)
           
 void changePassword(String username, String newPassword)
          Change a user's password.
 void createGroup(Group group)
           
 void createGroup(String groupName)
           
 void createUser(User user)
          Creates the user, adds it to the default confluence-users group, and ensures the user profile is created (to work around CONF-6404).
 void endBatch()
          Flag that the batch transactions are complete, that a sync should be performed immediately, and that syncing should be re-enabled for future requests.
 void fixUser(User user)
          Ensure that the user's details in the system match those in user.
 boolean isExternal()
          Return true if this helper modifies Users, Groups and Group Memberships via RPC.
 void removeGroup(String groupName)
           
 void removeGroupUncleanly(Group group)
          Removes a group but do not remove their dependent permissions.
 void removeUser(String username)
           
 void removeUser(User user)
           
 void removeUserFromGroup(User userName, Group groupName)
           
 void removeUserUncleanly(String username)
          Removes a user with the given username but do not remove their dependent permissions or pages.
 void removeUserUncleanly(User user)
          Removes a user but do not remove their dependent permissions or pages.
 void resetData(Set<User> usersToKeep, Set<Group> groupsToKeep, Map<Group,HashSet<User>> userGroupMembershipsToKeep)
          Return the User/Group/Membership data to a clean state.
 void setAutoSync(boolean autoSync)
           
 void startBatch()
          Flag that a number of user/group transactions are about to be performed in a block, and any syncing should pause until the batch is finished.
 void synchronise()
          Force a synchronisation with an external user directory.
 

Method Detail

createUser

void createUser(User user)
Creates the user, adds it to the default confluence-users group, and ensures the user profile is created (to work around CONF-6404).


addUserToGroup

void addUserToGroup(String userName,
                    String groupName)

addUserToGroup

void addUserToGroup(User user,
                    Group group)

addGroupToGroup

void addGroupToGroup(Group childGroup,
                     Group parentGroup)
Add childGroup to parentGroup. Does nothing if the membership already exists.


removeUser

void removeUser(String username)

removeUser

void removeUser(User user)

createGroup

void createGroup(String groupName)

createGroup

void createGroup(Group group)

removeUserFromGroup

void removeUserFromGroup(User userName,
                         Group groupName)

removeGroup

void removeGroup(String groupName)

removeUserUncleanly

void removeUserUncleanly(String username)
Removes a user with the given username but do not remove their dependent permissions or pages.

Parameters:
username - the username of the user to remove
Throws:
org.apache.xmlrpc.XmlRpcException - if there were problems removing the user

removeUserUncleanly

void removeUserUncleanly(User user)
Removes a user but do not remove their dependent permissions or pages.

Parameters:
user - the user to remove
Throws:
org.apache.xmlrpc.XmlRpcException - if there were problems removing the user

removeGroupUncleanly

void removeGroupUncleanly(Group group)
Removes a group but do not remove their dependent permissions.

Parameters:
group - the group to remove
Throws:
org.apache.xmlrpc.XmlRpcException - if there were problems removing the group

fixUser

void fixUser(User user)
Ensure that the user's details in the system match those in user. That is, it finds the user in the system by its username, and sets the full name and email address.

Parameters:
user - a user to set the details of

changePassword

void changePassword(String username,
                    String newPassword)
Change a user's password.

Parameters:
username - Username of the user whose password to change
newPassword - Password

setAutoSync

void setAutoSync(boolean autoSync)

resetData

void resetData(Set<User> usersToKeep,
               Set<Group> groupsToKeep,
               Map<Group,HashSet<User>> userGroupMembershipsToKeep)
Return the User/Group/Membership data to a clean state.

Parameters:
usersToKeep -
groupsToKeep -
userGroupMembershipsToKeep -

isExternal

boolean isExternal()
Return true if this helper modifies Users, Groups and Group Memberships via RPC. Return false if this helper makes calls to different server, e.g. LDAP or Crowd.


synchronise

void synchronise()
Force a synchronisation with an external user directory.


startBatch

void startBatch()
Flag that a number of user/group transactions are about to be performed in a block, and any syncing should pause until the batch is finished.


endBatch

void endBatch()
Flag that the batch transactions are complete, that a sync should be performed immediately, and that syncing should be re-enabled for future requests.



Copyright © 2003-2012 Atlassian. All Rights Reserved.