atg.commerce.order
Class ShippingGroupImpl

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.commerce.order.ShippingGroupImpl
All Implemented Interfaces:
ChangedProperties, CommerceIdentifier, CommerceItemRelationshipContainer, HandlingInstructionContainer, PaymentGroupRelationshipContainer, ShippingGroup, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
B2BShippingGroupImpl, ElectronicShippingGroup, HardgoodShippingGroup

public class ShippingGroupImpl
extends CommerceIdentifierImpl
implements ShippingGroup, ChangedProperties

This class is an implementation of a ShippingGroup. It represents all the information which designates a shipment. Examples would be HardgoodShippingGroup and ElectronicShippingGroup. This could include traditional shipping by a carrier, or electronic shipping. This class is not meant to be used directly because it does not contain any properties which are specific to any particular kind of payment. Rather a subclass such as HardgoodShippingGroup or ElectronicShippingGroup should be used.

See Also:
HardgoodShippingGroup, ElectronicShippingGroup, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
Constructor Summary
ShippingGroupImpl()
           
 
Method Summary
 void addChangedProperty(java.lang.String pPropertyName)
          Adds a changedProperty
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship)
          Add the CommerceItemRelationship to the container.
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship, int pIndex)
          Add the CommerceItemRelationship to the container at the given index.
 void addHandlingInstruction(HandlingInstruction pHandlingInstruction)
          Add the HandlingInstruction to the container.
 void addHandlingInstruction(HandlingInstruction pHandlingInstruction, int pIndex)
          Add the HandlingInstruction to the container at the given index.
 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.
 boolean arePropertiesEmpty(java.util.Collection<java.lang.String> pPropertiesToCheck)
          Query whether the ShippingGroup object is empty.
 void clearChangedProperties()
          Clears the changedProperties List
 void copyProperties(ShippingGroup pSrcShippingGroup, java.util.Collection<java.lang.String> pPropertiesToCopy)
          Copy the shipping group information from the source shipping group to itself.
 boolean doPropertiesMatch(ShippingGroup pShippingGroupToMatchAgainst, java.util.List<java.lang.String> pPropertiesToMatch)
          Is the shipping group passed in matches against the current instance? This method compares the current shipping group instance against the shipping group that is being passed in.
 java.util.Date getActualShipDate()
          Returns property actualShipDate.
 java.util.Set getChangedProperties()
          Returns the changedProperties
 CommerceItemRelationship 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 getDescription()
          Returns the description
 HandlingInstruction getHandlingInstruction(java.lang.String pHandlingInstructionId)
          Returns the HandlingInstruction whose id is pHandlingInstructionId.
 int getHandlingInstructionCount()
          Returns the number of HandlingInstructions in the container.
 java.util.List getHandlingInstructions()
          Returns a List of HandlingInstructions
 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
 ShippingPriceInfo getPriceInfo()
          returns the ShippingPriceInfo object.
 MutableRepositoryItem getPriceInfoRepositoryItem()
          Returns the priceInfoRepositoryItem
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns a property value
 MutableRepositoryItem getRepositoryItem()
          Returns the repositoryItem
 boolean getSaveAllProperties()
          Returns the saveAllProperties
 java.util.Date getShipOnDate()
          Returns the shipOnDate.
 java.lang.String getShippingGroupClassType()
          Returns the ShippingGroupClassType
 java.lang.String getShippingMethod()
          Returns the shippingMethod
 java.util.Map getSpecialInstructions()
          Returns the specialInstructions
 int getState()
          returns the ShippingGroup state.
 java.lang.String getStateAsString()
          returns the ShippingGroup state as a String.
 java.lang.String getStateAsUserResource()
          returns the ShippingGroup state as a user resource
 java.lang.String getStateDetail()
          returns the ShippingGroup state details.
 java.util.Date getSubmittedDate()
          Returns the submittedDate
 boolean isChanged()
          Returns the isChanged flag
 void removeAllCommerceItemRelationships()
          Removes all the CommerceItemRelationships
 void removeAllHandlingInstructions()
          Removes all the HandlingInstructions in the container.
 void removeAllPaymentGroupRelationships()
          Removes all the PaymentGroupRelationships
 CommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Removes a CommerceItemRelationship whose id is passed in.
 HandlingInstruction removeHandlingInstruction(java.lang.String pHandlingInstructionId)
          Removes a HandlingInstruction whose id is passed in.
 PaymentGroupRelationship removePaymentGroupRelationship(java.lang.String pPaymentGroupRelationshipId)
          Removes a PaymentGroupRelationship whose id is passed in.
 void setActualShipDate(java.util.Date pActualShipDate)
          Sets property actualShipDate
 void setChanged(boolean pChanged)
          Marks this object as changed
 void setDescription(java.lang.String pDescription)
          Sets the description
 void setPriceInfo(ShippingPriceInfo pInfo)
          sets the ShippingPriceInfo object.
 void setPriceInfoRepositoryItem(MutableRepositoryItem pPriceInfoRepositoryItem)
          Sets the priceInfoRepositoryItem
 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
 void setShipOnDate(java.util.Date pShipOnDate)
          Sets the shipOnDate
 void setShippingGroupClassType(java.lang.String pShippingGroupClassType)
          Sets the ShippingGroupClassType
 void setShippingMethod(java.lang.String pShippingMethod)
          Sets the shippingMethod
 void setSpecialInstructions(java.util.Map pSpecialInstructions)
          Sets the specialInstructions
 void setState(int pState)
          sets the ShippingGroup state.
 void setStateAsString(java.lang.String pState)
          sets the ShippingGroup state as a string.
 void setStateDetail(java.lang.String pStateDetail)
          sets the ShippingGroup state details.
 void setSubmittedDate(java.util.Date pSubmittedDate)
          Sets the submittedDate
 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


sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle

Constructor Detail

ShippingGroupImpl

public ShippingGroupImpl()
Method Detail

getShippingGroupClassType

public java.lang.String getShippingGroupClassType()
Returns the ShippingGroupClassType

Specified by:
getShippingGroupClassType in interface ShippingGroup

setShippingGroupClassType

public void setShippingGroupClassType(java.lang.String pShippingGroupClassType)
Sets the ShippingGroupClassType

Specified by:
setShippingGroupClassType in interface ShippingGroup

getShippingMethod

public java.lang.String getShippingMethod()
Returns the shippingMethod

Specified by:
getShippingMethod in interface ShippingGroup

setShippingMethod

public void setShippingMethod(java.lang.String pShippingMethod)
Sets the shippingMethod

Specified by:
setShippingMethod in interface ShippingGroup

getDescription

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

Specified by:
getDescription in interface ShippingGroup

setDescription

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

Specified by:
setDescription in interface ShippingGroup

getState

public int getState()
returns the ShippingGroup state.

Specified by:
getState in interface ShippingGroup

setState

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

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

getStateAsString

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


setStateAsString

public void setStateAsString(java.lang.String pState)
sets the ShippingGroup state as a string.

Parameters:
pState - the state to set

getStateAsUserResource

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


getStateDetail

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

Specified by:
getStateDetail in interface ShippingGroup

setStateDetail

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

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

getPriceInfo

public ShippingPriceInfo getPriceInfo()
returns the ShippingPriceInfo object.

Specified by:
getPriceInfo in interface ShippingGroup

setPriceInfo

public void setPriceInfo(ShippingPriceInfo pInfo)
sets the ShippingPriceInfo object.

Specified by:
setPriceInfo in interface ShippingGroup
Parameters:
pInfo - the ShippingPriceInfo to set

getPriceInfoRepositoryItem

public MutableRepositoryItem getPriceInfoRepositoryItem()
Returns the priceInfoRepositoryItem


setPriceInfoRepositoryItem

public void setPriceInfoRepositoryItem(MutableRepositoryItem pPriceInfoRepositoryItem)
Sets the priceInfoRepositoryItem


getShipOnDate

public java.util.Date getShipOnDate()
Returns the shipOnDate. This is the date the user chooses to have the ShippingGroup shipped.

Specified by:
getShipOnDate in interface ShippingGroup

setShipOnDate

public void setShipOnDate(java.util.Date pShipOnDate)
Sets the shipOnDate

Specified by:
setShipOnDate in interface ShippingGroup

getActualShipDate

public java.util.Date getActualShipDate()
Returns property actualShipDate. This is the date that the ShippingGroup was actually shipped.

Specified by:
getActualShipDate in interface ShippingGroup
Returns:
returns property actualShipDate. This is the date that the ShippingGroup was actually shipped.

setActualShipDate

public void setActualShipDate(java.util.Date pActualShipDate)
Sets property actualShipDate

Specified by:
setActualShipDate in interface ShippingGroup
Parameters:
pActualShipDate - the value to set for property actualShipDate

getSubmittedDate

public java.util.Date getSubmittedDate()
Returns the submittedDate

Specified by:
getSubmittedDate in interface ShippingGroup

setSubmittedDate

public void setSubmittedDate(java.util.Date pSubmittedDate)
Sets the submittedDate

Specified by:
setSubmittedDate in interface ShippingGroup

getSpecialInstructions

public java.util.Map getSpecialInstructions()
Returns the specialInstructions

Specified by:
getSpecialInstructions in interface ShippingGroup

setSpecialInstructions

public void setSpecialInstructions(java.util.Map pSpecialInstructions)
Sets the specialInstructions


getCommerceItemRelationships

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

Specified by:
getCommerceItemRelationships in interface CommerceItemRelationshipContainer

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship 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 CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship 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 CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeCommerceItemRelationship

public CommerceItemRelationship 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 CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllCommerceItemRelationships

public void removeAllCommerceItemRelationships()
Removes all the CommerceItemRelationships

Specified by:
removeAllCommerceItemRelationships in interface CommerceItemRelationshipContainer

getCommerceItemRelationship

public CommerceItemRelationship 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 CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getCommerceItemRelationshipCount

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

Specified by:
getCommerceItemRelationshipCount in interface CommerceItemRelationshipContainer

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

getHandlingInstructions

public java.util.List getHandlingInstructions()
Returns a List of HandlingInstructions

Specified by:
getHandlingInstructions in interface HandlingInstructionContainer

addHandlingInstruction

public void addHandlingInstruction(HandlingInstruction pHandlingInstruction)
                            throws DuplicateHandlingInstructionException,
                                   InvalidParameterException
Add the HandlingInstruction to the container. If the HandlingInstruction was already in the container a DuplicateHandlingInstructionException is thrown.

Specified by:
addHandlingInstruction in interface HandlingInstructionContainer
Throws:
DuplicateHandlingInstructionException
InvalidParameterException

addHandlingInstruction

public void addHandlingInstruction(HandlingInstruction pHandlingInstruction,
                                   int pIndex)
                            throws DuplicateHandlingInstructionException,
                                   InvalidParameterException
Add the HandlingInstruction to the container at the given index. If the HandlingInstruction was already in the container a DuplicateHandlingInstructionException is thrown.

Specified by:
addHandlingInstruction in interface HandlingInstructionContainer
Throws:
DuplicateHandlingInstructionException
InvalidParameterException

removeHandlingInstruction

public HandlingInstruction removeHandlingInstruction(java.lang.String pHandlingInstructionId)
                                              throws HandlingInstructionNotFoundException,
                                                     InvalidParameterException
Removes a HandlingInstruction whose id is passed in. If the HandlingInstruction is not in the container then an HandlingInstructionNotFoundException is thrown. Otherwise a reference to the removed HandlingInstruction is returned.

Specified by:
removeHandlingInstruction in interface HandlingInstructionContainer
Throws:
HandlingInstructionNotFoundException
InvalidParameterException

removeAllHandlingInstructions

public void removeAllHandlingInstructions()
Removes all the HandlingInstructions in the container.

Specified by:
removeAllHandlingInstructions in interface HandlingInstructionContainer

getHandlingInstruction

public HandlingInstruction getHandlingInstruction(java.lang.String pHandlingInstructionId)
                                           throws HandlingInstructionNotFoundException,
                                                  InvalidParameterException
Returns the HandlingInstruction whose id is pHandlingInstructionId. If the HandlingInstruction with the corresponding id is not in the container then a HandlingInstructionNotFoundException is thrown.

Specified by:
getHandlingInstruction in interface HandlingInstructionContainer
Throws:
HandlingInstructionNotFoundException
InvalidParameterException

getHandlingInstructionCount

public int getHandlingInstructionCount()
Returns the number of HandlingInstructions in the container.

Specified by:
getHandlingInstructionCount in interface HandlingInstructionContainer

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

Overrides:
toString in class java.lang.Object

arePropertiesEmpty

public boolean arePropertiesEmpty(java.util.Collection<java.lang.String> pPropertiesToCheck)
                           throws CommerceException
Query whether the ShippingGroup object is empty.

If any of the list of properties provided in this method is not found, then this method throws an exception.

Also if any of the property is not empty, then this method considers the object as not empty.

Parameters:
pPropertiesToCheck - -- The list of properties to check
Returns:
true if every property in the pPropertiesToCheck is null, false otherwise.
Throws:
CommerceException

copyProperties

public void copyProperties(ShippingGroup pSrcShippingGroup,
                           java.util.Collection<java.lang.String> pPropertiesToCopy)
                    throws CommerceException
Copy the shipping group information from the source shipping group to itself. The properties to copy is provided and only these properties are copied.

If any of the list of properties provided in this method is not found, then this method throws an exception.

Parameters:
pSrcShippingGroup - -- The source shipping group from where the information to be copied
pPropertiesToCopy - -- The list of properties to copy
Throws:
CommerceException

doPropertiesMatch

public boolean doPropertiesMatch(ShippingGroup pShippingGroupToMatchAgainst,
                                 java.util.List<java.lang.String> pPropertiesToMatch)
                          throws CommerceException
Is the shipping group passed in matches against the current instance? This method compares the current shipping group instance against the shipping group that is being passed in. Also this method compares only the properties that are passed in and not all the shipping group properties are compared. If any of the list of properties provided in this method is not found, then this method throws an exception.

Parameters:
pShippingGroupToMatchAgainst - -- The shipping group to be matched against the current instance
pPropertiesToMatch - -- The List of properties to be matched against
Returns:
returns true if the shipping groups match, false otherwise
Throws:
CommerceException
See Also:
AddressTools#compareObjects(Object, Object, List, Set)}