java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.price.commands.RetrievePricesCmdImpl
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.
This command calls the following TaskCommands:
This command uses the following AccessBeans:
StoreAccessBean
CatalogHelperAccessBean
CatalogEntryAccessBean
OfferAccessBean
ProductSetCeRelAccessBean
Field Summary | |
---|---|
static java.lang.String |
CLASS_NAME class name field |
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
Fields inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
policyId,
requestProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.price.commands. RetrievePricesCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
RetrievePricesCmdImpl() Constructor. |
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. |
protected
boolean |
isValidOffer(
OfferAccessBean aOfferAB, QuantityAmount aQuantity) Verifies if the offer is valid given the requested quantity amount. |
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. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
reset,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
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 |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASS_NAME
Constructor Detail |
---|
public RetrievePricesCmdImpl()
Method Detail |
---|
protected java.lang.String getCurrency()
public java.util.Hashtable[] getItemOffers()
getItemOffers
in interface
RetrievePricesCmd
protected QuantityAmount getQuantityAmount(QuantityAmount aQuantity, java.lang.Long aCatEntryId) throws ECSystemException
aQuantity
- the quantityaCatEntryId
- the catalog entry ID
ECSystemException
protected boolean isValidOffer(OfferAccessBean aOfferAB, QuantityAmount aQuantity) throws ECException
aOfferAB
- the offer access bean to be validated.aQuantity
- the quantity amount to be checked against the
offer.
ECException
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
protected java.util.Hashtable[] retrieveOffersForCatentries(java.lang.Integer storeId) throws ECException
The inclusion and exclusion product sets are taken into account when searching the offers.
storeId
- The id of the store for search.
ECException
public void setCatEntryIds(java.lang.Long[] aCatEntryIds)
setCatEntryIds
in interface
RetrievePricesCmd
aCatEntryIds
- the catalog entry IDspublic void setCurrency(java.lang.String astrCurrency)
setCurrency
in interface
RetrievePricesCmd
astrCurrency
- the currencypublic void setItemOffers(java.util.Hashtable[] aItemOffers)
aItemOffers
- the offers for itemspublic void setOfferIds(java.lang.Long[] aOfferIds)
setOfferIds
in interface
RetrievePricesCmd
aOfferIds
- the input offer IDspublic void setPriceListIds(java.lang.Long[] aPriceListIds)
setPriceListIds
in interface
RetrievePricesCmd
aPriceListIds
- the input price list IDspublic void setPSExclusionList(java.lang.Integer[] aPSExclusionList)
setPSExclusionList
in interface
RetrievePricesCmd
aPSExclusionList
- the product set exclusion
listpublic void setPSInclusionList(java.lang.Integer[] aPSInclusionList)
setPSInclusionList
in interface
RetrievePricesCmd
aPSInclusionList
- the product set inclusion
listspublic void setQuantities(QuantityAmount[] aQuantities)
setQuantities
in interface
RetrievePricesCmd
aQuantities
- the quantites of the
catentriespublic void setRequestProperties(TypedProperty requestProperties)
setRequestProperties
in interface
BusinessPolicyCommand
setRequestProperties
in class
BusinessPolicyCommandImpl
requestProperties
- the request properties for the
policypublic void setStoreId(java.lang.Integer aStoreId)
setStoreId
in interface
RetrievePricesCmd
aStoreId
- the store IDpublic void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException