atg.commerce.order
Class CommerceItemImpl

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.commerce.order.CommerceItemImpl
All Implemented Interfaces:
ChangedProperties, CommerceIdentifier, CommerceItem, PaymentGroupRelationshipContainer, ShippingGroupRelationshipContainer, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
B2BCommerceItemImpl, ConfigurableCommerceItem, SubSkuCommerceItem

public class CommerceItemImpl
extends CommerceIdentifierImpl
implements CommerceItem, ChangedProperties

An implementation of a class which represents a CommerceItem. This class implements all the methods to manipulate a CommerceItem object.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  AuxiliaryData mAuxiliaryData
           
 
Constructor Summary
CommerceItemImpl()
           
 
Method Summary
 void addChangedProperty(java.lang.String pPropertyName)
          Adds a changedProperty
 void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship)
          Add the PaymentGroupRelationship to the container.
 void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship, int pIndex)
          Add the PaymentGroupRelationship to the container at the given index.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
          Add the ShippingGroupRelationship to the container.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship, int pIndex)
          Add the ShippingGroupRelationship to the container at the given index.
 void clearChangedProperties()
          Clears the changedProperties List
protected  void createAuxiliaryData()
          creates an AuxiliaryData object which is to be used with this CommerceItem.
 AuxiliaryData getAuxiliaryData()
          returns the AuxiliaryData.
 java.lang.String getCatalogId()
          Returns the catalogId
 java.lang.String getCatalogKey()
          Returns the catalogKey
 java.lang.String getCatalogRefId()
          Returns the catalogRefId
 java.util.Set getChangedProperties()
          Returns the changedProperties
 java.lang.String getCommerceItemClassType()
          Returns the commerceItemClassType
 PaymentGroupRelationship getPaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
          Returns the PaymentGroupRelationship whose id is pPaymentGroupRelationshipId.
 int getPaymentGroupRelationshipCount()
          Returns the number of PaymentGroupRelationships in the container.
 java.util.List getPaymentGroupRelationships()
          Returns a List of PaymentGroupRelationships
 ItemPriceInfo getPriceInfo()
          returns the CommerceItemPriceInfo object.
 MutableRepositoryItem getPriceInfoRepositoryItem()
          Returns the priceInfoRepositoryItem
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns a property value
 long getQuantity()
          returns the number of CommerceItems which this CommerceItem object represents.
 MutableRepositoryItem getRepositoryItem()
          Returns the repositoryItem
 long getReturnedQuantity()
          Returns the returnedQuantity
 boolean getSaveAllProperties()
          Returns the saveAllProperties
 ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId.
 ShippingGroupRelationshipContainerImpl getShippingGroupRelationshipContainer()
          returns the ShippingGroupRelationshipContainer
 int getShippingGroupRelationshipCount()
          Returns the number of ShippingGroupRelationships in the container.
 java.util.List getShippingGroupRelationships()
          Returns a List of ShippingGroupRelationships
 int getState()
          returns the CommerceItem state.
 java.lang.String getStateAsString()
          returns the CommerceItem state as a String.
 java.lang.String getStateAsUserResource()
          returns the CommerceItem state as a user resource
 java.lang.String getStateDetail()
          returns the CommerceItem state details.
 boolean isChanged()
          Returns the isChanged flag
 void removeAllPaymentGroupRelationships()
          Removes all the PaymentGroupRelationships
 void removeAllShippingGroupRelationships()
          Removes all the ShippingGroupRelationships
 PaymentGroupRelationship removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
          Removes a PaymentGroupRelationship whose id is passed in.
 ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Removes a ShippingGroupRelationship whose id is passed in.
 void setCatalogId(java.lang.String pCatalogId)
          Sets the catalogId
 void setCatalogKey(java.lang.String pCatalogKey)
          Sets the catalogKey
 void setCatalogRefId(java.lang.String pCatalogRefId)
          Sets the catalogRefId
 void setChanged(boolean pChanged)
          Marks this object as changed
 void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
          Sets the commerceItemClassType
 void setPriceInfo(ItemPriceInfo pPriceInfo)
          sets the ItemPriceInfo object.
 void setPriceInfoRepositoryItem(MutableRepositoryItem pPriceInfoRepositoryItem)
          Sets the priceInfoRepositoryItem
 void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
          Sets a property value
 void setQuantity(long pQuantity)
          sets the number of CommerceItems which this CommerceItem object represents.
 void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
          Sets the repositoryItem
 void setSaveAllProperties(boolean pSaveAllProperties)
          Sets the saveAllProperties
 void setState(int pState)
          sets the CommerceItem state.
 void setStateAsString(java.lang.String pState)
          sets the CommerceItem state using a String
 void setStateDetail(java.lang.String pStateDetail)
          sets the CommerceItem state details.
 java.lang.String toString()
          Method that renders the general information in a readable string format
 void update(java.util.Observable o, java.lang.Object arg)
          This method is called whenever a property in a contained object changes and the containing object needs to be notified.
 
Methods inherited from class atg.commerce.order.CommerceIdentifierImpl
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface atg.commerce.order.CommerceIdentifier
getId
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mAuxiliaryData

protected AuxiliaryData mAuxiliaryData
Constructor Detail

CommerceItemImpl

public CommerceItemImpl()
Method Detail

getCommerceItemClassType

public java.lang.String getCommerceItemClassType()
Returns the commerceItemClassType

Specified by:
getCommerceItemClassType in interface CommerceItem

setCommerceItemClassType

public void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
Sets the commerceItemClassType

Specified by:
setCommerceItemClassType in interface CommerceItem

getCatalogId

public java.lang.String getCatalogId()
Returns the catalogId

Specified by:
getCatalogId in interface CommerceItem

setCatalogId

public void setCatalogId(java.lang.String pCatalogId)
Sets the catalogId

Specified by:
setCatalogId in interface CommerceItem

getCatalogRefId

public java.lang.String getCatalogRefId()
Returns the catalogRefId

Specified by:
getCatalogRefId in interface CommerceItem

setCatalogRefId

public void setCatalogRefId(java.lang.String pCatalogRefId)
Sets the catalogRefId

Specified by:
setCatalogRefId in interface CommerceItem

getCatalogKey

public java.lang.String getCatalogKey()
Returns the catalogKey

Specified by:
getCatalogKey in interface CommerceItem

setCatalogKey

public void setCatalogKey(java.lang.String pCatalogKey)
Sets the catalogKey

Specified by:
setCatalogKey in interface CommerceItem

getQuantity

public long getQuantity()
returns the number of CommerceItems which this CommerceItem object represents.

Specified by:
getQuantity in interface CommerceItem

setQuantity

public void setQuantity(long pQuantity)
sets the number of CommerceItems which this CommerceItem object represents.

Specified by:
setQuantity in interface CommerceItem
Parameters:
pQuantity - the new value for the quantity

getReturnedQuantity

public long getReturnedQuantity()
Returns the returnedQuantity

Specified by:
getReturnedQuantity in interface CommerceItem

getShippingGroupRelationshipContainer

public ShippingGroupRelationshipContainerImpl getShippingGroupRelationshipContainer()
returns the ShippingGroupRelationshipContainer


getState

public int getState()
returns the CommerceItem state.

Specified by:
getState in interface CommerceItem

setState

public void setState(int pState)
sets the CommerceItem state.

Specified by:
setState in interface CommerceItem
Parameters:
pState - the state to set

getStateAsString

public java.lang.String getStateAsString()
returns the CommerceItem state as a String.


setStateAsString

public void setStateAsString(java.lang.String pState)
sets the CommerceItem state using a String

Parameters:
pState - the state to set

getStateAsUserResource

public java.lang.String getStateAsUserResource()
returns the CommerceItem state as a user resource


getStateDetail

public java.lang.String getStateDetail()
returns the CommerceItem state details.

Specified by:
getStateDetail in interface CommerceItem

setStateDetail

public void setStateDetail(java.lang.String pStateDetail)
sets the CommerceItem state details.

Specified by:
setStateDetail in interface CommerceItem
Parameters:
pStateDetail - the stateDetail to set

getPriceInfo

public ItemPriceInfo getPriceInfo()
returns the CommerceItemPriceInfo object.

Specified by:
getPriceInfo in interface CommerceItem

setPriceInfo

public void setPriceInfo(ItemPriceInfo pPriceInfo)
sets the ItemPriceInfo object.

Specified by:
setPriceInfo in interface CommerceItem
Parameters:
pPriceInfo - the PriceInfo object to set

getPriceInfoRepositoryItem

public MutableRepositoryItem getPriceInfoRepositoryItem()
Returns the priceInfoRepositoryItem


setPriceInfoRepositoryItem

public void setPriceInfoRepositoryItem(MutableRepositoryItem pPriceInfoRepositoryItem)
Sets the priceInfoRepositoryItem


getAuxiliaryData

public AuxiliaryData getAuxiliaryData()
returns the AuxiliaryData.

Specified by:
getAuxiliaryData in interface CommerceItem

createAuxiliaryData

protected void createAuxiliaryData()
creates an AuxiliaryData object which is to be used with this CommerceItem. This method is called by the constructor and is provided so that subclasses can override it to create a specific instance. After the initial call of this method, any subsequent calls will do nothing.


