public class IxcPermission extends Permission implements Serializable, Guard
Constructor and Description |
---|
IxcPermission(String name,
String actions) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks two Permission objects for equality.
|
String |
getActions()
Returns the actions as a String.
|
int |
hashCode()
Returns the hash code value for this Permission object.
|
boolean |
implies(Permission permission)
Checks if the specified permission's actions are "implied by"
this object's actions.
|
PermissionCollection |
newPermissionCollection()
Returns an empty PermissionCollection for a given Permission object, or null if
one is not defined.
|
checkGuard, getName, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkGuard
public boolean equals(Object obj)
Permission
Do not use the equals
method for making access control
decisions; use the implies
method.
equals
in class Permission
obj
- the object we are testing for equality with this object.Object.hashCode()
,
HashMap
public String getActions()
Permission
perm1 = new FilePermission(p1,"read,write"); perm2 = new FilePermission(p2,"write,read");both return "read,write" when the
getActions
method is invoked.getActions
in class Permission
public int hashCode()
Permission
The required hashCode
behavior for Permission Objects is
the following:
hashCode
method
must consistently return the same integer. This integer need not
remain consistent from one execution of an application to another
execution of the same application.
equals
method, then calling the hashCode
method on each of the
two Permission objects must produce the same integer result.
hashCode
in class Permission
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean implies(Permission permission)
Permission
This must be implemented by subclasses of Permission, as they are the only ones that can impose semantics on a Permission object.
The implies
method is used by the AccessController to determine
whether or not a requested permission is implied by another permission that
is known to be valid in the current execution context.
implies
in class Permission
permission
- the permission to check against.public PermissionCollection newPermissionCollection()
Permission
PermissionCollection.implies
method is called.
If null is returned,
then the caller of this method is free to store permissions of this
type in any PermissionCollection they choose (one that uses a Hashtable,
one that uses a Vector, etc).newPermissionCollection
in class Permission