public class GetContractUnitPriceCmdImpl extends TaskCommandImpl implements GetContractUnitPriceCmd, GetContractSpecialPriceCmd, GetProductContractUnitPriceCmd
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
Get the best price among all the qualified offers for the input catalog entry (Invoke SelectContractPricesCmd):
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:Constructor and Description |
---|
GetContractUnitPriceCmdImpl()
GetBaseUnitPriceCmdImpl constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void | calculatePrices(java.lang.Integer storeId)
Retrieves all the qualified offers for the input catalog entry in that each offer must meet a list of criteria.
|
java.lang.Long[] | getApplicableTradingIds()
For input single Catalog entry , returns the ids of the trading agreements that are used to determine the prices.
|
MonetaryAmount[] | getApplicableTradingUnitPrices()
For input single Catalog entry, returns the unit prices of a catentry that were determined for each of the applied trading agreements.
|
MonetaryAmount | getBasePrice()
For input single catalog entry, returns the base price of the input catalog entry.
|
CatEntryPrices[] | getCatEntryPrices()
For input multiple catalog entries, return the price related information of the input catalog entries.
|
OfferAccessBean | getOffer()
For input single Catalog entry, returns the offer access bean that was used to determine the price.
|
java.lang.Long | getOfferId()
For input single Catalog entry, returns the id of the output offer id that was used to determine the price.
|
java.lang.Long | getOrganizationId()
Returns the organization ID to be used to determine entitled contracts.
|
MonetaryAmount | getPrice()
For input single Catalog entry, returns the actual price of the catalog entry.
|
java.lang.Long | getTcId()
Returns the id of the output T&C id which was associated with the offer that supplied the price.
|
java.lang.Long | getTradingId()
Returns the id of the output trading agreement id which was associated with the offer that supplied the price.
|
void | performExecute()
Executes main business logic of the command.
|
void | reset()
reset the command.
|
protected java.util.Hashtable | resolvePriceLists(BusinessPolicyAccessBean[] pricePolicyABs)
Resolve the price lists referenced by a list of price business policies.
|
protected boolean | resolveTradingAgreements()
Verifies and resolves a list of eligible trading agreements for the user.
|
protected void | retrievePrices()
Retrieves all the qualified offers for the input catalog entry in that each offer must meet a list of criteria.
|
protected void | selectPrices(java.lang.Integer storeId)
Selects the best offer for the input catalog entry among a list of qualified offers.
|
void | setCatEntryId(java.lang.Long anCatEntryId)
Sets the id of the input catalog entry.
|
void | setCatEntryPrices(CatEntryPrices[] aCatEntryPrices)
Sets the information of one or more catalog entries.
|
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 | setMemberId(java.lang.Long anMemberId)
Sets the member id to be used for verifying and searching the trading agreements (Optional).
|
void | setOfferIds(java.lang.Long[] aOfferIds)
Sets the ids of the input offers to be used for price (Optional).
|
void | setOrderItemAccessBean(OrderItemAccessBean aOrderItemAB)
Sets the orderitem Access Bean.
|
void | setOrganizationId(java.lang.Long organizationId)
Sets the organization ID to be used to determine entitled contracts.
|
void | setQuantity(QuantityAmount aQuantityAmount)
Sets the quantity amount of the input catalog entry that is to be priced (Optional).
|
void | setStoreId(java.lang.Integer aStoreId)
Sets the id of the input store to be used for calculating the price (Optional).
|
void | setTradingIds(java.lang.Long[] aTradingIds)
Sets the ids of the input trading agreements (Optional).
|
void | validateParameters()
Checks mandatory parameters.
|
public GetContractUnitPriceCmdImpl()
protected void calculatePrices(java.lang.Integer storeId) throws ECException
public java.lang.Long[] getApplicableTradingIds()
public MonetaryAmount[] getApplicableTradingUnitPrices()
public MonetaryAmount getBasePrice()
public CatEntryPrices[] getCatEntryPrices()
public OfferAccessBean getOffer()
public java.lang.Long getOfferId()
public MonetaryAmount getPrice()
public java.lang.Long getTcId()
public java.lang.Long getTradingId()
public void performExecute() throws ECException
public void reset()
protected java.util.Hashtable resolvePriceLists(BusinessPolicyAccessBean[] pricePolicyABs) throws ECException
protected boolean resolveTradingAgreements() throws ECException
If trading agreements are specified, the input list will be verified against the eligible list when the member id is provided. The eligible list of trading agreements can be obtained from the Command Context if the input member id is the one in Command Context.
If trading agreements are not specified, the list may be obtained directly from the Command Context. (if no member id is provided or the input member id is the one in Command Context). Or it may be retrieved by means of the member id. (if the id is provided and is different from that in the Command Context).
protected void retrievePrices() throws ECException
protected void selectPrices(java.lang.Integer storeId) throws ECException
public void setCatEntryId(java.lang.Long anCatEntryId)
public void setCatEntryPrices(CatEntryPrices[] aCatEntryPrices)
public void setCurrency(java.lang.String astrCurrency)
public void setErrorMode(boolean aErrorMode)
public void setMemberId(java.lang.Long anMemberId)
public void setOfferIds(java.lang.Long[] aOfferIds)
public void setOrderItemAccessBean(OrderItemAccessBean aOrderItemAB)
public void setQuantity(QuantityAmount aQuantityAmount)
public void setStoreId(java.lang.Integer aStoreId)
public void setTradingIds(java.lang.Long[] aTradingIds)
public void validateParameters() throws ECException
public void setOrganizationId(java.lang.Long organizationId)
public java.lang.Long getOrganizationId()