com.ibm.commerce.price.commands
Class RetrievePricesCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.command.BusinessPolicyCommandImpl
                    |
                    +--com.ibm.commerce.price.commands.RetrievePricesCmdImpl
All Implemented Interfaces:
BusinessPolicyCommand, ECCommand, RetrievePricesCmd, TaskCommand

public class RetrievePricesCmdImpl
extends BusinessPolicyCommandImpl
implements RetrievePricesCmd

This RetrievePricesCmd Task Command Implementation retrieves all the qualified offers for one or more catalog entries from the price lists which are referenced by the entitled contracts.

If the command is successful in retreiving offers, it will return a list of qualified offers that can provide the offer prices.

If unsuccessful, it wil return an empty list.

Behaviour

Obtain all the qualified offers for each catalog entries, each offer to be retrieved to find the price of a catalog entry must satisfy certain criteria.

If no valid offer can be found, the parent product offers will be searched providing the catalog entry and the parent product is not excluded from the trading agreements.


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl
policyId, requestProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.price.commands.RetrievePricesCmd
defaultCommandClassName, NAME
 
Constructor Summary
RetrievePricesCmdImpl()
           
 
Method Summary
protected  java.lang.String getCurrency()
          Returns the currency to be used for the price.
 java.util.Hashtable[] getItemOffers()
          Returns all the qualified offers retrieved for each of the input items.
protected  QuantityAmount getQuantityAmount(QuantityAmount aQuantity, java.lang.Long aCatEntryId)
          Returns the quantity amount of the input catalog entry for price.
 void performExecute()
          Executes main business logic of the command.
protected  java.util.Hashtable[] retrieveOffersForCatentries(java.lang.Integer storeId)
          Obtains all the qualified offers for the input catalog entries and their parent products.
 void setCatEntryIds(java.lang.Long[] aCatEntryIds)
          Sets the ids of the input catentries whose prices are to be calculated.
 void setCurrency(java.lang.String astrCurrency)
          Sets the currency to be used for finding the price (Optional).
 void setItemOffers(java.util.Hashtable[] aItemOffers)
          Sets the qualified offers retrieved for each of the items.
 void setOfferIds(java.lang.Long[] aOfferIds)
          Sets the ids of the input offers to be used for retrieving the offer prices (Optional).
 void setPriceListIds(java.lang.Long[] aPriceListIds)
          Sets the ids of the input price lists to be used for retrieving the offers.
 void setPSExclusionList(java.lang.Integer[] aPSExclusionList)
          Sets the list of product sets excluded from the trading agreements.
 void setPSInclusionList(java.lang.Integer[] aPSInclusionList)
          Sets the list of product sets included in the trading agreements.
 void setQuantities(QuantityAmount[] aQuantities)
          Sets the quantities of the catentries to be used for calculating the prices.
 void setRequestProperties(TypedProperty requestProperties)
          Sets the request properties for the policy.
 void setStoreId(java.lang.Integer aStoreId)
          Sets the id of the input store to be used for calculating the price (Optional).
 void validateParameters()
          Checks mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command.BusinessPolicyCommandImpl
getPolicyId, getRequestProperties, setPolicyId
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.BusinessPolicyCommand
getPolicyId, getRequestProperties, setPolicyId
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

RetrievePricesCmdImpl

public RetrievePricesCmdImpl()
Method Detail

getCurrency

protected java.lang.String getCurrency()
Returns the currency to be used for the price.

getItemOffers

public java.util.Hashtable[] getItemOffers()
Returns all the qualified offers retrieved for each of the input items.
Specified by:
getItemOffers in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Returns:
The qualified offers retrieved for each of the input items.

getQuantityAmount

protected QuantityAmount getQuantityAmount(QuantityAmount aQuantity,
                                           java.lang.Long aCatEntryId)
                                    throws ECSystemException
