org.eclipse.jetty.security
类 DefaultIdentityService

java.lang.Object
  继承者 org.eclipse.jetty.security.DefaultIdentityService
所有已实现的接口:
IdentityService

public class DefaultIdentityService
extends Object
implements IdentityService

Default Identity Service implementation. This service handles only role reference maps passed in an associated UserIdentity.Scope. If there are roles refs present, then associate will wrap the UserIdentity with one that uses the role references in the UserIdentity.isUserInRole(String, org.eclipse.jetty.server.UserIdentity.Scope) implementation. All other operations are effectively noops.


字段摘要
 
从接口 org.eclipse.jetty.security.IdentityService 继承的字段
NO_ROLES
 
构造方法摘要
DefaultIdentityService()
           
 
方法摘要
 Object associate(UserIdentity user)
          If there are roles refs present in the scope, then wrap the UserIdentity with one that uses the role references in the UserIdentity.isUserInRole(String, org.eclipse.jetty.server.UserIdentity.Scope)
 void disassociate(Object previous)
          Disassociate the user identity from the current thread and restore previous identity.
 UserIdentity getSystemUserIdentity()
           
 RunAsToken newRunAsToken(String runAsName)
          Create a new RunAsToken from a runAsName (normally a role).
 UserIdentity newUserIdentity(Subject subject, Principal userPrincipal, String[] roles)
          Create a new UserIdentity for use with this identity service.
 Object setRunAs(UserIdentity user, RunAsToken token)
          Associate a runas Token with the current user and thread.
 void unsetRunAs(Object lastToken)
          Disassociate the current runAsToken from the thread and reassociate the previous token.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

DefaultIdentityService

public DefaultIdentityService()
方法详细信息

associate

public Object associate(UserIdentity user)
If there are roles refs present in the scope, then wrap the UserIdentity with one that uses the role references in the UserIdentity.isUserInRole(String, org.eclipse.jetty.server.UserIdentity.Scope)

指定者:
接口 IdentityService 中的 associate
参数:
user - The current user or null for no user to associated.
返回:
an object representing the previous associated state

disassociate

public void disassociate(Object previous)
从接口 IdentityService 复制的描述
Disassociate the user identity from the current thread and restore previous identity.

指定者:
接口 IdentityService 中的 disassociate
参数:
previous - The opaque object returned from a call to IdentityService.associate(UserIdentity)

setRunAs

public Object setRunAs(UserIdentity user,
                       RunAsToken token)
从接口 IdentityService 复制的描述
Associate a runas Token with the current user and thread.

指定者:
接口 IdentityService 中的 setRunAs
参数:
user - The UserIdentity
token - The runAsToken to associate.
返回:
The previous runAsToken or null.

unsetRunAs

public void unsetRunAs(Object lastToken)
从接口 IdentityService 复制的描述
Disassociate the current runAsToken from the thread and reassociate the previous token.

指定者:
接口 IdentityService 中的 unsetRunAs
参数:
lastToken - RUNAS returned from previous associateRunAs call

newRunAsToken

public RunAsToken newRunAsToken(String runAsName)
从接口 IdentityService 复制的描述
Create a new RunAsToken from a runAsName (normally a role).

指定者:
接口 IdentityService 中的 newRunAsToken
参数:
runAsName - Normally a role name
返回:
A new immutable RunAsToken

getSystemUserIdentity

public UserIdentity getSystemUserIdentity()
指定者:
接口 IdentityService 中的 getSystemUserIdentity

newUserIdentity

public UserIdentity newUserIdentity(Subject subject,
                                    Principal userPrincipal,
                                    String[] roles)
从接口 IdentityService 复制的描述
Create a new UserIdentity for use with this identity service. The UserIdentity should be immutable and able to be cached.

指定者:
接口 IdentityService 中的 newUserIdentity
参数:
subject - Subject to include in UserIdentity
userPrincipal - Principal to include in UserIdentity. This will be returned from getUserPrincipal calls
roles - set of roles to include in UserIdentity.
返回:
A new immutable UserIdententity


Copyright © 2013. All Rights Reserved.