SHOW Signed

net.rim.device.api.applicationcontrol
Class ApplicationPermissions

java.lang.Object
  |
  +--net.rim.device.api.applicationcontrol.ApplicationPermissions

public final class ApplicationPermissions
extends Object

Instances of this class will store a mapping from permissions to values.

Permissions

This class contains a set of constants whose names begin with PERMISSION_ (for example PERMISSION_AUTHENTICATOR_API). Each one of these "permissions" refers to a particular subset of the API that can be restricted by that application control.

Permission Values

Each permission can be set to one of three values. These values are (in order from least restrictive first to most restrictive last):
  1. VALUE_ALLOW
  2. VALUE_PROMPT
  3. VALUE_DENY
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 4.2.1

Field Summary
 Category: Signed static int PERMISSION_AUTHENTICATOR_API
           
 Category: Signed static int PERMISSION_BLUETOOTH
           
 Category: Signed static int PERMISSION_BROWSER_FILTER
           
 Category: Signed static int PERMISSION_CHANGE_DEVICE_SETTINGS
           
 Category: Signed static int PERMISSION_CODE_MODULE_MANAGEMENT
           
 Category: Signed static int PERMISSION_EMAIL
           
 Category: Signed static int PERMISSION_EVENT_INJECTOR
           
 Category: Signed static int PERMISSION_EXTERNAL_CONNECTIONS
           
 Category: Signed static int PERMISSION_FILE_API
           
 Category: Signed static int PERMISSION_HANDHELD_KEYSTORE
           
 Category: Signed static int PERMISSION_IDLE_TIMER
           
 Category: Signed static int PERMISSION_INTER_PROCESS_COMMUNUCATION
           
 Category: Signed static int PERMISSION_INTERNAL_CONNECTIONS
           
 Category: Signed static int PERMISSION_KEYSTORE_MEDIUM_SECURITY
           
 Category: Signed static int PERMISSION_LOCAL_CONNECTIONS
           
 Category: Signed static int PERMISSION_LOCATION_API
           
 Category: Signed static int PERMISSION_PHONE
           
 Category: Signed static int PERMISSION_PIM
           
 Category: Signed static int PERMISSION_THEME_DATA
           
 Category: Signed static int VALUE_ALLOW
          A constant representing a permission's value of "allow".
 Category: Signed static int VALUE_DENY
          A constant representing a permission's value of "deny".
 Category: Signed static int VALUE_PROMPT
          A constant representing a permission's value of "prompt".
 
Constructor Summary
 Category: Signed ApplicationPermissions()
          Creates a new empty ApplicationPermissions object.
 
Method Summary
 Category: Signed  void addPermission(int permission)
          Adds a permission with the value VALUE_ALLOW.
 Category: Signed  boolean containsPermissionKey(int permission)
          Returns whether or not a permission has been added.
 Category: Signed  int[] difference(ApplicationPermissions other)
          Returns the set of permissions in this object whose values are different than those of another.
 Category: Signed  int getPermission(int permission)
          Returns the value for a permission.
 Category: Signed  int[] getPermissionKeys()
          Returns the set of permissions that have been added.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSION_AUTHENTICATOR_API

public static final int PERMISSION_AUTHENTICATOR_API
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_BLUETOOTH

public static final int PERMISSION_BLUETOOTH
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_BROWSER_FILTER

public static final int PERMISSION_BROWSER_FILTER
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_CHANGE_DEVICE_SETTINGS

public static final int PERMISSION_CHANGE_DEVICE_SETTINGS
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_CODE_MODULE_MANAGEMENT

public static final int PERMISSION_CODE_MODULE_MANAGEMENT
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_EMAIL

public static final int PERMISSION_EMAIL
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_EVENT_INJECTOR

public static final int PERMISSION_EVENT_INJECTOR
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_EXTERNAL_CONNECTIONS

public static final int PERMISSION_EXTERNAL_CONNECTIONS
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_FILE_API

