public class UserImpl extends Object implements User, ClusterSerializable
| Constructor and Description |
|---|
UserImpl() |
UserImpl(JsonObject principal) |
UserImpl(JsonObject principal,
JsonObject attributes) |
| Modifier and Type | Method and Description |
|---|---|
JsonObject |
attributes()
Gets extra attributes of the user.
|
Authorizations |
authorizations()
Returns user's authorizations that have been previously loaded by the providers.
|
boolean |
equals(Object obj) |
int |
hashCode() |
User |
isAuthorized(Authorization authorization,
Handler<AsyncResult<Boolean>> resultHandler)
Is the user authorised to
|
JsonObject |
principal()
Get the underlying principal for the User.
|
int |
readFromBuffer(int pos,
Buffer buffer) |
void |
setAuthProvider(AuthProvider authProvider)
Set the auth provider for the User.
|
void |
writeToBuffer(Buffer buffer) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitclearCache, containsKey, create, create, expired, expired, fromName, fromToken, get, isAuthorized, isAuthorized, isAuthorizedpublic UserImpl()
public UserImpl(JsonObject principal)
public UserImpl(JsonObject principal, JsonObject attributes)
public Authorizations authorizations()
Userauthorizations in interface Userpublic JsonObject attributes()
Userattributes in interface Userpublic User isAuthorized(Authorization authorization, Handler<AsyncResult<Boolean>> resultHandler)
UserisAuthorized in interface Userauthorization - the authority - what this really means is determined by the specific implementation. It might
represent a permission to access a resource e.g. `printers:printer34` or it might represent
authority to a role in a roles based model, e.g. `role:admin`.resultHandler - handler that will be called with an AsyncResult containing the value
`true` if the they has the authority or `false` otherwise.public JsonObject principal()
User
{
"username", "tim"
}
public void setAuthProvider(AuthProvider authProvider)
UsersetAuthProvider in interface UserauthProvider - the AuthProvider - this must be the same type of AuthProvider that originally created the Userpublic void writeToBuffer(Buffer buffer)
writeToBuffer in interface ClusterSerializablepublic int readFromBuffer(int pos,
Buffer buffer)
readFromBuffer in interface ClusterSerializableCopyright © 2021. All rights reserved.