public class ScpNeoUserFacade extends AbstractUserFacade implements WithRuntimeDependencies
Constructor and Description |
---|
ScpNeoUserFacade() |
Modifier and Type | Method and Description |
---|---|
void |
assertRuntimeDependenciesExist()
Asserts that required runtime dependencies are available on the class path.
|
Optional<User> |
getUserByName(String name)
Returns a
User by its name, if it exists. |
Class<ScpNeoUser> |
getUserClass()
Returns the platform-specific implementation class of
User . |
protected User |
newMockedUser()
Instantiates a mocked
User . |
Optional<User> |
resolveCurrentUser()
Resolves the current
User using the platform-specific lookup. |
getCurrentUser, getCurrentUserIfAuthenticated, getMockedUser, tryGetCurrentUser
@Nonnull public Class<ScpNeoUser> getUserClass()
User
. For internal use only.getUserClass
in interface UserFacade
@Nonnull protected User newMockedUser()
User
.newMockedUser
in class AbstractUserFacade
User
.public void assertRuntimeDependenciesExist() throws DependencyNotFoundException
assertRuntimeDependenciesExist
in interface WithRuntimeDependencies
DependencyNotFoundException
- If a required runtime dependency is not available.@Nonnull public Optional<User> resolveCurrentUser() throws UserAccessException
User
using the platform-specific lookup. For internal use only.
Caution: This method must only be invoked within the container-managed thread of a request.
resolveCurrentUser
in interface UserFacade
Optional
of the current User
.UserAccessException
- If there is an issue while resolving the User
.UserRequestContextListener
@Nonnull public Optional<User> getUserByName(@Nullable String name) throws UserAccessDeniedException, UserAccessException
User
by its name, if it exists.getUserByName
in interface UserFacade
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
.Copyright © 2019 SAP SE. All rights reserved.