Oracle Application Server Wireless Java API Reference
B14043-01


oracle.wireless.me.server.tools.drm
Class DrmManager

java.lang.Object
  extended byoracle.wireless.me.server.tools.drm.DrmManager


public class DrmManager
extends java.lang.Object

DrmManager is a utility class to manage DRM policy repository. It allows provisioning server administrator to add, modify,remove DRM policy object.


Field Summary
static java.lang.String DEFAULT_PACKAGER
Default package class name
static java.lang.String DRM_APP_NAME
Key for Application name
static java.lang.String DRM_CLASS_MIME_TYPE
Java Class mimte type.
static java.lang.String DRM_ODRL_MIME_TYPE
ODRL DRM mime type
static java.lang.String DRM_PROPERTIES_MIME_TYPE
Properties DRM mime type
static java.lang.String DRM_SUPPORTED_MIME_TYPES_MIME_TYPE
DRM supported mime types
static java.lang.String ENCODING
Default encoding

Constructor Summary
DrmManager()

Method Summary
DRMPolicy createBuiltinDRMPolicyPreviewByCount(java.lang.String name, java.lang.String description, int count)
Add a new DRMPolicy Objects to the repository using the buildin Preview by count policy
DRMPolicy createBuiltinDRMPolicyPreviewByInterval(java.lang.String name, java.lang.String description, java.lang.String interval)
Add a new DRMPolicy Objects to the repository using the buildin Preview by count policy
DRMPolicy createDRMPolicy(java.lang.String name, java.lang.String description, org.w3c.dom.Document odrlDocument, java.lang.String drmPackagerClassName, java.util.Properties prop)
Add a new Digital Rights Policy Objects to the repository
DRMPolicy[] getAllDRMPolicies()
Get all the Digital Rights Policy Objects from repository
static byte[] getByteArray(org.w3c.dom.Document doc)
Returns the encoded byte array for specifed properties
static byte[] getByteArray(java.util.Properties prop)
Returns the encoded byte array for specifed properties
java.lang.String getDefaultPackagerClass()
Returns the default packager class name
java.util.Properties getDefaultPackagerProperties()
Used to display the default init properties and values used by the default packager impl which Wireless provides out of the box
static org.w3c.dom.Document getDocument(byte[] data)
Returns the XML document from the specified byte array
static DrmManager getInstance()
get an instance of DrmManager
static org.w3c.dom.Document getODRLforJ2MEContentCountConstraint(int count)
Helper method to create an ODRL document for J2ME content with count constraint on execute permission
static org.w3c.dom.Document getODRLforJ2MEContentIntervalConstraint(java.lang.String interval)
Helper method to create an ODRL document for J2ME content with interval constraint on execute permission
static java.util.Properties getProperties(byte[] data)
Returns the Properties from the specified byte array
static java.lang.String getTimeInPnYnMnDTnHnMnSFormat(long years, long months, long days, long hours, long minutes, long seconds)
Returns time in time on PnYnMnDTnHnMnS format
boolean isUsedByContent(DRMPolicy policy)
Checks if any content is currently using the policy this check must be done before deleting the policy
DRMPolicy lookupDRMPolicy(DeliverableContent content)
returns the policy for the specified content
DRMPolicy lookupDRMPolicy(long id)
returns the policy for the specified id
DRMPolicy lookupDRMPolicy(java.lang.String name)
returns the policy for the specified policy name
void removeDRMPolicy(long id)
Remove a Digital Rights Policy Objects from the repository
void setDRMPolicy(DeliverableContent content, DRMPolicy policy)
Set the content's DRM policy

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_PACKAGER

public static final java.lang.String DEFAULT_PACKAGER
Default package class name
See Also:
Constant Field Values

DRM_APP_NAME

public static final java.lang.String DRM_APP_NAME
Key for Application name
See Also:
Constant Field Values

DRM_CLASS_MIME_TYPE

public static final java.lang.String DRM_CLASS_MIME_TYPE
Java Class mimte type.
See Also:
Constant Field Values

DRM_ODRL_MIME_TYPE

public static final java.lang.String DRM_ODRL_MIME_TYPE
ODRL DRM mime type
See Also:
Constant Field Values

DRM_PROPERTIES_MIME_TYPE

public static final java.lang.String DRM_PROPERTIES_MIME_TYPE
Properties DRM mime type
See Also:
Constant Field Values

DRM_SUPPORTED_MIME_TYPES_MIME_TYPE

public static final java.lang.String DRM_SUPPORTED_MIME_TYPES_MIME_TYPE
DRM supported mime types
See Also:
Constant Field Values

ENCODING

public static final java.lang.String ENCODING
Default encoding
See Also:
Constant Field Values

Constructor Detail

DrmManager

public DrmManager()

Method Detail

createBuiltinDRMPolicyPreviewByCount

