public abstract class MappedLoginService extends AbstractLifeCycle implements LoginService
| Modifier and Type | Class and Description |
|---|---|
static class |
MappedLoginService.Anonymous |
static class |
MappedLoginService.KnownUser |
static class |
MappedLoginService.RolePrincipal |
static interface |
MappedLoginService.UserPrincipal |
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected IdentityService |
_identityService |
protected java.lang.String |
_name |
protected java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> |
_users |
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING| Modifier | Constructor and Description |
|---|---|
protected |
MappedLoginService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart() |
protected void |
doStop() |
IdentityService |
getIdentityService()
Get the identityService.
|
java.lang.String |
getName()
Get the name.
|
java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> |
getUsers()
Get the users.
|
protected abstract UserIdentity |
loadUser(java.lang.String username) |
protected abstract void |
loadUsers() |
UserIdentity |
login(java.lang.String username,
java.lang.Object credentials)
Login a user.
|
void |
logout(UserIdentity identity) |
UserIdentity |
putUser(java.lang.String userName,
Credential credential,
java.lang.String[] roles)
Put user into realm.
|
protected UserIdentity |
putUser(java.lang.String userName,
java.lang.Object info)
Put user into realm.
|
void |
removeUser(java.lang.String username) |
void |
setIdentityService(IdentityService identityService)
Set the identityService.
|
void |
setName(java.lang.String name)
Set the name.
|
void |
setUsers(java.util.Map<java.lang.String,UserIdentity> users)
Set the users.
|
java.lang.String |
toString() |
boolean |
validate(UserIdentity user)
Validate a user identity.
|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopprotected IdentityService _identityService
protected java.lang.String _name
protected final java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> _users
public java.lang.String getName()
getName in interface LoginServicepublic IdentityService getIdentityService()
getIdentityService in interface LoginServicepublic java.util.concurrent.ConcurrentMap<java.lang.String,UserIdentity> getUsers()
public void setIdentityService(IdentityService identityService)
setIdentityService in interface LoginServiceidentityService - the identityService to setpublic void setName(java.lang.String name)
name - the name to setpublic void setUsers(java.util.Map<java.lang.String,UserIdentity> users)
users - the users to setprotected void doStart()
throws java.lang.Exception
doStart in class AbstractLifeCyclejava.lang.ExceptionAbstractLifeCycle.doStart()protected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.Exceptionpublic void logout(UserIdentity identity)
logout in interface LoginServicepublic java.lang.String toString()
toString in class java.lang.Objectprotected UserIdentity putUser(java.lang.String userName, java.lang.Object info)
userName - User nameinfo - a UserIdentity instance, or a String password or Credential instancepublic UserIdentity putUser(java.lang.String userName, Credential credential, java.lang.String[] roles)
userName - The user to addcredential - The users Credentialsroles - The users rolespublic void removeUser(java.lang.String username)
public UserIdentity login(java.lang.String username, java.lang.Object credentials)
LoginServicelogin in interface LoginServiceusername - The user namecredentials - The users credentialsLoginService.login(java.lang.String, java.lang.Object)public boolean validate(UserIdentity user)
LoginServiceLoginService.login(String, Object) is still valid.validate in interface LoginServiceuser - The user to validateprotected abstract UserIdentity loadUser(java.lang.String username)
protected abstract void loadUsers()
throws java.io.IOException
java.io.IOExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.