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 boolean
addGroup(String groupname)
Adds the specified group.boolean
addProfilePicture(String userName, String fileName, String mimeType, byte[] pictureData)
Add a profile picture to a user's profileboolean
addUser(RemoteUser user, String password, boolean notifyUser)
Adds user.boolean
addUserToGroup(String username, String groupname)
Add user to the specified group.boolean
changeMyPassword(String token, String oldPass, String newPass)
Changes your password.boolean
changeUserPassword(String username, String newPass)
Changes the user's password.boolean
deactivateUser(String username)
Deactivates the specified user.boolean
editUser(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.RemoteConfluenceUser
getUserByKey(String userKey)
RemoteConfluenceUser
getUserByName(String username)
String[]
getUserGroups(String username)
Fetches the groups that the specified user belongs to.RemoteUserInformation
getUserInformation(String username)
boolean
getUserPreferenceBoolean(String username, String key)
long
getUserPreferenceLong(String username, String key)
String
getUserPreferenceString(String username, String key)
boolean
hasGroup(String groupname)
boolean
hasUser(String username)
boolean
isActiveUser(String username)
boolean
reactivateUser(String username)
boolean
removeAllPermissionsForGroup(String groupname)
Delete all permissions (global and space level) permissions for the group with the given name.boolean
removeGroup(String groupName, String moveToGroupName)
Delete group with name groupname.boolean
removeUser(String username)
Delete the given user from the Confluence System.boolean
removeUserFromGroup(String username, String groupname)
Delete the user with name username from the group with name groupname.boolean
renameUser(String oldUsername, String newUsername)
String[]
renameUsers(Map<String,String> oldUsernamesToNewUsernames)
Renames multiple users at the same time.void
setAttachmentManager(AttachmentManager attachmentManager)
void
setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
void
setLoginManager(LoginManager loginManager)
void
setPermissionManager(PermissionManager permissionManager)
void
setPersonalInformationManager(PersonalInformationManager personalInformationManager)
void
setSoapServiceHelper(SoapServiceHelper soapServiceHelper)
void
setSpaceManager(SpaceManager spaceManager)
void
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
void
setTokenAuthenticationManager(TokenAuthenticationManager tokenAuthenticationManager)
void
setUserAccessor(UserAccessor userAccessor)
boolean
setUserInformation(RemoteUserInformation userInfo)
boolean
setUserPreferenceBoolean(String username, String key, boolean value)
boolean
setUserPreferenceLong(String username, String key, long value)
boolean
setUserPreferenceString(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:
NotPermittedException
RemoteException
- 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:
NotPermittedException
RemoteException
-
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
-
-