com.atlassian.confluence.it.usermanagement
Class DefaultUserManagementHelper

java.lang.Object
  extended by com.atlassian.confluence.it.usermanagement.DefaultUserManagementHelper
All Implemented Interfaces:
UserManagementHelper

public class DefaultUserManagementHelper
extends Object
implements UserManagementHelper


Constructor Summary
DefaultUserManagementHelper(ConfluenceRpc rpc)
          Deprecated. since 5.6 Use DefaultUserManagementHelper(com.atlassian.confluence.it.rpc.ConfluenceRpc, DirectoryConfiguration)
DefaultUserManagementHelper(ConfluenceRpc rpc, DirectoryConfiguration directoryConfiguration)
           
 
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)
           
 List<User> createMultipleUsers(int numUsers)
          Helper to create multiple users (calls UserManagementHelper.createUser(com.atlassian.confluence.it.User))
 UserWithKey createUser(User user)
          Creates the user, adds it to the default 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.
 Set<String> getUserGroups(User 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 removeMultipleUsers(List<User> users)
          Removes the list of users (calls UserManagementHelper.removeUser(User))
 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 renameUser(String oldUsername, String newUsername)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserManagementHelper

@Deprecated
public DefaultUserManagementHelper(ConfluenceRpc rpc)
Deprecated. since 5.6 Use DefaultUserManagementHelper(com.atlassian.confluence.it.rpc.ConfluenceRpc, DirectoryConfiguration)


DefaultUserManagementHelper

public DefaultUserManagementHelper(ConfluenceRpc rpc,
                                   DirectoryConfiguration directoryConfiguration)
Method Detail

addUserToGroup

public void addUserToGroup(String userName,
                           String groupName)
Specified by:
addUserToGroup in interface UserManagementHelper

addUserToGroup

public void addUserToGroup(User user,
                           Group group)
Specified by:
addUserToGroup in interface UserManagementHelper

getUserGroups

public Set<String> getUserGroups(User user)
Specified by:
getUserGroups in interface UserManagementHelper
Parameters:
user - the user who's group membership is to be checked.
Returns:
the set of groups the user belongs to or an empty Set if none.

addGroupToGroup

public void addGroupToGroup(Group childGroup,
                            Group parentGroup)
Description copied from interface: UserManagementHelper
Add childGroup to parentGroup. Does nothing if the membership already exists.

Specified by:
addGroupToGroup in interface UserManagementHelper

createUser

public UserWithKey createUser(User user)
Description copied from interface: UserManagementHelper
Creates the user, adds it to the default users group, and ensures the user profile is created (to work around CONF-6404).

Specified by:
createUser in interface UserManagementHelper

removeUser

public void removeUser(String username)
Specified by:
removeUser in interface UserManagementHelper

removeUser

public void removeUser(User user)
Specified by:
removeUser in interface UserManagementHelper

createGroup

public void createGroup(String groupName)
Specified by:
createGroup in interface UserManagementHelper

createGroup

public void createGroup(Group group)
Specified by:
createGroup in interface UserManagementHelper

removeUserFromGroup

public void removeUserFromGroup(User userName,
                                Group groupName)
Specified by:
removeUserFromGroup in interface UserManagementHelper

removeGroup

public void removeGroup(String groupName)
Specified by:
removeGroup in interface UserManagementHelper

createMultipleUsers

public List<User> createMultipleUsers(int numUsers)
Description copied from interface: UserManagementHelper
Helper to create multiple users (calls UserManagementHelper.createUser(com.atlassian.confluence.it.User))

Specified by:
createMultipleUsers in interface UserManagementHelper
Parameters:
numUsers - the number of users to create
Returns:
the list of users created

removeMultipleUsers

public void removeMultipleUsers(List<User> users)
Description copied from interface: UserManagementHelper
Removes the list of users (calls UserManagementHelper.removeUser(User))

Specified by:
removeMultipleUsers in interface UserManagementHelper
Parameters:
users - the list of users to remove

removeUserUncleanly

public void removeUserUncleanly(String username)
Description copied from interface: UserManagementHelper
Removes a user with the given username but do not remove their dependent permissions or pages.

Specified by:
removeUserUncleanly in interface UserManagementHelper
Parameters:
username - the username of the user to remove

removeUserUncleanly

public void removeUserUncleanly(User user)
Description copied from interface: UserManagementHelper
Removes a user but do not remove their dependent permissions or pages.

Specified by:
removeUserUncleanly in interface UserManagementHelper
Parameters:
user - the user to remove

removeGroupUncleanly

public void removeGroupUncleanly(Group group)
Description copied from interface: UserManagementHelper
Removes a group but do not remove their dependent permissions.

Specified by:
removeGroupUncleanly in interface UserManagementHelper
Parameters:
group - the group to remove

fixUser

public void fixUser(User user)
Description copied from interface: UserManagementHelper
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.

Specified by:
fixUser in interface UserManagementHelper
Parameters:
user - a user to set the details of

changePassword

public void changePassword(String username,
                           String newPassword)
Description copied from interface: UserManagementHelper
Change a user's password.

Specified by:
changePassword in interface UserManagementHelper
Parameters:
username - Username of the user whose password to change
newPassword - Password

setAutoSync

public void setAutoSync(boolean autoSync)
Specified by:
setAutoSync in interface UserManagementHelper

synchronise

public void synchronise()
Description copied from interface: UserManagementHelper
Force a synchronisation with an external user directory.

Specified by:
synchronise in interface UserManagementHelper

resetData

public void resetData(Set<User> usersToKeep,
                      Set<Group> groupsToKeep,
                      Map<Group,HashSet<User>> userGroupMembershipsToKeep)
Description copied from interface: UserManagementHelper
Return the User/Group/Membership data to a clean state.

Specified by:
resetData in interface UserManagementHelper

isExternal

public boolean isExternal()
Description copied from interface: UserManagementHelper
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.

Specified by:
isExternal in interface UserManagementHelper

startBatch

public void startBatch()
Description copied from interface: UserManagementHelper
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.

Specified by:
startBatch in interface UserManagementHelper

endBatch

public void endBatch()
Description copied from interface: UserManagementHelper
Flag that the batch transactions are complete, that a sync should be performed immediately, and that syncing should be re-enabled for future requests.

Specified by:
endBatch in interface UserManagementHelper

renameUser

public void renameUser(String oldUsername,
                       String newUsername)
Specified by:
renameUser in interface UserManagementHelper


Copyright © 2003–2015 Atlassian. All rights reserved.