Package alluxio.security.user
Interface UserState
-
- All Known Implementing Classes:
BaseUserState
,NoopUserState
,SimpleUserState
public interface UserState
UserState handles logging in any client, and maintains the state. The UserState provides access to theSubject
and theUser
for the client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
UserState.Factory
A factory for creating a UserState.
-
Field Summary
Fields Modifier and Type Field Description static java.util.ArrayList<UserStateFactory>
FACTORIES
An ordered list of factories for creating UserState instances.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description javax.security.auth.Subject
getSubject()
Returns the Subject for this user.User
getUser()
Returns the User object for this user.User
relogin()
Attempts to log in again, and returns the new User.default void
update(UserState otherUserState)
Use a new user state to update the credentials in the current user state.
-
-
-
Field Detail
-
FACTORIES
static final java.util.ArrayList<UserStateFactory> FACTORIES
An ordered list of factories for creating UserState instances. The UserState factories are tried in order, from first to last.
-
-
Method Detail
-
getSubject
javax.security.auth.Subject getSubject()
Returns the Subject for this user. Attempts to log in if not already logged in.- Returns:
- the
Subject
for this user state
-
getUser
User getUser() throws UnauthenticatedException
Returns the User object for this user. Attempts to log in if not already logged in.- Returns:
- the
User
for this user state - Throws:
UnauthenticatedException
- if the attempted login failed
-
relogin
User relogin() throws UnauthenticatedException
Attempts to log in again, and returns the new User.- Returns:
- the
User
for this user state, after the relogin - Throws:
UnauthenticatedException
- if the re-login failed
-
update
default void update(UserState otherUserState) throws java.io.IOException
Use a new user state to update the credentials in the current user state.- Parameters:
otherUserState
- the new user state for credentials update- Throws:
java.io.IOException
-
-