@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
User s 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()
UserManager
Returns the id of the current tenant.
getCurrentTenantId
in interface UserManager
public String getCurrentUserId()
UserManager
Returns the id of the current user.
getCurrentUserId
in interface UserManager
public User getCurrentUser()
UserManager
Returns the current user.
getCurrentUser
in interface UserManager
public String getCurrentSystemAdminUserId()
UserManager
Returns the id of the current system admin user.
getCurrentSystemAdminUserId
in interface UserManager
public User getCurrentSystemAdminUser()
UserManager
Returns the current system admin user.
getCurrentSystemAdminUser
in interface UserManager
public User getUser(String userId)
UserManager
Returns the user with the given id.
getUser
in interface UserManager
userId
- the user id, not nullpublic void setActive(String userId, boolean isActive)
UserManager
Set the state of the user object.
setActive
in interface UserManager
userId
- the user id, not nullisActive
- true if the user gets activated, false otherwisepublic Optional<User> findUser(Predicate predicate)
UserManager
Finds the User
that matches the given predicate.
findUser
in interface UserManager
predicate
- the predicate to apply, never nullpublic com.google.common.collect.ImmutableList<User> findUsers(Predicate predicate)
UserManager
Finds the User
s that match the given predicate.
findUsers
in interface UserManager
predicate
- the predicate to apply, never nullpublic Optional<User> findUserAcrossAllTenants(Predicate predicate)
UserManager
Finds the User
that matches the given predicate across all tenants.
findUserAcrossAllTenants
in interface UserManager
predicate
- the predicate to apply, never nullpublic String createUser(User user)
UserManager
Persists the given User
object as an AnyWorkObject
with type WorkObjectTypes.USER_TYPE
and
the predefined user variables.
createUser
in interface UserManager
user
- the user to be created, not nullpublic String updateUser(User user)
UserManager
Updates 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 UserManager
user
- the user to be updated, not nullCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.