Class UsersSoapService
- java.lang.Object
-
- com.atlassian.confluence.rpc.soap.services.UsersSoapService
-
public class UsersSoapService extends Object
-
-
Constructor Summary
Constructors Constructor Description UsersSoapService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddGroup(String groupname)Adds the specified group.booleanaddProfilePicture(String userName, String fileName, String mimeType, byte[] pictureData)Add a profile picture to a user's profilebooleanaddUser(RemoteUser user, String password, boolean notifyUser)Adds user.booleanaddUserToGroup(String username, String groupname)Add user to the specified group.booleanchangeMyPassword(String token, String oldPass, String newPass)Changes your password.booleanchangeUserPassword(String username, String newPass)Changes the user's password.booleandeactivateUser(String username)Deactivates the specified user.booleaneditUser(RemoteUser remoteUser)Allows the email and the fullname of a user to be edited by specifying these values in the passed inRemoteUser.String[]getActiveUsers(boolean viewAll)String[]getGroups()Returns all groups.RemoteConfluenceUsergetUserByKey(String userKey)RemoteConfluenceUsergetUserByName(String username)String[]getUserGroups(String username)Fetches the groups that the specified user belongs to.RemoteUserInformationgetUserInformation(String username)booleangetUserPreferenceBoolean(String username, String key)longgetUserPreferenceLong(String username, String key)StringgetUserPreferenceString(String username, String key)booleanhasGroup(String groupname)booleanhasUser(String username)booleanisActiveUser(String username)booleanreactivateUser(String username)booleanremoveAllPermissionsForGroup(String groupname)Delete all permissions (global and space level) permissions for the group with the given name.booleanremoveGroup(String groupName, String moveToGroupName)Delete group with name groupname.booleanremoveUser(String username)Delete the given user from the Confluence System.booleanremoveUserFromGroup(String username, String groupname)Delete the user with name username from the group with name groupname.booleanrenameUser(String oldUsername, String newUsername)String[]renameUsers(Map<String,String> oldUsernamesToNewUsernames)Renames multiple users at the same time.voidsetAttachmentManager(AttachmentManager attachmentManager)voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)voidsetLoginManager(LoginManager loginManager)voidsetPermissionManager(PermissionManager permissionManager)voidsetPersonalInformationManager(PersonalInformationManager personalInformationManager)voidsetSoapServiceHelper(SoapServiceHelper soapServiceHelper)voidsetSpaceManager(SpaceManager spaceManager)voidsetSpacePermissionManager(SpacePermissionManager spacePermissionManager)voidsetTokenAuthenticationManager(TokenAuthenticationManager tokenAuthenticationManager)voidsetUserAccessor(UserAccessor userAccessor)booleansetUserInformation(RemoteUserInformation userInfo)booleansetUserPreferenceBoolean(String username, String key, boolean value)booleansetUserPreferenceLong(String username, String key, long value)booleansetUserPreferenceString(String username, String key, String value)
-
-
-
Method Detail
-
setAttachmentManager
public void setAttachmentManager(AttachmentManager attachmentManager)
-
setUserAccessor
public void setUserAccessor(UserAccessor userAccessor)
-
setSpacePermissionManager
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
-
setSoapServiceHelper
public void setSoapServiceHelper(SoapServiceHelper soapServiceHelper)
-
setSpaceManager
public void setSpaceManager(SpaceManager spaceManager)
-
setPermissionManager
public void setPermissionManager(PermissionManager permissionManager)
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
-
setLoginManager
public void setLoginManager(LoginManager loginManager)
-
setTokenAuthenticationManager
public void setTokenAuthenticationManager(TokenAuthenticationManager tokenAuthenticationManager)
-
getUserByName
public RemoteConfluenceUser getUserByName(String username) throws RemoteException
- Throws:
RemoteException- Since:
- 5.2
-
getUserByKey
public RemoteConfluenceUser getUserByKey(String userKey) throws RemoteException
- Throws:
RemoteException- Since:
- 5.2
-
addUser
public boolean addUser(RemoteUser user, String password, boolean notifyUser) throws RemoteException
Adds user.- Throws:
NotPermittedException- if you do not have permissions to add the user.RemoteException
-
removeUser
public boolean removeUser(String username) throws RemoteException
Delete the given user from the Confluence System.- Parameters:
username- is the name of the user that is to be deleted from the CONFLUENCE SYSTEM.- Throws:
RemoteException- if the specified user has authored content. You cannot remove users that have authored content.NotPermittedException- if you do not have permissions to remove the user
-
editUser
public boolean editUser(RemoteUser remoteUser) throws RemoteException
Allows the email and the fullname of a user to be edited by specifying these values in the passed inRemoteUser.- Throws:
NotPermittedException- if you do not have permissions to edit this userRemoteException- if the no user found with the name specified in remoteUser
-
getUserGroups
public String[] getUserGroups(String username) throws RemoteException
Fetches the groups that the specified user belongs to.- Returns:
- an array of the groups that this user belongs to as
String's - Throws:
RemoteException- if the no user found with the name specified in remoteUser
-
addUserToGroup
public boolean addUserToGroup(String username, String groupname) throws RemoteException
Add user to the specified group.- Throws:
RemoteException- if the user or group does not existNotPermittedException- if you do have permissions to modify the group and hence add members to it
-
removeUserFromGroup
public boolean removeUserFromGroup(String username, String groupname) throws RemoteException
Delete the user with name username from the group with name groupname.- Parameters:
username- is the name of the user that is to be deleted from the group with wih name groupname.groupname- is the name of the group from which the user with name username is to be deleted.- Throws:
RemoteException- if user/group with the given names does not existNotPermittedException- if you do not have permissions to remove the user from the specified group
-
addGroup
public boolean addGroup(String groupname) throws RemoteException
Adds the specified group. Group will not be created if it already exists.- Throws:
NotPermittedException- if you do not have permissions to add groups.RemoteException
-
removeAllPermissionsForGroup
public boolean removeAllPermissionsForGroup(String groupname) throws RemoteException
Delete all permissions (global and space level) permissions for the group with the given name.- Parameters:
groupname- is the group for which all the permissions has to be deleted- Returns:
- true if all permisisons were successfully removed from this group, false otherwise.
- Throws:
RemoteException- if group with the given name does not existNotPermittedException- if you do not have permissions to remove all permissions from this group
-
removeGroup
public boolean removeGroup(String groupName, String moveToGroupName) throws RemoteException
Delete group with name groupname. If moveToGroupName group is specified, members of the deleted group will be moved to it.- Parameters:
groupName- is the group that is to be deletedmoveToGroupName- moves members of deleted group to here- Throws:
RemoteException- if either group does not existNotPermittedException- if the current logged in user either does not have permission to remove the group, or modify the group to move members to
-
getGroups
public String[] getGroups() throws RemoteException
Returns all groups.- Throws:
RemoteException- if you are not allowed to retrieve all groups
-
deactivateUser
public boolean deactivateUser(String username) throws RemoteException
Deactivates the specified user.- Throws:
NotPermittedException- if you do not have permissions to set permissions on the specified userRemoteException- if user has already been deactivated.
-
reactivateUser
public boolean reactivateUser(String username) throws RemoteException
- Throws:
RemoteException
-
isActiveUser
public boolean isActiveUser(String username) throws RemoteException
- Throws:
RemoteException
-
getActiveUsers
public String[] getActiveUsers(boolean viewAll) throws RemoteException
- Throws:
RemoteException
-
changeMyPassword
public boolean changeMyPassword(String token, String oldPass, String newPass) throws RemoteException
Changes your password.- Parameters:
newPass- must not be null or empty string- Throws:
NotPermittedExceptionRemoteException- if the new password is null or empty
-
changeUserPassword
public boolean changeUserPassword(String username, String newPass) throws RemoteException
Changes the user's password.- Parameters:
newPass- must not be null or empty string- Throws:
NotPermittedExceptionRemoteException
-
setUserInformation
public boolean setUserInformation(RemoteUserInformation userInfo) throws RemoteException
- Throws:
RemoteException
-
getUserInformation
public RemoteUserInformation getUserInformation(String username) throws RemoteException
- Throws:
RemoteException
-
setUserPreferenceBoolean
public boolean setUserPreferenceBoolean(String username, String key, boolean value) throws RemoteException
- Throws:
RemoteException
-
getUserPreferenceBoolean
public boolean getUserPreferenceBoolean(String username, String key) throws RemoteException
- Throws:
RemoteException
-
setUserPreferenceLong
public boolean setUserPreferenceLong(String username, String key, long value) throws RemoteException
- Throws:
RemoteException
-
getUserPreferenceLong
public long getUserPreferenceLong(String username, String key) throws RemoteException
- Throws:
RemoteException
-
setUserPreferenceString
public boolean setUserPreferenceString(String username, String key, String value) throws RemoteException
- Throws:
RemoteException
-
getUserPreferenceString
public String getUserPreferenceString(String username, String key) throws RemoteException
- Throws:
RemoteException
-
hasUser
public boolean hasUser(String username)
-
hasGroup
public boolean hasGroup(String groupname) throws NotPermittedException
- Throws:
NotPermittedException
-
setPersonalInformationManager
public void setPersonalInformationManager(PersonalInformationManager personalInformationManager)
-
addProfilePicture
public boolean addProfilePicture(String userName, String fileName, String mimeType, byte[] pictureData) throws RemoteException
Add a profile picture to a user's profile- Parameters:
userName- The user name of the profilefileName- File name of the picturemimeType- Image mime type (must be from image/*)pictureData- The image data- Returns:
- true if successful
- Throws:
RemoteException
-
renameUser
public boolean renameUser(String oldUsername, String newUsername) throws RemoteException
- Throws:
RemoteException
-
renameUsers
public String[] renameUsers(Map<String,String> oldUsernamesToNewUsernames)
Renames multiple users at the same time.- Parameters:
oldUsernamesToNewUsernames- key value pairs where old username is the key and new username is the value- Returns:
- usernames of users that could not be renamed
-
-