java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.price.commands.SelectContractPricesCmdImpl
This SelectContractPricesCmd
Task Command Implementation
selects the best offer among all the qualified offers for the input catalog
entry.
If the command is successful retrieving the price, it will return the best price, the offer id and access bean, the T&C id and the trading agreement id that determined the price.
If unsuccessful, the command throws the ECApplicationException specifying an Error Message (ERR_RETRIEVE_PRICE), an Error Code (ERR_CODE_NO_PRICE) and the Error View (RetrievePriceErrorView).
Behaviour The best offer will be selected based on the following criteria:
Exception Conditions
If ErrorMode is false, these errors will be ignored and a null value price will be passed back to the caller.
This command calls the following TaskCommands:
This command uses the following AccessBeans:
Field Summary | |
---|---|
static java.lang.String |
CLASS_NAME the class name. |
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.price.commands. SelectContractPricesCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
SelectContractPricesCmdImpl() Constructor. |
Method Summary | |
---|---|
protected
QualifyingOfferInfo |
findBestOffer(java.util.Hashtable aOfferInfoHash,
ItemPriceInfo aItemPriceInfo) Finds the best offer for a catalog entry. |
ItemPriceInfo[] |
getItemPriceInfo() Returns the internal item info structure. |
void |
performExecute() Executes main business logic of the command. |
protected
void |
selectOffer() Selects the best offer for a catalog entry. |
protected
void |
selectTradingOffers() Selects the best offer for a catalog entry for each trading agreement. |
void |
setCurrency(java.lang.String astrCurrency) Sets the currency to be used for finding the price (Optional). |
void |
setErrorMode(boolean aErrorMode) Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional). |
void |
setItemPriceInfo(
ItemPriceInfo[] aItemPriceInfo) Sets the item info structure for internal use on calculating the prices. |
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. 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 |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASS_NAME
Constructor Detail |
---|
public SelectContractPricesCmdImpl()
Method Detail |
---|
protected QualifyingOfferInfo findBestOffer(java.util.Hashtable aOfferInfoHash, ItemPriceInfo aItemPriceInfo) throws ECException
aOfferInfoHash
- the list of offers for selection.aItemPriceInfo
- the item price info.
ECException
public ItemPriceInfo[] getItemPriceInfo()
getItemPriceInfo
in interface
SelectContractPricesCmd
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
protected void selectOffer() throws ECException
ECException
protected void selectTradingOffers() throws ECException
ECException
public void setCurrency(java.lang.String astrCurrency)
setCurrency
in interface
SelectContractPricesCmd
astrCurrency
- the currencypublic void setErrorMode(boolean aErrorMode)
setErrorMode
in interface
SelectContractPricesCmd
aErrorMode
- the error modepublic void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
setItemPriceInfo
in interface
SelectContractPricesCmd
aItemPriceInfo
- the internal data
struturepublic void setStoreId(java.lang.Integer aStoreId)
setStoreId
in interface
SelectContractPricesCmd
aStoreId
- the store IDpublic void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException