|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.security.jacc Class WebRoleRefPermission
java.lang.Object java.security.Permission javax.security.jacc.WebRoleRefPermission
- All Implemented Interfaces:
- Serializable, Guard
public final class WebRoleRefPermission
- extends Permission
- implements Serializable
Servlet
isUserInRole (String reference)
权限的类。WebRoleRefPermission 是一种指定权限,它包含各种操作。
WebRoleRefPermission 的名称(也称为目标名称)按 servlet 名称标识 Web 资源(在部署描述符中,servlet 名称对应于从中调用 isUserInRole (String reference)
的组件)。
WebRoleRefPermission 的操作标识应用权限的角色引用。检查 WebRoleRefPermission 确定主体是否是引用所标识的角色的成员。
此类的实现可以实现 newPermissionCollection,也可以从超类继承其实现。
See also | java.security.Permission |
Class for Servlet isUserInRole (String reference)
permissions. A WebRoleRefPermission is a named permission and has actions.
The name of an WebRoleRefPermission (also referred to as the target name)
identifies a Web resource by the servlet name (in the deployment
descriptor corresponding to the component from which the call to
isUserInRole (String reference)
is being made.
The actions of an WebRoleRefPermission identifies the role reference to which the permission applies. A WebRoleRefPermission is checked to determine if the subject is a member of the role identified by the reference.
Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.
- Author:
- Ron Monzillo, Gary Ellison
- See Also:
Permission
, Serialized Form
Constructor Summary | |
---|---|
WebRoleRefPermission(String name,
String actions)
Creates a new WebRoleRefPermission with the specified name and actions. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Checks two WebRoleRefPermission objects for equality. |
String |
getActions()
Returns a canonical String representation of the actions of this WebRoleRefPermission. |
int |
hashCode()
Returns the hash code value for this WebRoleRefPermission. |
boolean |
implies(Permission permission)
Determines if the argument Permission is "implied by" this WebRoleRefPermission. |
Methods inherited from class java.security.Permission |
---|
checkGuard, getName, newPermissionCollection, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public
WebRoleRefPermission(String name, String actions)
创建具有指定名称和操作创建的新 WebRoleRefPermission。
name | 标识在其上下文中求角色引用值的特定于应用程序的 Web 资源的 servlet 名称。 |
actions |
标识应用权限的角色引用。角色引用的范围限定为名称参数标识的 Web 资源。角色引用的值不得为 null 或空字符串。 |
WebRoleRefPermission
public WebRoleRefPermission(String name, String actions)
- Creates a new WebRoleRefPermission with the specified name and actions.
- Parameters:
name
- the servlet-name that identifies the application specific web resource in whose context the role references are to be evaluated.actions
- identifies the role reference to which the permission pertains. The role reference is scoped to the Web resource identified in the name parameter. The value of the role reference must not benull
or the empty string.
Method Detail |
---|
public boolean
equals(Object o)
检查两个 WebRoleRefPermission 对象是否相等。如果 WebRoleRefPermission 对象有相同的名称和操作值(区分大小写),则它们相等。
当且仅当 P1.implies(P2) && P2.implies(P1) 时,这两个 Permission 对象(P1 和 P2)才是相等的。
上述名称和操作比较是区分大小写的。
o | 要测试是否与此 WebRoleRefPermission 相等的 WebRoleRefPermission 对象 |
return | 如果参数 EJBRoleRefPermission 对象与此 EJBRoleRefPermission 相等,则返回 true。 |
equals
public boolean equals(Object o)
- Checks two WebRoleRefPermission objects for equality.
WebRoleRefPermission objects are equivalent if they have case
equivalent name and actions values.
Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).
The name and actions comparisons described above are case sensitive.
- Specified by:
equals
in classPermission
- Parameters:
o
- the WebRoleRefPermission object being tested for equality with this WebRoleRefPermission.- Returns:
- true if the argument WebRoleRefPermission object is equivalent to this WebRoleRefPermission.
public String
getActions()
返回此 WebRoleRefPermission 的操作的规范字符串表示形式。
return | 包含此 WebRoleRefPermission 的规范操作的字符串。 |
getActions
public String getActions()
- Returns a canonical String representation of the actions of this
WebRoleRefPermission.
- Specified by:
getActions
in classPermission
- Returns:
- a String containing the canonicalized actions of this WebRoleRefPermission.
public int
hashCode()
返回此 WebRoleRefPermission 的哈希码值。所返回哈希码的属性必须如下所示:
- 在 Java 应用程序的生命周期中,每次对 WebRoleRefPermission 对象调用 hashCode 方法时,该方法都必须返回相同的整数值。应用程序每次对特定 WebRoleRefPermission 执行 hashCode 所返回的值不必总是相同。
- 如果根据 equals 方法,两个 WebRoleRefPermission 对象相等,那么对这两个 Permission 对象调用 hashCode 方法必须生成相同的整数结果(在应用程序内)。
return | 此对象的整数哈希码值。 |
hashCode
public int hashCode()
- Returns the hash code value for this WebRoleRefPermission. The
properties of the returned hash code must be as follows:
- During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a WebRoleRefPermission object. The value returned by hashCode for a particular WebRoleRefPermission need not remain consistent from one execution of an application to another.
- If two WebRoleRefPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).
- Specified by:
hashCode
in classPermission
- Returns:
- the integer hash code value for this object.
public boolean
implies(java.security.Permission permission)
确定此 WebRoleRefPermission 是否“隐含”参数 Permission。如果是这样,
- 参数必须是 WebRoleRefPermission 的实例,
- 名称等于此 WebRoleRefPermission,且
- 角色引用等于此 WebRoleRefPermission(在其操作中定义)。
上述比较都是区分大小写的。
permission | 检查是否隐含参数权限的 "this" WebRoleRefPermission。 |
return | 如果对象隐含指定的权限,则返回 true;否则返回 false。 |
implies
public boolean implies(Permission permission)
- Determines if the argument Permission is "implied by" this
WebRoleRefPermission. For this to be the case,
- The argument must be an instanceof WebRoleRefPermission
- with name equivalent to this WebRoleRefPermission, and
- with role reference equivalent to this WebRoleRefPermission (as defined in their actions).
The comparisons described above are case sensitive.
- Specified by:
implies
in classPermission
- Parameters:
permission
- "this" WebRoleRefPermission is checked to see if it implies the argument permission.- Returns:
- true if the specified permission is implied by this object, false if not.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!