org.eclipse.jetty.security
类 MappedLoginService

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.security.MappedLoginService
所有已实现的接口:
LoginService, LifeCycle
直接已知子类:
DataSourceLoginService, HashLoginService, JDBCLoginService

public abstract class MappedLoginService
extends AbstractLifeCycle
implements LoginService

A login service that keeps UserIdentities in a concurrent map either as the source or a cache of the users.


嵌套类摘要
static class MappedLoginService.Anonymous
           
static class MappedLoginService.KnownUser
           
static class MappedLoginService.RolePrincipal
           
static interface MappedLoginService.UserPrincipal
           
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
protected  IdentityService _identityService
           
protected  String _name
           
protected  ConcurrentMap<String,UserIdentity> _users
           
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
protected MappedLoginService()
           
 
方法摘要
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.
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

_identityService

protected IdentityService _identityService

_name

protected String _name

_users

protected final ConcurrentMap<String,UserIdentity> _users
构造方法详细信息

MappedLoginService

protected MappedLoginService()
方法详细信息

getName

public String getName()
Get the name.

指定者:
接口 LoginService 中的 getName
返回:
the name

getIdentityService

public IdentityService getIdentityService()
Get the identityService.

指定者:
接口 LoginService 中的 getIdentityService
返回:
the identityService

getUsers

public ConcurrentMap<String,UserIdentity> getUsers()
Get the users.

返回:
the users

setIdentityService

public void setIdentityService(IdentityService identityService)
Set the identityService.

指定者:
接口 LoginService 中的 setIdentityService
参数:
identityService - the identityService to set

setName

public void setName(String name)
Set the name.

参数:
name - the name to set

setUsers

public void setUsers(Map<String,UserIdentity> users)
Set the users.

参数:
users - the users to set

doStart

protected void doStart()
                throws Exception
覆盖:
AbstractLifeCycle 中的 doStart
抛出:
Exception
另请参见:
AbstractLifeCycle.doStart()

doStop

protected void doStop()
               throws Exception
覆盖:
AbstractLifeCycle 中的 doStop
抛出:
Exception

logout

public void logout(UserIdentity identity)
指定者:
接口 LoginService 中的 logout

toString

public String toString()
覆盖:
Object 中的 toString

putUser

protected UserIdentity putUser(String userName,
                               Object info)
Put user into realm. Called by implementations to put the user data loaded from file/db etc into the user structure.

参数:
userName - User name
info - a UserIdentity instance, or a String password or Credential instance
返回:
User instance

putUser

public UserIdentity putUser(String userName,
                            Credential credential,
                            String[] roles)
Put user into realm.

参数:
userName - The user to add
credential - The users Credentials
roles - The users roles
返回:
UserIdentity

removeUser

public void removeUser(String username)

login

public UserIdentity login(String username,
                          Object credentials)
从接口 LoginService 复制的描述
Login a user.

指定者:
接口 LoginService 中的 login
参数:
username - The user name
credentials - The users credentials
返回:
A UserIdentity if the credentials matched, otherwise null
另请参见:
LoginService.login(java.lang.String, java.lang.Object)

validate

public boolean validate(UserIdentity user)
从接口 LoginService 复制的描述
Validate a user identity. Validate that a UserIdentity previously created by a call to LoginService.login(String, Object) is still valid.

指定者:
接口 LoginService 中的 validate
参数:
user - The user to validate
返回:
true if authentication has not been revoked for the user.

loadUser

protected abstract UserIdentity loadUser(String username)

loadUsers

protected abstract void loadUsers()
                           throws IOException
抛出:
IOException


Copyright © 2013. All Rights Reserved.