public class SelectContractPricesCmdImpl extends TaskCommandImpl implements SelectContractPricesCmd
If the command is successful retrieving the price, it will return the best price, the offer id and access bean. And it will return 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:Modifier and Type | Field and Description |
---|---|
static java.lang.String | CLASS_NAME
the class name.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
SelectContractPricesCmdImpl()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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 int | pickWinningPriceIndexFromContracts(java.lang.Long[] tradingIds, java.lang.Long[] tcIds, OfferAccessBean[] offers, MonetaryAmount[] prices)
Selects the winning price to offer from the set of contracts to which the user is entitled.
|
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.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASS_NAME
protected QualifyingOfferInfo findBestOffer(java.util.Hashtable aOfferInfoHash, ItemPriceInfo aItemPriceInfo) throws ECException
public ItemPriceInfo[] getItemPriceInfo()
public void performExecute() throws ECException
protected void selectOffer() throws ECException
protected int pickWinningPriceIndexFromContracts(java.lang.Long[] tradingIds, java.lang.Long[] tcIds, OfferAccessBean[] offers, MonetaryAmount[] prices)
protected void selectTradingOffers() throws ECException
public void setCurrency(java.lang.String astrCurrency)
public void setErrorMode(boolean aErrorMode)
public void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
public void setStoreId(java.lang.Integer aStoreId)
public void validateParameters() throws ECException