A P P E N D I X  A

Migration Classes and Interfaces

This appendix describes the class Conf and interfaces that are specific to migrating DRM and content pricing information.

This following class and interfaces are defined:


A.1 Conf Class

The configuration object used in migration. The interface of this object is not open. It can be used to get access to some configuration objects that can be leveraged by the custom implementations. Contact support for more information on this object.

A.1.1 Methods

Conf inherits the following methods from java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait.


A.2 ContentData Interface

Implementations of this interface are used to provide information about a content item.

A.2.1 CS_DELETED

static final long CS_DELETED

Content has been marked as deleted by the Catalog Manager administrator. This content can no longer be used.

A.2.2 CS_DENIED

static final long CS_DENIED

Content has been marked as denied by the Catalog Manager administrator. A reason should have been provided to the developer. Developer should correct problems with the content and switch it to the NEW state.

A.2.3 CS_PENDING

static final long CS_PENDING

Content has been marked as pending by the Catalog Manager administrator. The content has probaby not passed all of the required reviews.

A.2.4 CS_NEW

static final long CS_NEW

Content is marked as new. Content is most likely a recent submission by a developer and has not been reviewed by the Catalog Manager administrator.

A.2.5 CS_PUBLISHED

static final long CS_PUBLISHED

Content is published by the Catalog Manager administrator. This content is available to Vending Managers and can be stocked.

A.2.6 CS_TESTING

static final long CS_TESTING

Content is undergoing live testing. Testing content can be stocked by the Vending Manager administrator but is only available to test subscribers.

A.2.7 getClassId

long getClassId()

Returns the class ID. Value of RESOURCE_CLASS.RESOURCE_CLASS_ID field.

A.2.8 getContentTypeId

long getContentTypeId()

Returns the content type ID for this content. Value of RESOURCE_CLASS.CONTENT_TYPE_ID field.

A.2.9 getDeveloperId

long getDeveloperId()

Returns the developer ID of the developer account used to submit the content. Value of RESOURCE_CLASS.DEVELOPER_ID.

A.2.10 getDeveloperContentId

java.lang.String getDeveloperContentId()

Returns the developer content ID. This is an abstract value that is assigned to the content by a developer and might not be set. If not set, null is returned.

A.2.11 getStatusId

long getStatusId()

Returns the status ID of this content. Value of the RESOURCE_CLASS.RESOURCE_CONTENT_STATUS field. Status can be one of the following values: CS_DELETED, CS_DENIED, CS_PENDING, CS_NEW, CS_PUBLISHED, or CS_TESTING.

A.2.12 getInfoUrl

java.lang.String getInfoUrl()

Returns the informational URL for the content. This is an abstract value provided by the developer and can be omitted. If no value is specified, null is returned.


A.3 ContentTypeMapper Interface

Implementations of this interface can be supplied to migration, therefore, content being processed can have its content type changed during the migration. The implementation class must have a public no argument constructor, which is used to instantiate it.

A.3.1 init

void init(Conf config)

Request the content type mapper implementation to initialize. Migration calls this method before it starts processing the content items. The method initializes the implementation so it is ready to receive mapContent(ContentData) calls.

init has the parameter config, a migration configuration object. This object is not a part of the public API, but the available methods list can be obtained by contacting customer support.

init throws java.lang.Exception. This method can throw any exception that is processed by the migration code, effectively stopping the migration.

A.3.2 mapContent

long mapContent(ContentData data)

Returns a new content type for the specified content item. The incoming data object has most of the information about the RESOURCE_CLASS database object being processed. If the implementation chooses not to modify the content type of the content, it simply returns ContentData.getContentTypeId().

mapContent has the parameter data, a data object representing a content item being processed. mapContent returns a new content type id.

mapContent throws: java.lang.Exception. This method can throw any exception that is processed by the migration code, effectively stopping the migration.


A.4 PriceData Interface

Implementations of this interface are used to provide information about a price.

A.4.1 getModelName

java.lang.String getModelName()

Returns one of the following pricing model names:

The pricing model defines what arguments are available for this object. getModelName returns a pricing model name.

A.4.2 getArgumentNames

java.lang.String[] getArgumentNames()

Returns the list of available arguments. Arguments define the price and usage terms for these pricing models. Every pricing model has a list of arguments that it supports. Overall, the following arguments are defined:

The value of the arguments also depend on the pricing model. If two pricing models have the same argument defined, the argument's value can mean different things in respect to the specific pricing term it defines. An empty array can be returned from this method.

getArgumentNames returns an array of known arguments for this pricing model.

A.4.3 getArgument

java.lang.Object getArgument(java.lang.String name)

Returns the argument value. The name must be one of the values in the array returned from the getArgumentNames() method.

getArgument has the parameter name, an argument name. getArgument returns an argument value.

A.4.4 getAllowedTrialAttempts

int getAllowedTrialAttempts()

Returns the number of trial attempts allowed for this price and usage terms. Trial attempts are also be implemented through a separate pricing model. Use this convenience method to enable packing all content prices into a single class.

getAllowedTrialAttempts returns the number of trial attempts allowed for this price and usage terms.


A.5 PricingOptionData Interface

Implementations of this interface are used to provide information about a pricing option.

A.5.1 getName

java.lang.String getName()

Returns the name of this pricing option. The name of an option is an abstract value. No two pricing options can have the same name.

