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 classUserModelEx.SORT_BY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(UserModelListenerEx listener)booleanatLeastOneUserAccountRegistered()Returns true if at least one user account exists.voidcheckUserAccountExists(String username)Checks whether a user account with specified username exists.UserExcreatePermissionsRestrictedUser(UserEx delegate, PermissionsHolder permissionsRestrictor)SUsercreateUserAccount(NewUserAccount newUserAccount)UserExfindUserAccount(String realm, String username)Searches for a user account with specified realm and usernameUserExfindUserById(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)UserExgetGuestUser()Returns guest userbooleanisSpecialUser(User user)Returns true if user is guest or root.voidsetLicenseKeysManager(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:UserModelSearches for a user by id in the current login domain. Login domain is defined by currently selected login module.- Specified by:
findUserByIdin 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:UserModelSearches for a user account with specified realm and username- Specified by:
findUserAccountin 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:UserModelReturns guest user- Specified by:
getGuestUserin 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
-
-