public static final int PERMISSION_FILE_API
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_HANDHELD_KEYSTORE

public static final int PERMISSION_HANDHELD_KEYSTORE
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_IDLE_TIMER

public static final int PERMISSION_IDLE_TIMER
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_INTER_PROCESS_COMMUNUCATION

public static final int PERMISSION_INTER_PROCESS_COMMUNUCATION
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_INTERNAL_CONNECTIONS

public static final int PERMISSION_INTERNAL_CONNECTIONS
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_KEYSTORE_MEDIUM_SECURITY

public static final int PERMISSION_KEYSTORE_MEDIUM_SECURITY
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_LOCAL_CONNECTIONS

public static final int PERMISSION_LOCAL_CONNECTIONS
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_LOCATION_API

public static final int PERMISSION_LOCATION_API
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_PHONE

public static final int PERMISSION_PHONE
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_PIM

public static final int PERMISSION_PIM
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

PERMISSION_THEME_DATA

public static final int PERMISSION_THEME_DATA
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

VALUE_ALLOW

public static final int VALUE_ALLOW
A constant representing a permission's value of "allow". If a permission is set to this value then it may use APIs controlled by the permission.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

VALUE_DENY

public static final int VALUE_DENY
A constant representing a permission's value of "deny". If a permission is set to this value then it may not use APIs controlled by the permission. Methods that are invoked when the corresponding Application Control is set to "deny" will throw an exception.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

VALUE_PROMPT

public static final int VALUE_PROMPT
A constant representing a permission's value of "prompt". If a permission is set to this value then it may use APIs controlled by the permission, but the user will be prompted upon the first usage and potentially subsequent uses.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Constructor Detail

ApplicationPermissions

public ApplicationPermissions()
Creates a new empty ApplicationPermissions object.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

addPermission

public void addPermission(int permission)
Adds a permission with the value VALUE_ALLOW. If the specified permission has already been added (that is, this.containsPermissionKey(permission) returns true) then its value is overwritten with VALUE_ALLOW.
Parameters:
permission - the permission to add with the value VALUE_ALLOW; valid values are any of the PERMISSION_ constants.
Throws:
IllegalArgumentException - if permission is not a valid value.
Since:
JDE 4.2.1
See Also:
getPermission(int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

containsPermissionKey

public boolean containsPermissionKey(int permission)
Returns whether or not a permission has been added.

A permission is considered to have been "added" if and only if it is contained in the array returned from getPermissionKeys().

Parameters:
permission - the permission to test for having been added; valid values are any of the PERMISSION_ constants.
Returns:
true if the specified permission has been added; false otherwise.
Throws:
IllegalArgumentException - if permission is not valid.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

difference

public int[] difference(ApplicationPermissions other)
Returns the set of permissions in this object whose values are different than those of another.

Formally, this method returns an array containing every PERMISSION_ constant, permission, that satisfies

     this.containsPermissionKey(permission) &&
     other.containsPermissionKey(permission) &&
     this.getPermission(permission) != other.getPermission(permission)
 
Parameters:
other - the ApplicationPermissions object to compare to this.
Returns:
the set of permissions in this object whose values are different than those of other, as defined above, or an empty array if there is no such difference; never returns null.
Throws:
NullPointerException - if other is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getPermission

public int getPermission(int permission)
Returns the value for a permission.
Parameters:
permission - the permission whose value to return; valid values are any of the PERMISSION_ constants.
Returns:
the value of the specified permission; will be equal to one of the VALUE_ constants.
Throws:
IllegalArgumentException - if permission is not a valid value or if permission has not been added; that is, this.containsPermissionKey(permission) returns false.
Since:
JDE 4.2.1
See Also:
addPermission(int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getPermissionKeys

public int[] getPermissionKeys()
Returns the set of permissions that have been added.
Returns:
the set of permissions that have been added, or an empty array if none have been added; never returns null; each element of the returned array will be equal to one of the permission constants defined in this class.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.