atg.b2bcommerce.order
Class CostCenterImpl

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.b2bcommerce.order.CostCenterImpl
All Implemented Interfaces:
B2BCommerceItemRelationshipContainer, B2BOrderRelationshipContainer, B2BShippingGroupRelationshipContainer, CostCenter, ChangedProperties, CommerceIdentifier, java.io.Serializable, java.util.Observer

public class CostCenterImpl
extends CommerceIdentifierImpl
implements CostCenter, ChangedProperties

This class is an implementation of a CostCenter. It represents all the information which designates a cost center.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
CostCenterImpl()
           
 
Method Summary
 void addChangedProperty(java.lang.String pPropertyName)
          Adds a changedProperty
 void addCommerceItemRelationship(B2BCommerceItemRelationship pCommerceItemRelationship)
          Add the CommerceItemRelationship to the container.
 void addCommerceItemRelationship(B2BCommerceItemRelationship pCommerceItemRelationship, int pIndex)
          Add the CommerceItemRelationship to the container at the given index.
 void addOrderRelationship(B2BOrderRelationship pOrderRelationship)
          Add the OrderRelationship to the container.
 void addShippingGroupRelationship(B2BShippingGroupRelationship pShippingGroupRelationship)
          Add the ShippingGroupRelationship to the container.
 void addShippingGroupRelationship(B2BShippingGroupRelationship pShippingGroupRelationship, int pIndex)
          Add the ShippingGroupRelationship to the container at the given index.
 void clearChangedProperties()
          Clears the changedProperties List
 double getAmount()
          returns the amount associated with this PaymentGroup.
 java.util.Set getChangedProperties()
          Returns the changedProperties
 B2BCommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId.
 int getCommerceItemRelationshipCount()
          Returns the number of CommerceItemRelationships in the container.
 java.util.List getCommerceItemRelationships()
          Returns a List of CommerceItemRelationships
 java.lang.String getCostCenterClassType()
          Returns the CostCenterClassType
 java.lang.String getDescription()
          Returns the description
 java.lang.String getIdentifier()
          Returns the identifier
 B2BOrderRelationship getOrderRelationship()
          Returns the OrderRelationship.
 int getOrderRelationshipCount()
          Returns the number of OrderRelationships in the container.
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns a property value, if the property is not defined in the underlying item-descriptor null is returned.
 MutableRepositoryItem getRepositoryItem()
          Returns the repositoryItem
 boolean getSaveAllProperties()
          Returns the saveAllProperties
 B2BShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId.
 int getShippingGroupRelationshipCount()
          Returns the number of ShippingGroupRelationships in the container.
 java.util.List getShippingGroupRelationships()
          Returns a List of ShippingGroupRelationships
 boolean isChanged()
          Returns the isChanged flag
 void removeAllCommerceItemRelationships()
          Removes all the CommerceItemRelationships
 void removeAllShippingGroupRelationships()
          Removes all the ShippingGroupRelationships.
 B2BCommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Removes a CommerceItemRelationship whose id is passed in.
 B2BOrderRelationship removeOrderRelationship()
          Removes a OrderRelationship.
 B2BShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Removes a ShippingGroupRelationship whose id is passed in.
 void setAmount(double pAmount)
          sets the amount associated with this PaymentGroup.
 void setChanged(boolean pChanged)
          Marks this object as changed
 void setCostCenterClassType(java.lang.String pCostCenterClassType)
          Sets the CostCenterClassType
 void setDescription(java.lang.String pDescription)
          Sets the description
 void setIdentifier(java.lang.String pIdentifier)
          Sets the identifier
 void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
          Sets a property value
 void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
          Sets the repositoryItem
 void setSaveAllProperties(boolean pSaveAllProperties)
          Sets the saveAllProperties
 java.lang.String toString()
          returns a string representation of this object
 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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CostCenterImpl

public CostCenterImpl()
Method Detail

getCostCenterClassType

public java.lang.String getCostCenterClassType()
Returns the CostCenterClassType

Specified by:
getCostCenterClassType in interface CostCenter

setCostCenterClassType

public void setCostCenterClassType(java.lang.String pCostCenterClassType)
Sets the CostCenterClassType

Specified by:
setCostCenterClassType in interface CostCenter

getIdentifier

public java.lang.String getIdentifier()
Returns the identifier

Specified by:
getIdentifier in interface CostCenter

setIdentifier

public void setIdentifier(java.lang.String pIdentifier)
Sets the identifier

Specified by:
setIdentifier in interface CostCenter

getDescription

public java.lang.String getDescription()
Returns the description

Specified by:
getDescription in interface CostCenter

setDescription

public void setDescription(java.lang.String pDescription)
Sets the description

Specified by:
setDescription in interface CostCenter

getAmount

public double getAmount()
returns the amount associated with this PaymentGroup.

Specified by:
getAmount in interface CostCenter

setAmount

public void setAmount(double pAmount)
sets the amount associated with this PaymentGroup.

Specified by:
setAmount in interface CostCenter
Parameters:
pAmount - the amount to set for this payment

getCommerceItemRelationships

public java.util.List getCommerceItemRelationships()
Returns a List of CommerceItemRelationships

Specified by:
getCommerceItemRelationships in interface B2BCommerceItemRelationshipContainer

addCommerceItemRelationship

public void addCommerceItemRelationship(B2BCommerceItemRelationship pCommerceItemRelationship)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface B2BCommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addCommerceItemRelationship

public void addCommerceItemRelationship(B2BCommerceItemRelationship pCommerceItemRelationship,
                                        int pIndex)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container at the given index. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface B2BCommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeCommerceItemRelationship

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

Specified by:
removeCommerceItemRelationship in interface B2BCommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllCommerceItemRelationships

public void removeAllCommerceItemRelationships()
Removes all the CommerceItemRelationships

Specified by:
removeAllCommerceItemRelationships in interface B2BCommerceItemRelationshipContainer

getCommerceItemRelationship

public B2BCommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
                                                        throws RelationshipNotFoundException,
                                                               InvalidParameterException
Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId. If theCommerceItemRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getCommerceItemRelationship in interface B2BCommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getCommerceItemRelationshipCount

public int getCommerceItemRelationshipCount()
Returns the number of CommerceItemRelationships in the container.

Specified by:
getCommerceItemRelationshipCount in interface B2BCommerceItemRelationshipContainer

getShippingGroupRelationships

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

Specified by:
getShippingGroupRelationships in interface B2BShippingGroupRelationshipContainer

addShippingGroupRelationship

public void addShippingGroupRelationship(B2BShippingGroupRelationship 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 B2BShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addShippingGroupRelationship

public void addShippingGroupRelationship(B2BShippingGroupRelationship 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 B2BShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeShippingGroupRelationship

public B2BShippingGroupRelationship 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 B2BShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllShippingGroupRelationships

public void removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships.

Specified by:
removeAllShippingGroupRelationships in interface B2BShippingGroupRelationshipContainer

getShippingGroupRelationship

public B2BShippingGroupRelationship 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 B2BShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getShippingGroupRelationshipCount

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

Specified by:
getShippingGroupRelationshipCount in interface B2BShippingGroupRelationshipContainer

addOrderRelationship

public void addOrderRelationship(B2BOrderRelationship pOrderRelationship)
                          throws DuplicateRelationshipException,
                                 InvalidParameterException
Add the OrderRelationship to the container. If the OrderRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addOrderRelationship in interface B2BOrderRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeOrderRelationship

public B2BOrderRelationship removeOrderRelationship()
                                             throws RelationshipNotFoundException,
                                                    InvalidParameterException
Removes a OrderRelationship. If the OrderRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed OrderRelationship is returned.

Specified by:
removeOrderRelationship in interface B2BOrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationship

public B2BOrderRelationship getOrderRelationship()
                                          throws RelationshipNotFoundException,
                                                 InvalidParameterException
Returns the OrderRelationship. If theOrderRelationship is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getOrderRelationship in interface B2BOrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationshipCount

public int getOrderRelationshipCount()
Returns the number of OrderRelationships in the container. The returned value will be either 0 or 1.

Specified by:
getOrderRelationshipCount in interface B2BOrderRelationshipContainer

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, if the property is not defined in the underlying item-descriptor null is returned.

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()
returns a string representation of this object

Overrides:
toString in class java.lang.Object