public final class DefaultUserCredentials extends Object implements UserCredentials
Modifier and Type | Method and Description |
---|---|
<T> T |
doAs(PrivilegedExceptionAction<T> action)
Execute the privileged action as a given user.
|
boolean |
isSet()
Check if the user credentials had been set.
|
void |
set(String name,
UserCredentials other)
Copy credentials from another existing user.
|
public void set(String name, UserCredentials other) throws IOException
set
in interface UserCredentials
name
- Name of the new user.other
- Credentials of another user.RuntimeException
- always throws.IOException
- if unable to copy.public boolean isSet()
isSet
in interface UserCredentials
public <T> T doAs(PrivilegedExceptionAction<T> action) throws Exception
doAs
in interface UserCredentials
T
- action return type.action
- an action to run.Exception
- whatever the action can throw.Copyright © 2017 The Apache Software Foundation. All rights reserved.