getShippingGroupRelationships

public java.util.List getShippingGroupRelationships()
Returns a List of ShippingGroupRelationships

Specified by:
getShippingGroupRelationships in interface ShippingGroupRelationshipContainer

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship,
                                         int pIndex)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container at the given index. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeShippingGroupRelationship

public ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                          throws RelationshipNotFoundException,
                                                                 InvalidParameterException
Removes a ShippingGroupRelationship whose id is passed in. If the ShippingGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed ShippingGroupRelationship is returned.

Specified by:
removeShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllShippingGroupRelationships

public void removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships

Specified by:
removeAllShippingGroupRelationships in interface ShippingGroupRelationshipContainer

getShippingGroupRelationship

public ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                       throws RelationshipNotFoundException,
                                                              InvalidParameterException
Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId. If theShippingGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getShippingGroupRelationshipCount

public int getShippingGroupRelationshipCount()
Returns the number of ShippingGroupRelationships in the container.

Specified by:
getShippingGroupRelationshipCount in interface ShippingGroupRelationshipContainer

getPaymentGroupRelationships

public java.util.List getPaymentGroupRelationships()
Returns a List of PaymentGroupRelationships

Specified by:
getPaymentGroupRelationships in interface PaymentGroupRelationshipContainer

addPaymentGroupRelationship

public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the PaymentGroupRelationship to the container. If the PaymentGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addPaymentGroupRelationship

public void addPaymentGroupRelationship(PaymentGroupRelationship pPaymentGroupRelationship,
                                        int pIndex)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the PaymentGroupRelationship to the container at the given index. If the PaymentGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removePaymentGroupRelationship

public PaymentGroupRelationship removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
                                                        throws RelationshipNotFoundException,
                                                               InvalidParameterException
Removes a PaymentGroupRelationship whose id is passed in. If the PaymentGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed PaymentGroupRelationship is returned.

Specified by:
removePaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllPaymentGroupRelationships

public void removeAllPaymentGroupRelationships()
Removes all the PaymentGroupRelationships

Specified by:
removeAllPaymentGroupRelationships in interface PaymentGroupRelationshipContainer

getPaymentGroupRelationship

public PaymentGroupRelationship getPaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
                                                     throws RelationshipNotFoundException,
                                                            InvalidParameterException
Returns the PaymentGroupRelationship whose id is pPaymentGroupRelationshipId. If thePaymentGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getPaymentGroupRelationship in interface PaymentGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getPaymentGroupRelationshipCount

public int getPaymentGroupRelationshipCount()
Returns the number of PaymentGroupRelationships in the container.

Specified by:
getPaymentGroupRelationshipCount in interface PaymentGroupRelationshipContainer

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
This method is called whenever a property in a contained object changes and the containing object needs to be notified.

Specified by:
update in interface java.util.Observer
Parameters:
o - the object which changed
arg - the name of the property which changed

getSaveAllProperties

public boolean getSaveAllProperties()
Returns the saveAllProperties

Specified by:
getSaveAllProperties in interface ChangedProperties

setSaveAllProperties

public void setSaveAllProperties(boolean pSaveAllProperties)
Sets the saveAllProperties

Specified by:
setSaveAllProperties in interface ChangedProperties

isChanged

public boolean isChanged()
Returns the isChanged flag

Specified by:
isChanged in interface ChangedProperties

setChanged

public void setChanged(boolean pChanged)
Marks this object as changed

Specified by:
setChanged in interface ChangedProperties

getChangedProperties

public java.util.Set getChangedProperties()
Returns the changedProperties

Specified by:
getChangedProperties in interface ChangedProperties

addChangedProperty

public void addChangedProperty(java.lang.String pPropertyName)
Adds a changedProperty

Specified by:
addChangedProperty in interface ChangedProperties

clearChangedProperties

public void clearChangedProperties()
Clears the changedProperties List

Specified by:
clearChangedProperties in interface ChangedProperties

getRepositoryItem

public MutableRepositoryItem getRepositoryItem()
Returns the repositoryItem

Specified by:
getRepositoryItem in interface ChangedProperties

setRepositoryItem

public void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
Sets the repositoryItem

Specified by:
setRepositoryItem in interface ChangedProperties

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
Returns a property value

Specified by:
getPropertyValue in interface ChangedProperties
Returns:
returns a property value

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.lang.Object pPropertyValue)
Sets a property value

Specified by:
setPropertyValue in interface ChangedProperties
Parameters:
pPropertyValue - the value to set for the given property value

toString

public java.lang.String toString()
Method that renders the general information in a readable string format

Overrides:
toString in class java.lang.Object