net.rim.device.api.drm
Class DRMManager

java.lang.Object
  extended by net.rim.device.api.drm.DRMManager

public class DRMManager
extends Object

The DRMManager provides the means for installing DRM rights objects.

Since:
BlackBerry API 4.7.0

Field Summary
static String PERMISSION_DISPLAY
          Represents the permission to display content
static String PERMISSION_EXECUTE
          Represents the permission to execute content
static String PERMISSION_PLAY
          Represents the permission to play content
static String PERMISSION_PRINT
          Represents the permission to print content
 
Method Summary
 byte[] getLicenseChallenge(String contentURL, String[] permissions)
          Generates a license challenge suitable for requesting the supplied permissions for the supplied file.
static DRMManager getManager()
          Retrieves the DRMManager for the device.
 void installRights(String contentURL, byte[] rightsData, DRMRightsInstallCallback callback)
          Installs the rights contained in the supplied rights data for the supplied file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

PERMISSION_DISPLAY

public static final String PERMISSION_DISPLAY
Represents the permission to display content

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

PERMISSION_EXECUTE

public static final String PERMISSION_EXECUTE
Represents the permission to execute content

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

PERMISSION_PLAY

public static final String PERMISSION_PLAY
Represents the permission to play content

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

PERMISSION_PRINT

public static final String PERMISSION_PRINT
Represents the permission to print content

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0


Method Detail

getManager

public static DRMManager getManager()
                             throws ControlledAccessException
Retrieves the DRMManager for the device. All DRM rights installation activities are performed using this manager.

Returns:
The devices DRMManager.
Throws:
ControlledAccessException - If the calling code does not have permission to access the DRMManager.
Since:
BlackBerry API 4.7.0

getLicenseChallenge

public byte[] getLicenseChallenge(String contentURL,
                                  String[] permissions)
                           throws DRMException,
                                  ControlledAccessException
Generates a license challenge suitable for requesting the supplied permissions for the supplied file. This call will never return null.

Parameters:
contentURL - A URL pointing to the content that rights are going to be requested for. If null or an invalid URL is supplied or the content can not be read, a DRMException will be thrown.
permissions - The permissions the rights that are requested should provide for. An array with at least one permission must be supplied, if it is not or if any of the supplied permissions are not recognized then a DRMException will be thrown.
Returns:
The byte data of the generated challenge string.
Throws:
DRMException - If there is an error with the supplied arguments, or an error occurs while creating the license challenge.
ControlledAccessException - If the calling code does not have permission to access the DRMManager.
See Also:
DRMManager.PERMISSION_DISPLAY, DRMManager.PERMISSION_EXECUTE, DRMManager.PERMISSION_PLAY, DRMManager.PERMISSION_PRINT
Since:
BlackBerry API 4.7.0

installRights

public void installRights(String contentURL,
                          byte[] rightsData,
                          DRMRightsInstallCallback callback)
                   throws DRMException,
                          ControlledAccessException
Installs the rights contained in the supplied rights data for the supplied file. This is an asynchronous call, when rights installation is completed either successfully or with failure, the supplied callback will be notified.

Parameters:
contentURL - A URL pointing to the content that rights are going to be installed for. If null or an invalid URL is supplied or the content can not be read, a DRMException will be thrown.
rightsData - The byte data of the rights object to be installed. If null or the supplied rights data can not be understood then a DRMException will be thrown.
callback - The callback to notify when the rights installation completes. A valid callback must be supplied or a DRMException will be thrown.
Throws:
DRMException - If an error occurs while installing the rights.
ControlledAccessException - If the calling code does not have permission to access the DRMManager.
Since:
BlackBerry API 4.7.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal