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, wait
create, createEventBusProxy, createFromClassName
public AuthService login(JsonObject principal, JsonObject credentials, Handler<AsyncResult<String>> resultHandler)
AuthService
login
in interface AuthService
principal
- 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)
AuthService
loginWithTimeout
in interface AuthService
principal
- 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)
AuthService
logout
in interface AuthService
loginID
- 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)
AuthService
refreshLoginSession
in interface AuthService
loginID
- 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)
AuthService
hasRole
in interface AuthService
loginID
- 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)
AuthService
hasRoles
in interface AuthService
loginID
- 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)
AuthService
hasPermission
in interface AuthService
loginID
- 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)
AuthService
hasPermissions
in interface AuthService
loginID
- 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)
AuthService
setReaperPeriod
in interface AuthService
reaperPeriod
- the reaper period, in mspublic void start()
AuthService
start
in interface AuthService
public void stop()
AuthService
stop
in interface AuthService
Copyright © 2015. All Rights Reserved.