|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.security.MappedLoginService
public abstract class MappedLoginService
A login service that keeps UserIdentities in a concurrent map either as the source or a cache of the users.
Nested Class Summary | |
---|---|
static class |
MappedLoginService.Anonymous
|
static class |
MappedLoginService.KnownUser
|
static class |
MappedLoginService.RolePrincipal
|
static interface |
MappedLoginService.UserPrincipal
|
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
AbstractLifeCycle.AbstractLifeCycleListener |
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
protected IdentityService |
_identityService
|
protected String |
_name
|
protected ConcurrentMap<String,UserIdentity> |
_users
|
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
protected |
MappedLoginService()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IdentityService _identityService
protected String _name
protected final ConcurrentMap<String,UserIdentity> _users
Constructor Detail |
---|
protected MappedLoginService()
Method Detail |
---|
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
public String toString()
toString
in class AbstractLifeCycle
protected UserIdentity putUser(String userName, Object info)
userName
- User nameinfo
- a UserIdentity instance, or a String password or Credential instance
public UserIdentity putUser(String userName, Credential credential, String[] roles)
userName
- The user to addcredential
- The users Credentialsroles
- The users roles
public void removeUser(String username)
public UserIdentity login(String username, Object credentials)
LoginService
login
in interface LoginService
username
- The user namecredentials
- The users credentials
LoginService.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 validate
protected abstract UserIdentity loadUser(String username)
protected abstract void loadUsers() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |