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 String |
_name |
protected ConcurrentMap<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.
|
String |
getName()
Get the name.
|
ConcurrentMap<String,UserIdentity> |
getUsers()
Get the users.
|
protected abstract UserIdentity |
loadUser(String username) |
protected abstract void |
loadUsers() |
UserIdentity |
login(String username,
Object credentials)
Login a user.
|
void |
logout(UserIdentity identity) |
UserIdentity |
putUser(String userName,
Credential credential,
String[] roles)
Put user into realm.
|
protected UserIdentity |
putUser(String userName,
Object info)
Put user into realm.
|
void |
removeUser(String username) |
void |
setIdentityService(IdentityService identityService)
Set the identityService.
|
void |
setName(String name)
Set the name.
|
void |
setUsers(Map<String,UserIdentity> users)
Set the users.
|
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 String _name
protected final ConcurrentMap<String,UserIdentity> _users
public String getName()
getName in interface LoginServicepublic IdentityService getIdentityService()
getIdentityService in interface LoginServicepublic ConcurrentMap<String,UserIdentity> getUsers()
public void setIdentityService(IdentityService identityService)
setIdentityService in interface LoginServiceidentityService - the identityService to setpublic void setName(String name)
name - the name to setpublic void setUsers(Map<String,UserIdentity> users)
users - the users to setprotected void doStart()
throws Exception
doStart in class AbstractLifeCycleExceptionAbstractLifeCycle.doStart()protected void doStop()
throws Exception
doStop in class AbstractLifeCycleExceptionpublic void logout(UserIdentity identity)
logout in interface LoginServiceprotected UserIdentity putUser(String userName, Object info)
userName - User nameinfo - a UserIdentity instance, or a String password or Credential instancepublic UserIdentity putUser(String userName, Credential credential, String[] roles)
userName - The user to addcredential - The users Credentialsroles - The users rolespublic void removeUser(String username)
public UserIdentity login(String username, 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(String username)
protected abstract void loadUsers()
throws IOException
IOExceptionCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.