public class AuthServiceVertxEBProxy extends Object implements AuthService
DEFAULT_LOGIN_TIMEOUT, DEFAULT_REAPER_PERIOD| Constructor and Description |
|---|
AuthServiceVertxEBProxy(Vertx vertx,
String address) |
| Modifier and Type | Method and Description |
|---|---|
AuthService |
hasPermission(String loginID,
String permission,
Handler<AsyncResult<Boolean>> resultHandler)
Does the user have the specified permission?
|
AuthService |
hasPermissions(String loginID,
Set<String> permissions,
Handler<AsyncResult<Boolean>> resultHandler)
Does the user have the specified permissions?
|
AuthService |
hasRole(String loginID,
String role,
Handler<AsyncResult<Boolean>> resultHandler)
Does the user have the specified role?
|
AuthService |
hasRoles(String loginID,
Set<String> roles,
Handler<AsyncResult<Boolean>> resultHandler)
Does the user have the specified roles?
|
AuthService |
login(JsonObject principal,
JsonObject credentials,
Handler<AsyncResult<String>> resultHandler)
Authenticate (login) using the specified credentials.
|
AuthService |
loginWithTimeout(JsonObject principal,
JsonObject credentials,
long timeout,
Handler<AsyncResult<String>> resultHandler)
Authenticate (login) using the specified credentials.
|
AuthService |
logout(String loginID,
Handler<AsyncResult<Void>> resultHandler)
Logout the user
|
AuthService |
refreshLoginSession(String loginID,
Handler<AsyncResult<Void>> resultHandler)
Refresh an existing login ID so it doesn't expire
|
AuthService |
setReaperPeriod(long reaperPeriod)
Set the reaper period - how often to check for expired logins, in ms.
|
void |
start()
Start the service
|
void |
stop()
Stop the service
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createEventBusProxy, createFromClassNamepublic AuthService login(JsonObject principal, JsonObject credentials, Handler<AsyncResult<String>> resultHandler)
AuthServicelogin in interface AuthServiceprincipal - represents the unique id (e.g. username) of the user being logged incredentials - the credentials - e.g. passwordresultHandler - will be passed a failed result if login failed or will be passed a succeeded result containing
the login ID (a string) if login was successful.public AuthService loginWithTimeout(JsonObject principal, JsonObject credentials, long timeout, Handler<AsyncResult<String>> resultHandler)
AuthServiceloginWithTimeout in interface AuthServiceprincipal - represents the unique id (e.g. username) of the user being logged incredentials - the credentialstimeout - the login timeout to use, in msresultHandler - will be passed a failed result if login failed or will be passed a succeeded result containing
the login ID (a string) if login was successful.public AuthService logout(String loginID, Handler<AsyncResult<Void>> resultHandler)
AuthServicelogout in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).resultHandler - will be called with success or failurepublic AuthService refreshLoginSession(String loginID, Handler<AsyncResult<Void>> resultHandler)
AuthServicerefreshLoginSession in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).resultHandler - will be called with success or failurepublic AuthService hasRole(String loginID, String role, Handler<AsyncResult<Boolean>> resultHandler)
AuthServicehasRole in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).role - the roleresultHandler - will be called with the result - true if has role, false if notpublic AuthService hasRoles(String loginID, Set<String> roles, Handler<AsyncResult<Boolean>> resultHandler)
AuthServicehasRoles in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).roles - the set of rolesresultHandler - will be called with the result - true if has roles, false if notpublic AuthService hasPermission(String loginID, String permission, Handler<AsyncResult<Boolean>> resultHandler)
AuthServicehasPermission in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).permission - the permissionresultHandler - will be called with the result - true if has permission, false if notpublic AuthService hasPermissions(String loginID, Set<String> permissions, Handler<AsyncResult<Boolean>> resultHandler)
AuthServicehasPermissions in interface AuthServiceloginID - the login ID as provided by AuthService.login(io.vertx.core.json.JsonObject, io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>).permissions - the set of permissionsresultHandler - will be called with the result - true if has permissions, false if notpublic AuthService setReaperPeriod(long reaperPeriod)
AuthServicesetReaperPeriod in interface AuthServicereaperPeriod - the reaper period, in mspublic void start()
AuthServicestart in interface AuthServicepublic void stop()
AuthServicestop in interface AuthServiceCopyright © 2015. All Rights Reserved.