Known Direct Subclasses
AllPermission |
AllPermission represents the permission to perform any operation. |
BasicPermission |
BasicPermission is the common base class of all permissions which
have a name but no action lists. |
FilePermission |
A permission for accessing a file or directory. |
PrivateCredentialPermission |
Protects private credential objects belonging to a Subject . |
SocketPermission |
Regulates the access to network operations available through sockets through
permissions. |
UnresolvedPermission |
An UnresolvedPermission represents a Permission whose type
should be resolved lazy and not during initialization time of the Policy . |
|
Known Indirect Subclasses
AuthPermission |
Governs the use of methods in this package and also its subpackages. |
LoggingPermission |
The permission required to control the logging when run with a
SecurityManager . |
NetPermission |
This class represents permissions to configure the access to network
resources. |
PropertyPermission |
PropertyPermission objects represent a permission to access system
properties. |
ReflectPermission |
A ReflectPermission object represents a permission to access
operations in the reflection layer. |
RuntimePermission |
Represents the permission to execute a runtime-related function. |
SQLPermission |
A Permission relating to security access control in the java.sql
package. |
SSLPermission |
The class representing a network permission. |
SecurityPermission |
SecurityPermission objects guard access to the mechanisms which
implement security. |
SerializablePermission |
Is used to enable access to potentially unsafe serialization operations. |
|
Class Overview
Permission
is the common base class of all permissions that
participate in the access control security framework around
AccessController and AccessControlContext. A permission
constitutes of a name and associated actions.
Summary
Public Constructors |
|
Permission(String name)
Constructs a new instance of Permission with its name.
|
Public Methods |
void
|
checkGuard(Object obj)
|
abstract
boolean
|
equals(Object obj)
Compares the specified object with this Permission for equality
and returns true if the specified object is equal, false
otherwise.
|
abstract
String
|
getActions()
Returns a comma separated string identifying the actions associated with
this permission.
|
final
String
|
getName()
Returns the name of this permission.
|
abstract
int
|
hashCode()
Returns the hash code value for this Permission .
|
abstract
boolean
|
implies(Permission permission)
Indicates whether the specified permission is implied by this permission.
|
PermissionCollection
|
newPermissionCollection()
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
this Permission including its name and its actions.
|
[Expand]
Inherited Methods |
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
From interface java.security.Guard
abstract
void
|
checkGuard(Object object)
Checks whether access to the specified Object should be granted.
|
|
Public Constructors
public
Permission
(String name)
Constructs a new instance of Permission
with its name.
Parameters
name
| the name of the permission. |
Public Methods
public
void
checkGuard
(Object obj)
public
abstract
boolean
equals
(Object obj)
Compares the specified object with this Permission
for equality
and returns true
if the specified object is equal, false
otherwise.
The implies(Permission) method should be used for making access
control checks.
Parameters
obj
| object to be compared for equality with this Permission . |
Returns
true
if the specified object is equal to this Permission
, otherwise false
.
public
abstract
String
getActions
()
Returns a comma separated string identifying the actions associated with
this permission. The returned actions are in canonical form. For example:
sp0 = new SocketPermission("www.google.com", "connect,resolve")
sp1 = new SocketPermission("www.google.com", "resolve,connect")
sp0.getActions().equals(sp1.getActions()) //yields true
Both permissions return "connect,resolve" (in that order) if
#getActions()
is invoked. Returns an empty String, if no actions are
associated with this permission.
Returns
- the actions associated with this permission or an empty string if
no actions are associated with this permission.
public
final
String
getName
()
Returns the name of this permission.
Returns
- the name of this permission.
public
abstract
int
hashCode
()
Returns the hash code value for this Permission
. Returns the same
hash code for Permission
s that are equal to each other as
required by the general contract of hashCode().
Returns
- the hash code value for this
Permission
.
public
abstract
boolean
implies
(Permission permission)
Indicates whether the specified permission is implied by this permission.
The AccessController uses this method to check whether permission
protected access is allowed with the present policy.
Parameters
permission
| the permission to check against this permission. |
Returns
true
if the specified permission is implied by this
permission, false
otherwise.
Returns a specific PermissionCollection container for permissions
of this type. Returns null
if any permission collection can be
used.
Subclasses may override this method to return an appropriate collection
for the specific permissions they implement.
public
String
toString
()
Returns a string containing a concise, human-readable description of the
this Permission
including its name and its actions.
Returns
- a printable representation for this
Permission
.