Package net.jini.security
Class AccessPermission
java.lang.Object
java.security.Permission
net.jini.security.AccessPermission
- All Implemented Interfaces:
Serializable,Guard
- Direct Known Subclasses:
ContextPermission,MahaloPermission,RegistrarPermission
Represents permission to call a method. An instance of this class contains a name (also referred
to as a "target name") but no actions list; you either have the named permission or you don't.
The target name can be any of the following forms:
* Identifier *Suffix Identifier* QualifiedIdentifier.* QualifiedIdentifier.Identifier QualifiedIdentifier.*Suffix QualifiedIdentifier.Identifier*where QualifiedIdentifier and Identifier are as defined in The Java(TM) Language Specification except that whitespace is not permitted, and Suffix is defined to be one or more characters that may be part of an Identifier. These forms are defined to match fully qualified names of the form QualifiedIdentifier.Identifier as follows:
| Target Name | QualifiedIdentifier Match | Identifier Match |
|---|---|---|
| * | any | any |
| method | any | method |
| *suffix | any | any ending with suffix |
| prefix* | any | any starting with prefix |
| type.* | type | any |
| type.method | type | method |
| type.*suffix | type | any ending with suffix |
| type.prefix* | type | any starting with prefix |
This class, and simple subclasses of it, can be used (for
example) with net.jini.jeri.BasicInvocationDispatcher. It is recommended that a
simple subclass of this class be defined for each remote object implementation class that can be
exported using an Exporter, to allow separation of grants in policy
files.
- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAccessPermission(String name) Creates an instance with the specified target name. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the specified object is an instance of the same class as this permission and has the same target name as this permission; returnsfalseotherwise.Returns the empty string.inthashCode()Returns a hash code value for this object.booleanimplies(Permission perm) Returnstrueif every fully qualified name that matches the specified permission's name also matches this permission's name; returnsfalseotherwise.Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
-
Constructor Details
-
AccessPermission
Creates an instance with the specified target name.- Parameters:
name- the target name- Throws:
NullPointerException- if the target name isnullIllegalArgumentException- if the target name does not match the syntax specified in the comments at the beginning of this class
-
-
Method Details
-
implies
Returnstrueif every fully qualified name that matches the specified permission's name also matches this permission's name; returnsfalseotherwise.- Specified by:
impliesin classPermission- Parameters:
perm- the permission to check- Returns:
trueif every fully qualified name that matches the specified permission's name also matches this permission's name;falseotherwise
-
equals
Returnstrueif the specified object is an instance of the same class as this permission and has the same target name as this permission; returnsfalseotherwise.- Specified by:
equalsin classPermission
-
hashCode
public int hashCode()Returns a hash code value for this object.- Specified by:
hashCodein classPermission
-
getActions
Returns the empty string.- Specified by:
getActionsin classPermission
-