public DRMPolicy createBuiltinDRMPolicyPreviewByCount(java.lang.String name,
                                                      java.lang.String description,
                                                      int count)
                                               throws java.lang.Exception
Add a new DRMPolicy Objects to the repository using the buildin Preview by count policy
Parameters:
name - String the name of the policy
description - String the description of the policy
count - the number of times the user can run this content
Returns:
DRMPolicy
Throws:
java.lang.Exception

createBuiltinDRMPolicyPreviewByInterval

public DRMPolicy createBuiltinDRMPolicyPreviewByInterval(java.lang.String name,
                                                         java.lang.String description,
                                                         java.lang.String interval)
                                                  throws java.lang.Exception
Add a new DRMPolicy Objects to the repository using the buildin Preview by count policy
Parameters:
name - String the name of the policy
description - String the description of the policy
interval - the number of seconds the user can run this content
Returns:
DRMPolicy
Throws:
java.lang.Exception

createDRMPolicy

public DRMPolicy createDRMPolicy(java.lang.String name,
                                 java.lang.String description,
                                 org.w3c.dom.Document odrlDocument,
                                 java.lang.String drmPackagerClassName,
                                 java.util.Properties prop)
                          throws PanamaException
Add a new Digital Rights Policy Objects to the repository
Parameters:
name - String the name of the policy
description - String the description of the policy
Returns:
J2meDrmPolicy
Throws:
PanamaException

getAllDRMPolicies

public DRMPolicy[] getAllDRMPolicies()
Get all the Digital Rights Policy Objects from repository
Returns:
DRMPolicy[] an array of DRMPolicy objects

getByteArray

public static byte[] getByteArray(org.w3c.dom.Document doc)
Returns the encoded byte array for specifed properties
Returns:
the byte array for the specifed properties

getByteArray

public static byte[] getByteArray(java.util.Properties prop)
Returns the encoded byte array for specifed properties
Parameters:
prop - the properties
Returns:
the byte array for the specifed properties

getDefaultPackagerClass

public java.lang.String getDefaultPackagerClass()
Returns the default packager class name
Returns:
the default packager class name

getDefaultPackagerProperties

public java.util.Properties getDefaultPackagerProperties()
Used to display the default init properties and values used by the default packager impl which Wireless provides out of the box
Returns:
Properties default init properties of the sample packager impl

getDocument

public static org.w3c.dom.Document getDocument(byte[] data)
                                        throws java.lang.Exception
Returns the XML document from the specified byte array
Parameters:
data - encoded XML document
Returns:
the XML document
Throws:
java.lang.Exception

getInstance

public static DrmManager getInstance()
get an instance of DrmManager

getODRLforJ2MEContentCountConstraint

public static org.w3c.dom.Document getODRLforJ2MEContentCountConstraint(int count)
Helper method to create an ODRL document for J2ME content with count constraint on execute permission

getODRLforJ2MEContentIntervalConstraint

public static org.w3c.dom.Document getODRLforJ2MEContentIntervalConstraint(java.lang.String interval)
Helper method to create an ODRL document for J2ME content with interval constraint on execute permission

getProperties

public static java.util.Properties getProperties(byte[] data)
                                          throws java.io.IOException
Returns the Properties from the specified byte array
Parameters:
data - encoded propertied
Returns:
the Properties object
Throws:
java.io.IOException

getTimeInPnYnMnDTnHnMnSFormat

public static java.lang.String getTimeInPnYnMnDTnHnMnSFormat(long years,
                                                             long months,
                                                             long days,
                                                             long hours,
                                                             long minutes,
                                                             long seconds)
Returns time in time on PnYnMnDTnHnMnS format
Returns:
time in PnYnMnDTnHnMnS format

isUsedByContent

public boolean isUsedByContent(DRMPolicy policy)
                        throws PanamaException
Checks if any content is currently using the policy this check must be done before deleting the policy
Returns:
boolean returns true if there is dependency else false
Throws:
PanamaException

lookupDRMPolicy

public DRMPolicy lookupDRMPolicy(DeliverableContent content)
returns the policy for the specified content
Parameters:
content - the deliverable content
Returns:
the DRM Policy if found, null if the content is null

lookupDRMPolicy

public DRMPolicy lookupDRMPolicy(long id)
returns the policy for the specified id
Parameters:
id - the policy id
Returns:
the DRM Policy if found

lookupDRMPolicy

public DRMPolicy lookupDRMPolicy(java.lang.String name)
returns the policy for the specified policy name
Parameters:
name - policy name
Returns:
the DRM Policy if found

removeDRMPolicy

public void removeDRMPolicy(long id)
                     throws PanamaException
Remove a Digital Rights Policy Objects from the repository
Throws:
PanamaException

setDRMPolicy

public void setDRMPolicy(DeliverableContent content,
                         DRMPolicy policy)
                  throws PanamaException
Set the content's DRM policy
Parameters:
policy - DRMPolicy the DRM policy from the DRM repository
Throws:
PanamaException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.