|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.dtt.ca.ppv.Product
public abstract class Product
Abstract class representing content that can be purchased through the CA system. It is the common base class for packages of events, single PPV events, and subscription services. Where methods take an array as an input parameter, implementations should take a copy of the array. Where methods return an array, a copy should be returned and modifications to the array should be ignored by the implementation until or unless the array is passed back to the implementation as a parameter to a method call.
Field Summary | |
---|---|
static int |
GENERIC_PRODUCT
|
static int |
PPT_EVENT
|
static int |
PPV_EVENT
|
static int |
PPV_PACKAGE
|
static int |
SUBSCRIPTION
|
Constructor Summary | |
---|---|
protected |
Product(java.lang.String id,
java.lang.String name,
CAPrivateData privateData)
Called by derived classes to create a product. |
protected |
Product(java.lang.String id,
java.lang.String name,
CAPrivateData data,
java.lang.String[] description,
java.lang.String[] extendedDescription,
java.util.Date pwStartTime,
java.util.Date pwEndTime,
Money price,
Duration preview)
Called by derived classes to create a product. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Check if two products have the same CAS ID, meaning they are the same exact product |
Product[] |
getContainedProducts()
Get other products contained in this product. |
java.lang.String[] |
getDescription()
Returns the product description. |
java.lang.String[] |
getExtendedDescription()
Returns the product extended description (e.g. conditions of purchase). |
java.lang.String |
getId()
Returns a CAS dependent ID for the specific product. |
java.lang.String |
getName()
Returns the product name. |
Duration |
getPreviewTime()
Get the total preview time for this product. |
Money |
getPrice()
Get the price of the product. |
CAPrivateData |
getPrivateData()
Returns Private data for the specific product. |
java.util.Date |
getPurchaseWindowEndTime()
Get the ending time of the purchase window for this product. |
java.util.Date |
getPurchaseWindowStartTime()
Get the starting time of the purchase window for this product. |
abstract int |
getType()
Returns the product type |
int |
hashCode()
Returns hash code for the given instance. |
abstract boolean |
isFree()
Check if the product is freely viewable. |
protected void |
setDescription(java.lang.String[] description)
Deprecated. no replacement Set the product description. |
protected void |
setExtendedDescription(java.lang.String[] extendedDescription)
Deprecated. no replacement Set the extended description of this Product. |
protected void |
setPreviewTime(Duration previewTime)
Deprecated. no replacement Set the total preview time for this product. |
protected void |
setPrivateData(CAPrivateData privateData)
Deprecated. no replacement Sets the Private Data for this event. |
protected void |
setPurchaseWindowEndTime(java.util.Date purchaseWindowEndTime)
Deprecated. no replacement Set the ending time of the purchase window for this product. |
protected void |
setPurchaseWindowStartTime(java.util.Date purchaseWindowStartTime)
Deprecated. no replacement Set the starting time of the purchase window for this product. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int GENERIC_PRODUCT
public static final int PPV_EVENT
public static final int PPT_EVENT
public static final int SUBSCRIPTION
public static final int PPV_PACKAGE
Constructor Detail |
---|
protected Product(java.lang.String id, java.lang.String name, CAPrivateData data, java.lang.String[] description, java.lang.String[] extendedDescription, java.util.Date pwStartTime, java.util.Date pwEndTime, Money price, Duration preview)
id
- the product id.name
- the product name.data
- the private data associated with this product.description
- the description for this product.extendedDescription
- the extended description for this product.pwStartTime
- the time the purchase window starts.pwEndTime
- the time the purchase window ends.price
- the price to purchase this product.preview
- the preview time for this product.protected Product(java.lang.String id, java.lang.String name, CAPrivateData privateData)
id
- the product id.name
- the product name.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object that is compared with current one
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getId()
public CAPrivateData getPrivateData()
protected void setPrivateData(CAPrivateData privateData)
public abstract int getType()
GENERIC_PRODUCT
,
PPV_EVENT
,
SUBSCRIPTION
,
PPV_PACKAGE
public java.lang.String getName()
public java.lang.String[] getDescription() throws FieldNotPresentException
FieldNotPresentException
- if the description is not available.protected void setDescription(java.lang.String[] description)
description
- The description to set.public java.lang.String[] getExtendedDescription() throws FieldNotPresentException
FieldNotPresentException
- if the field is not storedprotected void setExtendedDescription(java.lang.String[] extendedDescription)
extendedDescription
- The extendedDescription to set.public java.util.Date getPurchaseWindowStartTime() throws FieldNotPresentException
FieldNotPresentException
- if the field is not stored.protected void setPurchaseWindowStartTime(java.util.Date purchaseWindowStartTime)
purchaseWindowStartTime
- The purchaseWindowStartTime to set.public java.util.Date getPurchaseWindowEndTime() throws FieldNotPresentException
FieldNotPresentException
- if the field is not storedprotected void setPurchaseWindowEndTime(java.util.Date purchaseWindowEndTime)
purchaseWindowEndTime
- The purchaseWindowEndTime to set.public Product[] getContainedProducts()
i.e. We may offer the end-user the chance to buy the directors commentary for a movie.
Or in the case of a PPV Package it will contain all the products in the PPV Package.
public Money getPrice() throws FieldNotPresentException
FieldNotPresentException
- if the field is not storedpublic abstract boolean isFree() throws FieldNotPresentException
FieldNotPresentException
- if the field is not storedpublic Duration getPreviewTime() throws FieldNotPresentException
FieldNotPresentException
- if the preview time is not available.protected void setPreviewTime(Duration previewTime)
previewTime
- The previewTime to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |