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
OrderPrepareCmd
Controller 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:StoreAccessBean
OrderItemAccessBean
BusinessPolicyAccessBean
CatalogEntryShippingAccessBean
TradingAgreementAccessBean
OfferAccessBean
TermConditionAccessBean
NAME
NAME
defaultCommandClassName, 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, wait
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public GetContractUnitPriceCmdImpl()
public java.lang.Long[] getApplicableTradingIds()
getApplicableTradingIds
in interface GetContractSpecialPriceCmd
getApplicableTradingIds
in interface GetContractUnitPriceCmd
getApplicableTradingIds
in interface GetProductContractUnitPriceCmd
public MonetaryAmount[] getApplicableTradingUnitPrices()
getApplicableTradingUnitPrices
in interface GetContractSpecialPriceCmd
getApplicableTradingUnitPrices
in interface GetContractUnitPriceCmd
getApplicableTradingUnitPrices
in interface GetProductContractUnitPriceCmd
public MonetaryAmount getBasePrice()
getBasePrice
in interface GetContractSpecialPriceCmd
getBasePrice
in interface GetContractUnitPriceCmd
getBasePrice
in interface GetProductContractUnitPriceCmd
public CatEntryPrices[] getCatEntryPrices()
getCatEntryPrices
in interface GetContractSpecialPriceCmd
getCatEntryPrices
in interface GetContractUnitPriceCmd
getCatEntryPrices
in interface GetProductContractUnitPriceCmd
public com.ibm.commerce.order.objects.OfferAccessBean getOffer()
getOffer
in interface GetContractSpecialPriceCmd
getOffer
in interface GetContractUnitPriceCmd
getOffer
in interface GetProductContractUnitPriceCmd
public java.lang.Long getOfferId()
getOfferId
in interface GetContractSpecialPriceCmd
getOfferId
in interface GetContractUnitPriceCmd
getOfferId
in interface GetProductContractUnitPriceCmd
public java.lang.Long getOrganizationId()
public MonetaryAmount getPrice()
getPrice
in interface GetContractSpecialPriceCmd
getPrice
in interface GetContractUnitPriceCmd
getPrice
in interface GetProductContractUnitPriceCmd
public java.lang.Long getTcId()
getTcId
in interface GetContractSpecialPriceCmd
getTcId
in interface GetContractUnitPriceCmd
getTcId
in interface GetProductContractUnitPriceCmd
public java.lang.Long getTradingId()
getTradingId
in interface GetContractSpecialPriceCmd
getTradingId
in interface GetContractUnitPriceCmd
getTradingId
in interface GetProductContractUnitPriceCmd
public void performExecute() throws com.ibm.commerce.exception.ECException
performExecute
in interface com.ibm.commerce.command.ECCommand
performExecute
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException
public void reset()
reset
in interface GetContractSpecialPriceCmd
reset
in interface GetContractUnitPriceCmd
reset
in interface GetProductContractUnitPriceCmd
reset
in class com.ibm.commerce.command.AbstractECTargetableCommand
public void setCatEntryId(java.lang.Long anCatEntryId)
setCatEntryId
in interface GetContractSpecialPriceCmd
setCatEntryId
in interface GetContractUnitPriceCmd
setCatEntryId
in interface GetProductContractUnitPriceCmd
anCatEntryId
- 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 GetContractSpecialPriceCmd
setCatEntryPrices
in interface GetContractUnitPriceCmd
aCatEntryPrices
- the array of CatEntryPricespublic void setCurrency(java.lang.String astrCurrency)
setCurrency
in interface GetContractSpecialPriceCmd
setCurrency
in interface GetContractUnitPriceCmd
setCurrency
in interface GetProductContractUnitPriceCmd
astrCurrency
- the currencypublic void setErrorMode(boolean aErrorMode)
setErrorMode
in interface GetContractSpecialPriceCmd
setErrorMode
in interface GetContractUnitPriceCmd
setErrorMode
in interface GetProductContractUnitPriceCmd
aErrorMode
- true if throw exceptionspublic void setMemberId(java.lang.Long anMemberId)
setMemberId
in interface GetContractUnitPriceCmd
anMemberId
- the member IDpublic void setOfferIds(java.lang.Long[] aOfferIds)
setOfferIds
in interface GetContractSpecialPriceCmd
setOfferIds
in interface GetContractUnitPriceCmd
setOfferIds
in interface GetProductContractUnitPriceCmd
aOfferIds
- all offer IDspublic void setOrderItemAccessBean(com.ibm.commerce.order.objects.OrderItemAccessBean aOrderItemAB)
setOrderItemAccessBean
in interface GetContractSpecialPriceCmd
aOrderItemAB
- an order item access bean.public void setOrganizationId(java.lang.Long organizationId)
setOrganizationId
in interface GetContractUnitPriceCmd
organzationId
- the organization IDpublic void setQuantity(QuantityAmount aQuantityAmount)
setQuantity
in interface GetContractSpecialPriceCmd
setQuantity
in interface GetContractUnitPriceCmd
setQuantity
in interface GetProductContractUnitPriceCmd
aQuantityAmount
- the quantitypublic void setStoreId(java.lang.Integer aStoreId)
setStoreId
in interface GetContractSpecialPriceCmd
setStoreId
in interface GetContractUnitPriceCmd
setStoreId
in interface GetProductContractUnitPriceCmd
aStoreId
- the store IDpublic void setTradingIds(java.lang.Long[] aTradingIds)
setTradingIds
in interface GetContractSpecialPriceCmd
setTradingIds
in interface GetContractUnitPriceCmd
setTradingIds
in interface GetProductContractUnitPriceCmd
aTradingIds
- an array of trading IDspublic void validateParameters() throws com.ibm.commerce.exception.ECException
validateParameters
in interface com.ibm.commerce.command.ECCommand
validateParameters
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException