public final class PlayerPermission
extends java.security.Permission
Care should be taken before granting permission to record or make a snapshot. See the Addendum: Multi-media security for details.
The name
is the locator of the resource for which snapshot
or record is to be allowed.
If name
is "*" it applies to all locators.
If the last character of the locator is "*",
the permission applies to all locators that start with
the name (without the "*").
The actions to be granted are passed to the constructor in a string containing a list of one or more comma-separated keywords. The possible keywords are "record" and "snapshot". Their meaning is defined as follows:
RecordControl.setRecordLocation(java.lang.String)
and RecordControl.setRecordStream(java.io.OutputStream)
to be used
VideoControl.getSnapshot(java.lang.String)
to be used
The actions string is converted to lowercase before processing.
Permission
,
SecurityManager
Constructor and Description |
---|
PlayerPermission(java.lang.String name,
java.lang.String actions)
Creates a new PlayerPermission object with the specified name
and actions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Checks two PlayerPermission objects for equality.
|
java.lang.String |
getActions()
Returns the "canonical string representation" of the actions.
|
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission p)
Checks if this PlayerPermission object "implies" the specified
permission.
|
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing
PlayerPermission objects. |
public PlayerPermission(java.lang.String name, java.lang.String actions)
name
- the locator to which the permission applies.actions
- the actions string.java.lang.NullPointerException
- if name
or actions
is null
.java.lang.IllegalArgumentException
- if action
is invalid or
if name
is zero length.public boolean implies(java.security.Permission p)
More specifically, this method returns true if:
implies
in class java.security.Permission
p
- the permission to check against.public boolean equals(java.lang.Object obj)
equals
in class java.security.Permission
obj
- the object we are testing for equality with this object.public int hashCode()
hashCode
in class java.security.Permission
public java.lang.String getActions()
getActions
will return the string "record,snapshot".getActions
in class java.security.Permission
public java.security.PermissionCollection newPermissionCollection()
PermissionCollection
for storing
PlayerPermission
objects.
PlayerPermission
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.
newPermissionCollection
in class java.security.Permission
PermissionCollection
suitable for storing
PlayerPermission
objects.Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.