Returns the quantity amount of the input catalog entry for price. If the quantity amount is not specified then the nominal quantity (rounded up to the nearest multiple as specified in the quantityMultiple attribute) of the catalog entry is assumed to be the requested quantity.

performExecute

public void performExecute()
                    throws ECException
Executes main business logic of the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

retrieveOffersForCatentries

protected java.util.Hashtable[] retrieveOffersForCatentries(java.lang.Integer storeId)
                                                     throws ECException
Obtains all the qualified offers for the input catalog entries and their parent products. Each offer to be retrieved must satisfy certain criteria.

The inclusion and exclusion product sets are taken into account when searching the offers.

Parameters:
storeId - The id of the store for search.

Returns:
A list of qualified offers for each of the input catalog entries.

setCatEntryIds

public void setCatEntryIds(java.lang.Long[] aCatEntryIds)
Sets the ids of the input catentries whose prices are to be calculated.
Specified by:
setCatEntryIds in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aCatEntryIds - The reference number of one or more catalog entries for which the qualified offers are to be retrieved.

setCurrency

public void setCurrency(java.lang.String astrCurrency)
Sets the currency to be used for finding the price (Optional).
Specified by:
setCurrency in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
astrCurrency - The currency to look up the price. If the currency is not specified then the "negotiated" currency is used for the store Id and shopper's preferred currency. (The negotiated currency is the currency returned from the getCurrency() method of the currency manager).

setItemOffers

public void setItemOffers(java.util.Hashtable[] aItemOffers)
Sets the qualified offers retrieved for each of the items.

setOfferIds

public void setOfferIds(java.lang.Long[] aOfferIds)
Sets the ids of the input offers to be used for retrieving the offer prices (Optional).
Specified by:
setOfferIds in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aOfferIds - The reference number of one or more offers that are to be used for determining the price. If no offer ids are supplied, then the "best" of all qualifying offers will be used. Otherwise, the "best" of the specified offers will be returned.

setPriceListIds

public void setPriceListIds(java.lang.Long[] aPriceListIds)
Sets the ids of the input price lists to be used for retrieving the offers.
Specified by:
setPriceListIds in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aPriceListIds - The reference number of one or more price lists that are to be used for retrieving the offers.

setPSExclusionList

public void setPSExclusionList(java.lang.Integer[] aPSExclusionList)
Sets the list of product sets excluded from the trading agreements.
Specified by:
setPSExclusionList in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aPSExclusionList - The list of product sets excluded from the trading agreements.

setPSInclusionList

public void setPSInclusionList(java.lang.Integer[] aPSInclusionList)
Sets the list of product sets included in the trading agreements.
Specified by:
setPSInclusionList in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aPSExclusionList - The list of product sets included in the trading agreements.

setQuantities

public void setQuantities(QuantityAmount[] aQuantities)
Sets the quantities of the catentries to be used for calculating the prices.
Specified by:
setQuantities in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aQuantityAmount - The quantity amount of the catalog entry. The quantity amount helps determine which offers are valid. If the quantity amount is not specified then the nominal quantity (rounded up to the nearest multiple as specified in the quantityMultiple attribute) of the Catalog entry is assumed to be the requested quantity.

setRequestProperties

public void setRequestProperties(TypedProperty requestProperties)
Sets the request properties for the policy.
Specified by:
setRequestProperties in interface BusinessPolicyCommand
Overrides:
setRequestProperties in class BusinessPolicyCommandImpl
Parameters:
requestProperties - the request properties for the policy

setStoreId

public void setStoreId(java.lang.Integer aStoreId)
Sets the id of the input store to be used for calculating the price (Optional).
Specified by:
setStoreId in interface RetrievePricesCmd
Following copied from interface: com.ibm.commerce.price.commands.RetrievePricesCmd
Parameters:
aStoreId - The reference number of a store to be used for calculating the price. If the store id is not specified then the store id of the command context will be used.

validateParameters

public void validateParameters()
                        throws ECException
Checks mandatory parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -