Package jetbrains.buildServer.users
Interface UserModelEx
-
- All Superinterfaces:
UserModel
- All Known Implementing Classes:
SecuredUserModel
,UserModelImpl
public interface UserModelEx extends UserModel
- Author:
- Pavel.Sher Date: 18.04.2006
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
UserModelEx.SORT_BY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(UserModelListenerEx listener)
boolean
atLeastOneUserAccountRegistered()
Returns true if at least one user account exists.void
checkUserAccountExists(String username)
Checks whether a user account with specified username exists.UserEx
createPermissionsRestrictedUser(UserEx delegate, PermissionsHolder permissionsRestrictor)
SUser
createUserAccount(NewUserAccount newUserAccount)
UserEx
findUserAccount(String realm, String username)
Searches for a user account with specified realm and usernameUserEx
findUserById(long userId)
Searches for a user by id in the current login domain.List<UserEx>
findUsers(SearchOptions searchOptions, UserModelEx.SORT_BY sortOption, boolean ascending)
Searches for users with specified keyword in username, name or email.UserSet<SUser>
findUsersByAttributeValue(String attributeKey, String attributeValue, boolean caseSensitive)
Returns UserSet of users having specified attribute.List<SUser>
findUsersByVerifiedEmail(String verifiedEmail)
UserEx
getGuestUser()
Returns guest userboolean
isSpecialUser(User user)
Returns true if user is guest or root.void
setLicenseKeysManager(LicenseKeysManager licKeysManager)
-
Methods inherited from interface jetbrains.buildServer.users.UserModel
addListener, createUserAccount, findUserAccount, findUserByUsername, findUsersByIds, findUsersByPropertyValue, getAllUsers, getNumberOfRegisteredUsers, getSuperUser, hasAdministratorAccount, isGuestUser, isSuperUser, removeListener, removeUserAccount
-
-
-
-
Method Detail
-
findUsers
List<UserEx> findUsers(SearchOptions searchOptions, @NotNull UserModelEx.SORT_BY sortOption, boolean ascending)
Searches for users with specified keyword in username, name or email. If keyword is empty, then all users returned.- Parameters:
searchOptions
-sortOption
-ascending
-- Returns:
- unmodifiable collection of users
-
findUsersByVerifiedEmail
@NotNull List<SUser> findUsersByVerifiedEmail(@NotNull String verifiedEmail)
- Since:
- 2020.2
-
findUserById
@Nullable UserEx findUserById(long userId)
Description copied from interface:UserModel
Searches for a user by id in the current login domain. Login domain is defined by currently selected login module.- Specified by:
findUserById
in interfaceUserModel
- Parameters:
userId
- id of the user- Returns:
- found user or null
-
findUserAccount
@Nullable UserEx findUserAccount(@Nullable String realm, @NotNull String username)
Description copied from interface:UserModel
Searches for a user account with specified realm and username- Specified by:
findUserAccount
in interfaceUserModel
- Parameters:
realm
- realm is always ignored. Pass null here.username
- username- Returns:
- found user or null
-
createUserAccount
@NotNull SUser createUserAccount(@NotNull NewUserAccount newUserAccount) throws DuplicateUserAccountException, MaxNumberOfUserAccountsReachedException
-
checkUserAccountExists
void checkUserAccountExists(String username) throws DuplicateUserAccountException
Checks whether a user account with specified username exists. If such user found then DuplicateUserAccountException is thrown.- Parameters:
username
-- Throws:
DuplicateUserAccountException
-
atLeastOneUserAccountRegistered
boolean atLeastOneUserAccountRegistered()
Returns true if at least one user account exists.- Returns:
- see above
-
setLicenseKeysManager
void setLicenseKeysManager(@NotNull LicenseKeysManager licKeysManager)
-
createPermissionsRestrictedUser
UserEx createPermissionsRestrictedUser(@NotNull UserEx delegate, @NotNull PermissionsHolder permissionsRestrictor)
-
isSpecialUser
boolean isSpecialUser(@NotNull User user)
Returns true if user is guest or root.- Parameters:
user
-- Returns:
-
getGuestUser
@NotNull UserEx getGuestUser()
Description copied from interface:UserModel
Returns guest user- Specified by:
getGuestUser
in interfaceUserModel
- Returns:
- guest user
-
addListener
void addListener(UserModelListenerEx listener)
-
findUsersByAttributeValue
UserSet<SUser> findUsersByAttributeValue(String attributeKey, String attributeValue, boolean caseSensitive)
Returns UserSet of users having specified attribute.- Parameters:
attributeKey
- attribute keyattributeValue
- attribute valuecaseSensitive
- whether to perform case-sensitive search- Returns:
- set of users having the attribute with specified key and value
-
-