public final class UserAccessor extends Object
User
.
This class handles the access to a User
by delegating the calls to the underlying UserFacade
.
Constructor and Description |
---|
UserAccessor() |
Modifier and Type | Method and Description |
---|---|
static User |
getCurrentUser()
Returns the current
User . |
static com.google.common.base.Optional<User> |
getUserByName(String name)
Returns the current
User by its name, if it exists. |
static UserFacade |
getUserFacade()
Returns the
UserFacade instance. |
static void |
setUserFacade(UserFacade userFacade)
Replaces the default
UserFacade instance. |
public static void setUserFacade(UserFacade userFacade)
UserFacade
instance. This method is for internal use only.userFacade
- The facade to replace the current/default one with.public static User getCurrentUser() throws UserNotAuthenticatedException, UserAccessException
User
.User
.UserNotAuthenticatedException
- If the current User
is not authenticated.UserAccessException
- If there is an issue while accessing the User
.public static com.google.common.base.Optional<User> getUserByName(@Nullable String name) throws UserAccessDeniedException, UserAccessException
User
by its name, if it exists.name
- The name of the user to find.UserAccessDeniedException
- If accessing user information is denied.UserAccessException
- If there is an issue while accessing the User
.@Nullable public static UserFacade getUserFacade()
UserFacade
instance. For internal use only.Copyright © 2018 SAP SE. All rights reserved.