Java DTV API 1.3
18-Nov-2009

com.sun.dtv.platform
Class UserPropertyPermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.BasicPermission
          extended by com.sun.dtv.platform.UserPropertyPermission
All Implemented Interfaces:
Serializable, Guard

public final class UserPropertyPermission
extends BasicPermission

This class describes permission for user properties. It leans on exactly the same behavior described for PropertyPermission but applies to user properties as defined in User.

Name

The name is that of the user property (e.g. "com.sun.dtv.user.name", "com.sun.dtv.rating.parental", etc). The naming convention follows the hierarchical property naming convention also described in User. Also, an asterisk may appear at the end of the name, following a ".", or by itself, to signify a wildcard match. For example "com.sun.dtv.*" or "*" is valid, "*sun" or "com*user" is not valid.

Actions

The actions to be granted are passed to the constructor in a string containing a list of zero or more comma-separated keywords. The possible keywords are "read" and "write". Their meaning is defined as follows:

read
read permission. Allows User.getProperties() and User.getProperty() to be called.
write
write permission. Allows User.setProperties(), User.setProperty() and User.removeProperties() to be called.

See Also:
PropertyPermission, BasicPermission, Permission, User, Serialized Form

Constructor Summary
UserPropertyPermission(String name, String actions)
          Creates a new UserPropertyPermission object with the specified name and actions.
 
Method Summary
 boolean equals(Object obj)
          Checks two UserPropertyPermission objects for equality.
 String getActions()
          Returns the "canonical string representation" of the actions.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(Permission p)
          Checks if this UserPropertyPermission object "implies" the specified permission.
 PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection object for storing UserPropertyPermission objects.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserPropertyPermission

public UserPropertyPermission(String name,
                              String actions)
Creates a new UserPropertyPermission object with the specified name and actions. The name is the name of the property, and action contains a comma-separated list of the desired actions granted on the property. Possible actions are read and write.

Parameters:
name - The name of the UserPropertyPermission.
actions - The actions string.
Method Detail

implies

public boolean implies(Permission p)
Checks if this UserPropertyPermission object "implies" the specified permission.

More specifically, this method returns true if:

  1. p is an instance of UserPropertyPermission,
  2. p's actions are a proper subset of this object's actions, and
  3. p's name is implied by this object's name. For example, "com.sun.dtv.user.*" implies "com.sun.dtv.user.name".

Overrides:
implies in class BasicPermission
Parameters:
p - The permission to check against.
Returns:
true if the specified permission is implied by this object, false if not.

equals

public boolean equals(Object obj)
Checks two UserPropertyPermission objects for equality. Checks that obj is a UserPropertyPermission, and has the same name and actions as this object.

Overrides:
equals in class BasicPermission
Parameters:
obj - The object we are testing for equality with this object.
Returns:
true if obj is a UserPropertyPermission, and has the same name and actions as this UserPropertyPermission object.

hashCode

public int hashCode()
Returns the hash code value for this object. The hash code used is the hash code of this permissions name, that is, getName().hashCode(), where getName is from the Permission superclass.

Overrides:
hashCode in class BasicPermission
Returns:
A hash code value for this object.

getActions

public String getActions()
Returns the "canonical string representation" of the actions. That is, this method always returns present actions in the alphabetic order: read, write. For example, if this UserPropertyPermission object allows both write and read actions, a call to getActions will return the string "read,write".

Overrides:
getActions in class BasicPermission
Returns:
The canonical string representation of the actions.

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns a new PermissionCollection object for storing UserPropertyPermission objects.

Overrides:
newPermissionCollection in class BasicPermission
Returns:
A new PermissionCollection object suitable for storing UserPropertyPermissions.

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.