getName returns a pricing option name.

A.5.2 getExternalName

java.lang.String getExternalName()

Returns the external name of this pricing option. The external name of an option is an abstract value. No two pricing options can have the same external name.

getExternalName returns a pricing option name.

A.5.3 getDescription

java.lang.String getDescription()

Returns the description of this pricing option. This is an abstract value.

getDescription returns a pricing option description.

A.5.4 getContentTypeName

java.lang.String getContentTypeName()

Returns the name of the content type with which this option is associated. Only content in this content type can be priced with this pricing option.

getContentTypeName returns a pricing option content type name.

A.5.5 getDRMName

java.lang.String getDRMName()

Returns the name of the DRM Agent that is used with this pricing option. The DRM Agent name is assigned to a pricing option when it is created, and the preferred DRM agent for the content type with this pricing option is used.

getDRMName returns a pricing option DRM name.


A.6 PricingOptionSticker Interface

Implementations of this interface can be supplied to migration, allowing content to be assigned to pricing options and pricing models to be selected for zero price content on a per content item basis. The implementation of this interface must be a public class and have a public no argument constructor that is used to instantiate this class.

A.6.1 PRICE_TYPE_SUGGESTED

static final int PRICE_TYPE_SUGGESTED

Indicates that the pricing type for the operation is developer price assigned by the developer.

A.6.2 PRICE_TYPE_CATALOG

static final int PRICE_TYPE_CATALOG

Indicates that the pricing type for the operation is catalog price, assigned by a Catalog Manager administrator.

A.6.3 PRICE_TYPE_RETAIL

static final int PRICE_TYPE_RETAIL

Indicates that the pricing type for the operation is retail price, assigned by a Vending Manager administrator.

A.6.4 CHOICE_USE_CUSTOM

static final int CHOICE_USE_CUSTOM

Returns a special value that indicates the migration code should price this content and price type with a custom price.

A.6.5 CHOICE_USE_SELECTED

static final int CHOICE_USE_SELECTED

Returns a special value that indicates the migration code should price this content with the selected pricing option.

A.6.6 USE_ALWAYS_FREE

static final int USE_ALWAYS_FREE

Returns a special value that indicates the content should be priced with the Free pricing model.

A.6.7 USE_DOWNLOAD_FREE

static final int USE_ALWAYS_FREE

Returns a special value that indicates the content should be priced with the First Download or Every Download pricing model.

A.6.8 USE_SUBSCRIPTION_FREE

static final int USE_SUBSCRIPTION_FREE

Returns a special value that indicates the content should be priced with the Subscription pricing model.

A.6.9 USE_USAGE_FREE

static final int USE_USAGE_FREE

Returns a special value that indicates the content should be priced with the Usage pricing model.

A.6.10 init

void init(Conf config)

Requests the initialization of the pricing option sticker implementation. Migration calls this method before it starts processing content items. The method initializes the implementation to prepare for the choosePricingOption(ContentData, PriceData, PricingOptionData, PricingOptionData[], int) calls.

init has the parameter config, a migration configuration object. This object is not a part of the public API, but the available methods list can be obtained by contacting customer support.

init throws java.lang.Exception. This method can throw any exception that is processed by the migration code, effectively stopping the migration.

A.6.11 choosePricingOption

int choosePricingOption(ContentData content,                         PriceData price, PricingOptionData selected, PricingOptionData[] available, int priceType)

Requests this implementation to assign a pricing option or to indicate that the content has either a custom price or an automatically selected pricing option assigned to it. For all content items in the system, this method is called twice during migration of the Catalog Manager. This method is called once during migration of the Vending Manager per every content item. The suggested price (specified by the developer), and the catalog price (specified by the Catalog Manager administrator), are assigned during the Catalog Manager migration. The retail price (assigned by the Vending Manager administrator) is assigned during the Vending Manager migration. If during content item processing it is determined that there are no pricing options that can be applied to the content because of its content type, this method is be called. The input parameters for the Vending Manager migration are a slightly different from the Catalog Manager migration. For the Vending Manager, the selected parameter means that the pricing option selected by the Catalog Manager migration for the catalog price. The implementation might use custom pricing, but it should not return a reference to a pricing option other than the one selected. For the Vending Manager, only content that has a pricing option selected by the Catalog Manager migration triggers the execution of this method.

init has the parameter config, a migration configuration object. This object is not a part of the public API, but the available methods list can be obtained by contacting customer support.

choosePricingOption has the following parameters:

choosePricingOption returns the following:

choosePricingOption throws java.lang.Exception. This method can throw any exception that is processed by the migration code, effectively stopping the migration.

A.6.12 selectFreePrice

int selectFreePrice(ContentData content, int priceType)

Selects a pricing model that is used if a source price has a zero value. This method is only called during the catalog read step. Only content that has a zero price value or if no pricing model is selected for it during migration is passed to this method.

selectFreePrice has the following parameters:

selectFreePrice returns code that indicate which pricing model is used. One of USE_ALWAYS_FREE, USE_DOWNLOAD_FREE, USE_SUBSCRIPTION_FREE or USE_USAGE_FREE is expected. The actual price always remain zero regardless of the pricing model selected.

selectFreePrice throws java.lang.Exception. This method can throw any exception that is processed by the migration code, effectively stopping the migration.