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:
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.
Conf inherits the following methods from java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait.
Implementations of this interface are used to provide information about a content item.
static final long CS_DELETED
Content has been marked as deleted by the Catalog Manager administrator. This content can no longer be used.
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.
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.
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.
static final long CS_PUBLISHED
Content is published by the Catalog Manager administrator. This content is available to Vending Managers and can be stocked.
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.
long getClassId()
Returns the class ID. Value of RESOURCE_CLASS.RESOURCE_CLASS_ID field.
long getContentTypeId()
Returns the content type ID for this content. Value of RESOURCE_CLASS.CONTENT_TYPE_ID field.
long getDeveloperId()
Returns the developer ID of the developer account used to submit the content. Value of RESOURCE_CLASS.DEVELOPER_ID.
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.
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.
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.
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.
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.
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.
Implementations of this interface are used to provide information about a price.
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.
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.
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.
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.
Implementations of this interface are used to provide information about a pricing option.
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.
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.
java.lang.String getDescription()
Returns the description of this pricing option. This is an abstract value.
getDescription returns a pricing option description.
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.
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.
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.
static final int PRICE_TYPE_SUGGESTED
Indicates that the pricing type for the operation is developer price assigned by the developer.
static final int PRICE_TYPE_CATALOG
Indicates that the pricing type for the operation is catalog price, assigned by a Catalog Manager administrator.
static final int PRICE_TYPE_RETAIL
Indicates that the pricing type for the operation is retail price, assigned by a Vending Manager administrator.
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.
static final int CHOICE_USE_SELECTED
Returns a special value that indicates the migration code should price this content with the selected pricing option.
static final int USE_ALWAYS_FREE
Returns a special value that indicates the content should be priced with the Free pricing model.
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.
static final int USE_SUBSCRIPTION_FREE
Returns a special value that indicates the content should be priced with the Subscription pricing model.
static final int USE_USAGE_FREE
Returns a special value that indicates the content should be priced with the Usage pricing model.
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.
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.
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.
Copyright © 2005, Sun Microsystems, Inc. All Rights Reserved.