@Manager public class DefaultUserManager extends Object implements UserManager
Default user manager which provides user related information.
| Constructor and Description |
|---|
DefaultUserManager(CurrentTenantService currentTenantService,
CurrentUserService currentUserService,
UserService userService) |
| Modifier and Type | Method and Description |
|---|---|
String |
createUser(User user)
Persists the given
User object as an AnyWorkObject with type WorkObjectTypes.USER_TYPE and
the predefined user variables. |
Optional<User> |
findUser(Predicate predicate)
Finds the
User that matches the given predicate. |
Optional<User> |
findUserAcrossAllTenants(Predicate predicate)
Finds the
User that matches the given predicate across all tenants. |
com.google.common.collect.ImmutableList<User> |
findUsers(Predicate predicate)
Finds the
Users that match the given predicate. |
User |
getCurrentSystemAdminUser()
Returns the current system admin user.
|
String |
getCurrentSystemAdminUserId()
Returns the id of the current system admin user.
|
String |
getCurrentTenantId()
Returns the id of the current tenant.
|
User |
getCurrentUser()
Returns the current user.
|
String |
getCurrentUserId()
Returns the id of the current user.
|
User |
getUser(String userId)
Returns the user with the given id.
|
void |
setActive(String userId,
boolean isActive)
Set the state of the user object.
|
String |
updateUser(User user)
Updates an already persisted user.
|
public DefaultUserManager(CurrentTenantService currentTenantService, CurrentUserService currentUserService, UserService userService)
public String getCurrentTenantId()
UserManagerReturns the id of the current tenant.
getCurrentTenantId in interface UserManagerpublic String getCurrentUserId()
UserManagerReturns the id of the current user.
getCurrentUserId in interface UserManagerpublic User getCurrentUser()
UserManagerReturns the current user.
getCurrentUser in interface UserManagerpublic String getCurrentSystemAdminUserId()
UserManagerReturns the id of the current system admin user.
getCurrentSystemAdminUserId in interface UserManagerpublic User getCurrentSystemAdminUser()
UserManagerReturns the current system admin user.
getCurrentSystemAdminUser in interface UserManagerpublic User getUser(String userId)
UserManagerReturns the user with the given id.
getUser in interface UserManageruserId - the user id, not nullpublic void setActive(String userId, boolean isActive)
UserManagerSet the state of the user object.
setActive in interface UserManageruserId - the user id, not nullisActive - true if the user gets activated, false otherwisepublic Optional<User> findUser(Predicate predicate)
UserManagerFinds the User that matches the given predicate.
findUser in interface UserManagerpredicate - the predicate to apply, never nullpublic com.google.common.collect.ImmutableList<User> findUsers(Predicate predicate)
UserManagerFinds the Users that match the given predicate.
findUsers in interface UserManagerpredicate - the predicate to apply, never nullpublic Optional<User> findUserAcrossAllTenants(Predicate predicate)
UserManagerFinds the User that matches the given predicate across all tenants.
findUserAcrossAllTenants in interface UserManagerpredicate - the predicate to apply, never nullpublic String createUser(User user)
UserManagerPersists the given User object as an AnyWorkObject with type WorkObjectTypes.USER_TYPE and
the predefined user variables.
createUser in interface UserManageruser - the user to be created, not nullpublic String updateUser(User user)
UserManagerUpdates an already persisted user. All user properties are updated except the following id’s: <ul> <li>User.id</li> <li>User.externalId</li> <li>User.tenantId</li> </ul>
updateUser in interface UserManageruser - the user to be updated, not nullCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.