public class GPIOPortPermission extends DevicePermission
GPIOPortPermission class defines permissions for GPIO port access.
A GPIOPortPermission permission has a target name and a list of actions.
The target name contains hardware addressing information. The format is the one defined for the
base DevicePermission class with the following addition:
{channel-desc}{channel-desc} string (described in DevicePermission) must be
the empty string (("")).open, powermanage or setdirection. Their meaning
is defined as follows:
openDeviceManager.open)setdirectionGPIOPort.setDirection)powermanagePowerManaged)DeviceManager.open,
PowerManaged,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SET_DIRECTION
The
setdirection action. |
OPEN, POWER_MANAGE| Constructor and Description |
|---|
GPIOPortPermission(java.lang.String name)
Constructs a new
GPIOPortPermission with the specified target name and the implicit
open action. |
GPIOPortPermission(java.lang.String name,
java.lang.String actions)
Constructs a new
GPIOPortPermission instance with the specified target name and
action list. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Checks two
GPIOPortPermission objects for equality. |
java.lang.String |
getActions()
Returns the list of possible actions in the following order:
open,
powermanage or setdirection. |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission permission)
Checks if this
GPIOPortPermission object "implies" the specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing GPIOPortPermission objects. |
public static final java.lang.String SET_DIRECTION
setdirection action.public GPIOPortPermission(java.lang.String name)
GPIOPortPermission with the specified target name and the implicit
open action.name - the target name (as defined above).java.lang.NullPointerException - if name is null.getNamepublic GPIOPortPermission(java.lang.String name,
java.lang.String actions)
GPIOPortPermission instance with the specified target name and
action list.name - the target name (as defined above).actions - comma-separated list of device operations: open, powermanage
or setdirection.java.lang.NullPointerException - if name is null.java.lang.IllegalArgumentException - if actions is null, empty or contains an
action other than the specified possible actions.getNamepublic boolean equals(java.lang.Object obj)
GPIOPortPermission objects for equality.equals in class DevicePermissionobj - the object to test for equality with this object.true if obj is a GPIOPortPermission and has the same target
name and actions as this GPIOPortPermission object.public java.lang.String getActions()
open,
powermanage or setdirection.getActions in class DevicePermissionpublic int hashCode()
hashCode in class DevicePermissionpublic boolean implies(java.security.Permission permission)
GPIOPortPermission object "implies" the specified permission.
More specifically, this method returns true if:
permission is an instance of GPIOPortPermission, andpermission's actions are a proper subset of this object's action list, andpermission's hardware addressing information or range thereof is included in this
GPIOPinPermission's hardware addressing information range.implies in class DevicePermissionpermission - the permission to check against.true if the specified permission is not null and is implied by this
object, false otherwise.public java.security.PermissionCollection newPermissionCollection()
PermissionCollection for storing GPIOPortPermission objects.
GPIOPortPermission objects must be stored in a manner that allows them to be inserted
into the collection in any order, but that also enables the PermissionCollection
implies method to be implemented in an efficient (and consistent) manner.
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 DevicePermissionPermissionCollection suitable for storing GPIOPortPermission
objects, or null if one is not defined.Copyright © 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Legal Notices