public class GetContractUnitPriceCmdImpl extends com.ibm.commerce.command.TaskCommandImpl implements GetContractUnitPriceCmd, GetContractSpecialPriceCmd, GetProductContractUnitPriceCmd
GetContractUnitPriceCmd Task Command Implementation can be called
by several commands such as ProductDisplayCmd, OrderItemAddCmd,
OrderItemUpdateCmd, OrderItemDisplayCmd and
OrderPrepareCmdController Command.
This GetContractUnitPriceCmd Task Command Implementation supports single catalog entry and multiple catalog entries.
It calculates the best contract price for each catalog entry given a list of trading agreements (and offers). And it is
also for each of these trading agreements, obtains its best contract price.
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
CalculateContractPricesCmd):
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:StoreAccessBeanOrderItemAccessBeanBusinessPolicyAccessBeanCatalogEntryShippingAccessBeanTradingAgreementAccessBeanOfferAccessBeanTermConditionAccessBean NAMENAMEdefaultCommandClassName, NAME| Constructor and Description |
|---|
GetContractUnitPriceCmdImpl()
GetBaseUnitPriceCmdImpl constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
com.ibm.commerce.order.objects.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.
|
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(com.ibm.commerce.order.objects.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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiescheckIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultPropertiespublic GetContractUnitPriceCmdImpl()
public java.lang.Long[] getApplicableTradingIds()
getApplicableTradingIds in interface GetContractSpecialPriceCmdgetApplicableTradingIds in interface GetContractUnitPriceCmdgetApplicableTradingIds in interface GetProductContractUnitPriceCmdpublic MonetaryAmount[] getApplicableTradingUnitPrices()
getApplicableTradingUnitPrices in interface GetContractSpecialPriceCmdgetApplicableTradingUnitPrices in interface GetContractUnitPriceCmdgetApplicableTradingUnitPrices in interface GetProductContractUnitPriceCmdpublic MonetaryAmount getBasePrice()
getBasePrice in interface GetContractSpecialPriceCmdgetBasePrice in interface GetContractUnitPriceCmdgetBasePrice in interface GetProductContractUnitPriceCmdpublic CatEntryPrices[] getCatEntryPrices()
getCatEntryPrices in interface GetContractSpecialPriceCmdgetCatEntryPrices in interface GetContractUnitPriceCmdgetCatEntryPrices in interface GetProductContractUnitPriceCmdpublic com.ibm.commerce.order.objects.OfferAccessBean getOffer()
getOffer in interface GetContractSpecialPriceCmdgetOffer in interface GetContractUnitPriceCmdgetOffer in interface GetProductContractUnitPriceCmdpublic java.lang.Long getOfferId()
getOfferId in interface GetContractSpecialPriceCmdgetOfferId in interface GetContractUnitPriceCmdgetOfferId in interface GetProductContractUnitPriceCmdpublic java.lang.Long getOrganizationId()
public MonetaryAmount getPrice()
getPrice in interface GetContractSpecialPriceCmdgetPrice in interface GetContractUnitPriceCmdgetPrice in interface GetProductContractUnitPriceCmdpublic java.lang.Long getTcId()
getTcId in interface GetContractSpecialPriceCmdgetTcId in interface GetContractUnitPriceCmdgetTcId in interface GetProductContractUnitPriceCmdpublic java.lang.Long getTradingId()
getTradingId in interface GetContractSpecialPriceCmdgetTradingId in interface GetContractUnitPriceCmdgetTradingId in interface GetProductContractUnitPriceCmdpublic void performExecute()
throws com.ibm.commerce.exception.ECException
performExecute in interface com.ibm.commerce.command.ECCommandperformExecute in class com.ibm.commerce.command.AbstractECTargetableCommandcom.ibm.commerce.exception.ECExceptionpublic void reset()
reset in interface GetContractSpecialPriceCmdreset in interface GetContractUnitPriceCmdreset in interface GetProductContractUnitPriceCmdreset in class com.ibm.commerce.command.AbstractECTargetableCommandpublic void setCatEntryId(java.lang.Long anCatEntryId)
setCatEntryId in interface GetContractSpecialPriceCmdsetCatEntryId in interface GetContractUnitPriceCmdsetCatEntryId in interface GetProductContractUnitPriceCmdanCatEntryId - the catEntry IDpublic void setCatEntryPrices(CatEntryPrices[] aCatEntryPrices)
catEntryPries:
tradingIds: specified the trading agreements that the catalog entries will be used to get the offer. This attribute can be set by the method setTradingIds in a CatEntryPrices Object.
offerIds: specified the offers that the catalog entries will be used to filter all the offer that the trading agreements retrieved. This attribute can be set by the method setOfferIds in a CatEntryPrices Object.
setCatEntryPrices in interface GetContractSpecialPriceCmdsetCatEntryPrices in interface GetContractUnitPriceCmdaCatEntryPrices - the array of CatEntryPricespublic void setCurrency(java.lang.String astrCurrency)
setCurrency in interface GetContractSpecialPriceCmdsetCurrency in interface GetContractUnitPriceCmdsetCurrency in interface GetProductContractUnitPriceCmdastrCurrency - the currencypublic void setErrorMode(boolean aErrorMode)
setErrorMode in interface GetContractSpecialPriceCmdsetErrorMode in interface GetContractUnitPriceCmdsetErrorMode in interface GetProductContractUnitPriceCmdaErrorMode - true if throw exceptionspublic void setMemberId(java.lang.Long anMemberId)
setMemberId in interface GetContractUnitPriceCmdanMemberId - the member IDpublic void setOfferIds(java.lang.Long[] aOfferIds)
setOfferIds in interface GetContractSpecialPriceCmdsetOfferIds in interface GetContractUnitPriceCmdsetOfferIds in interface GetProductContractUnitPriceCmdaOfferIds - all offer IDspublic void setOrderItemAccessBean(com.ibm.commerce.order.objects.OrderItemAccessBean aOrderItemAB)
setOrderItemAccessBean in interface GetContractSpecialPriceCmdaOrderItemAB - an order item access bean.public void setOrganizationId(java.lang.Long organizationId)
setOrganizationId in interface GetContractUnitPriceCmdorganzationId - the organization IDpublic void setQuantity(QuantityAmount aQuantityAmount)
setQuantity in interface GetContractSpecialPriceCmdsetQuantity in interface GetContractUnitPriceCmdsetQuantity in interface GetProductContractUnitPriceCmdaQuantityAmount - the quantitypublic void setStoreId(java.lang.Integer aStoreId)
setStoreId in interface GetContractSpecialPriceCmdsetStoreId in interface GetContractUnitPriceCmdsetStoreId in interface GetProductContractUnitPriceCmdaStoreId - the store IDpublic void setTradingIds(java.lang.Long[] aTradingIds)
setTradingIds in interface GetContractSpecialPriceCmdsetTradingIds in interface GetContractUnitPriceCmdsetTradingIds in interface GetProductContractUnitPriceCmdaTradingIds - an array of trading IDspublic void validateParameters()
throws com.ibm.commerce.exception.ECException
validateParameters in interface com.ibm.commerce.command.ECCommandvalidateParameters in class com.ibm.commerce.command.AbstractECTargetableCommandcom.ibm.commerce.exception.ECException