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.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
protected IdentityService |
_identityService |
protected String |
_name |
protected ConcurrentMap<String,UserIdentity> |
_users |
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, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
protected IdentityService _identityService
protected String _name
protected final ConcurrentMap<String,UserIdentity> _users
public String getName()
getName
in interface LoginService
public IdentityService getIdentityService()
getIdentityService
in interface LoginService
public ConcurrentMap<String,UserIdentity> getUsers()
public void setIdentityService(IdentityService identityService)
setIdentityService
in interface LoginService
identityService
- 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 AbstractLifeCycle
Exception
AbstractLifeCycle.doStart()
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
public void logout(UserIdentity identity)
logout
in interface LoginService
protected 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)
LoginService
login
in interface LoginService
username
- The user namecredentials
- The users credentialsLoginService.login(java.lang.String, java.lang.Object)
public boolean validate(UserIdentity user)
LoginService
LoginService.login(String, Object)
is still valid.validate
in interface LoginService
user
- The user to validateprotected abstract UserIdentity loadUser(String username)
protected abstract void loadUsers() throws IOException
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.