Package jetbrains.buildServer.users.impl
Class FeatureProviderUserUpdate
- java.lang.Object
-
- jetbrains.buildServer.users.impl.FeatureProviderUserUpdate
-
- All Implemented Interfaces:
PropertyUpdater<Long>
,RolesUpdate<Long>
,UserUpdate
public class FeatureProviderUserUpdate extends Object implements UserUpdate
-
-
Constructor Summary
Constructors Constructor Description FeatureProviderUserUpdate(FeatureProvider featureProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRole(Long id, RoleScope roleScope, Role role)
Adds a role with specified scope to an entity with specified id.void
blockStateChanged(SUser user)
void
deleteProperty(Long id, PropertyKey propertyKey)
void
notifyUserChanged(SUser user)
void
notifyUserPermissionsMayHaveChanged(SUser user)
void
notifyUserPropertyChanged(SUser user, PropertyKey propertyKey)
void
notifyUserRolesChanged(SUser user)
void
persistLastLoginTimestamp(long userId, Date timestamp)
Note: login timestamp will be persisted with some delay.void
removeRole(Long id, Role role)
Removes the specified role from the entity with specified id.void
removeRole(Long id, RoleScope roleScope, Role role)
Removes role with specified scope from the entity with specified id.void
removeRole(Role role)
Removes the specified role for all roles holders.void
removeRoles(Long id, RoleScope roleScope)
Removes all roles with specified scope from the entity with specified id.void
setBuildTypesOrder(long userId, String projectId, UserImpl.BuildTypesOrder buildTypesOrder)
Sets order of build typesvoid
setPassword(long userId, String password)
void
setProjectsOrder(long userId, List<String> projectsOrder)
Sets order of the projects.void
setProjectsVisibility(long userId, Collection<String> projectIds, boolean isVisible)
Set visibility state for selected projects.void
setProperties(Long id, Map<? extends PropertyKey,String> properties)
void
setProperty(Long id, PropertyKey prop, String value)
void
setVisibleProjects(long userId, Collection<String> visibleProjects)
Sets projects visible for specified uservoid
updateUserAccount(long userId, String username, String name, String email)
Updates user with specified id and sets his/her username and name.
-
-
-
Constructor Detail
-
FeatureProviderUserUpdate
public FeatureProviderUserUpdate(FeatureProvider featureProvider)
-
-
Method Detail
-
updateUserAccount
public void updateUserAccount(long userId, String username, String name, String email) throws UserNotFoundException, DuplicateUserAccountException, EmptyUsernameException
Description copied from interface:UserUpdate
Updates user with specified id and sets his/her username and name.- Specified by:
updateUserAccount
in interfaceUserUpdate
- Parameters:
userId
- user idusername
- usernamename
- full name of a user- Throws:
UserNotFoundException
- if specified user no longer exists in the modelDuplicateUserAccountException
- if a new username name already assigned to another userEmptyUsernameException
- if username is an empty string
-
setPassword
public void setPassword(long userId, String password) throws UserNotFoundException
- Specified by:
setPassword
in interfaceUserUpdate
- Throws:
UserNotFoundException
-
setProjectsOrder
public void setProjectsOrder(long userId, List<String> projectsOrder) throws UserNotFoundException
Description copied from interface:UserUpdate
Sets order of the projects.- Specified by:
setProjectsOrder
in interfaceUserUpdate
- Parameters:
userId
- id of a userprojectsOrder
- identificators of all projects in the order specified by user. The order will be reset to default (system) if null or empty.- Throws:
UserNotFoundException
- if specified user no longer exists
-
setVisibleProjects
public void setVisibleProjects(long userId, Collection<String> visibleProjects) throws UserNotFoundException
Description copied from interface:UserUpdate
Sets projects visible for specified user- Specified by:
setVisibleProjects
in interfaceUserUpdate
- Parameters:
userId
- id of a uservisibleProjects
- collection of identifiers of visible projects- Throws:
UserNotFoundException
- if specified user no longer exists
-
setBuildTypesOrder
public void setBuildTypesOrder(long userId, @NotNull String projectId, @Nullable UserImpl.BuildTypesOrder buildTypesOrder) throws UserNotFoundException
Description copied from interface:UserUpdate
Sets order of build types- Specified by:
setBuildTypesOrder
in interfaceUserUpdate
buildTypesOrder
- build type internal ids- Throws:
UserNotFoundException
-
setProjectsVisibility
public void setProjectsVisibility(long userId, @NotNull Collection<String> projectIds, boolean isVisible)
Description copied from interface:UserUpdate
Set visibility state for selected projects. Doesn't affect other projects nor project order.- Specified by:
setProjectsVisibility
in interfaceUserUpdate
-
persistLastLoginTimestamp
public void persistLastLoginTimestamp(long userId, Date timestamp) throws UserNotFoundException
Description copied from interface:UserUpdate
Note: login timestamp will be persisted with some delay.- Specified by:
persistLastLoginTimestamp
in interfaceUserUpdate
- Parameters:
userId
- user idtimestamp
- timestamp- Throws:
UserNotFoundException
-
notifyUserChanged
public void notifyUserChanged(@NotNull SUser user)
- Specified by:
notifyUserChanged
in interfaceUserUpdate
-
notifyUserPropertyChanged
public void notifyUserPropertyChanged(@NotNull SUser user, @NotNull PropertyKey propertyKey)
- Specified by:
notifyUserPropertyChanged
in interfaceUserUpdate
-
notifyUserRolesChanged
public void notifyUserRolesChanged(@NotNull SUser user)
- Specified by:
notifyUserRolesChanged
in interfaceUserUpdate
-
notifyUserPermissionsMayHaveChanged
public void notifyUserPermissionsMayHaveChanged(@NotNull SUser user)
- Specified by:
notifyUserPermissionsMayHaveChanged
in interfaceUserUpdate
-
blockStateChanged
public void blockStateChanged(@NotNull SUser user)
- Specified by:
blockStateChanged
in interfaceUserUpdate
-
addRole
public void addRole(@NotNull Long id, @NotNull RoleScope roleScope, @NotNull Role role)
Description copied from interface:RolesUpdate
Adds a role with specified scope to an entity with specified id.- Specified by:
addRole
in interfaceRolesUpdate<Long>
- Parameters:
id
- uidroleScope
- scope of the rolerole
- role
-
removeRole
public void removeRole(@NotNull Long id, @NotNull RoleScope roleScope, @NotNull Role role)
Description copied from interface:RolesUpdate
Removes role with specified scope from the entity with specified id.- Specified by:
removeRole
in interfaceRolesUpdate<Long>
- Parameters:
id
- idroleScope
- scope of the rolerole
- role
-
removeRole
public void removeRole(@NotNull Long id, @NotNull Role role)
Description copied from interface:RolesUpdate
Removes the specified role from the entity with specified id. The role is removed from all of the scopes.- Specified by:
removeRole
in interfaceRolesUpdate<Long>
- Parameters:
id
- idrole
- role to remove
-
removeRoles
public void removeRoles(@NotNull Long id, @NotNull RoleScope roleScope)
Description copied from interface:RolesUpdate
Removes all roles with specified scope from the entity with specified id.- Specified by:
removeRoles
in interfaceRolesUpdate<Long>
- Parameters:
id
- idroleScope
- scope of the role
-
removeRole
public void removeRole(@NotNull Role role)
Description copied from interface:RolesUpdate
Removes the specified role for all roles holders.- Specified by:
removeRole
in interfaceRolesUpdate<Long>
- Parameters:
role
- role to remove
-
setProperties
public void setProperties(@NotNull Long id, @NotNull Map<? extends PropertyKey,String> properties)
- Specified by:
setProperties
in interfacePropertyUpdater<Long>
-
setProperty
public void setProperty(@NotNull Long id, @NotNull PropertyKey prop, String value)
- Specified by:
setProperty
in interfacePropertyUpdater<Long>
-
deleteProperty
public void deleteProperty(@NotNull Long id, @NotNull PropertyKey propertyKey)
- Specified by:
deleteProperty
in interfacePropertyUpdater<Long>
-
-