public abstract class AbstractGetDynamicKitUnitPriceCmdImpl extends com.ibm.commerce.command.TaskCommandImpl implements GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd
.
The business logic is divide into two steps. Firstly adds up all entitled components' price
through calculateTotalPriceOfComponents()
. Then If there is a contract with PriceRuleTC,
applies PriceRuleTC to dynamic kit level through calculateFinalPriceOfDynamicKit()
.
Here we don't consider the PriceTC.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of this class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
AbstractGetDynamicKitUnitPriceCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Long[] |
getApplicableTradingIds()
Returns the identifiers of the trading agreements that were used to
determine the prices for a catalog entry.
|
MonetaryAmount[] |
getApplicableTradingUnitPrices()
Returns the prices that were determined for each of the applied trading
agreements for a catalog entry.
|
CatEntryPrices[] |
getDKComponentPrices()
Returns the components' price info.
|
boolean |
getLockedPriceFromConfigurationXML()
Parse the configuration xml to get the total price if the price is locked
|
QuantityAmount |
getQuantity()
Gets quantity of the dynamic kit.
|
java.lang.Long |
getTradingId()
Returns the identifier of the trading agreement which was used to
calculate the best price.
|
MonetaryAmount |
getUnitPrice()
Returns the best unit price of the dynamic kit in the requested currency.
|
void |
performExecute()
The main logic to execute the command.
|
void |
setCurrency(java.lang.String currency)
Sets the desired currency to be used for the output price.
|
void |
setDefaultConfiguration(java.lang.String defaultConfiguration)
Set the configuration BOM xml of the PDC
|
void |
setDKComponentPrices(CatEntryPrices[] componentPrices)
Sets components of the dynamic kit.
|
void |
setDynamicKitId(java.lang.Long dynamicKitId)
Sets the dynamic kit id.
|
void |
setQuantity(QuantityAmount newQuantity)
Sets quantity of the dynamic kit.
|
void |
setTradingIds(java.lang.Long[] tradingIdsIn)
Sets the identifiers of the input trading agreements.
|
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, reset, 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 static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public AbstractGetDynamicKitUnitPriceCmdImpl()
public java.lang.Long[] getApplicableTradingIds()
GetDynamicKitUnitPriceCmd
getApplicableTradingIds
in interface GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd.getApplicableTradingIds()
public MonetaryAmount[] getApplicableTradingUnitPrices()
GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd.getApplicableTradingIds()
.getApplicableTradingUnitPrices
in interface GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd.getApplicableTradingUnitPrices()
public CatEntryPrices[] getDKComponentPrices()
GetDynamicKitUnitPriceCmd
getDKComponentPrices
in interface GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd.getDKComponentPrices()
public boolean getLockedPriceFromConfigurationXML()
getLockedPriceFromConfigurationXML
in interface GetDynamicKitUnitPriceCmd
public QuantityAmount getQuantity()
GetDynamicKitUnitPriceCmd
getQuantity
in interface GetDynamicKitUnitPriceCmd
public java.lang.Long getTradingId()
GetDynamicKitUnitPriceCmd
getTradingId
in interface GetDynamicKitUnitPriceCmd
GetDynamicKitUnitPriceCmd.getTradingId()
public MonetaryAmount getUnitPrice()
GetDynamicKitUnitPriceCmd
getUnitPrice
in interface GetDynamicKitUnitPriceCmd
setDKComponentPrices
is null or empty, the unit price will be null.GetDynamicKitUnitPriceCmd.getUnitPrice()
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 setCurrency(java.lang.String currency)
GetDynamicKitUnitPriceCmd
This input value is optional. The default value is obtained from another
source, such as
CurrencyManager#getCurrency(StoreAccessBean, String, Integer)
.
setCurrency
in interface GetDynamicKitUnitPriceCmd
currency
- The currency to look up the price. If null, the default value
will be used. If the supplied currency is empty or not
supported for the store, a default store currency will be
used.GetDynamicKitUnitPriceCmd.setCurrency(String)
public void setDefaultConfiguration(java.lang.String defaultConfiguration)
setDefaultConfiguration
in interface GetDynamicKitUnitPriceCmd
defaultConfiguration
- the configuration xml of the PDCpublic void setDKComponentPrices(CatEntryPrices[] componentPrices)
GetDynamicKitUnitPriceCmd
For CatEntryPrices
, you just need set catalog entry id and quantity.
setDKComponentPrices
in interface GetDynamicKitUnitPriceCmd
componentPrices
- The components of the dynamic kit. If null or empty, the unit price returned is zero.GetDynamicKitUnitPriceCmd.setDKComponentPrices(CatEntryPrices[])
public void setDynamicKitId(java.lang.Long dynamicKitId)
GetDynamicKitUnitPriceCmd
setDynamicKitId
in interface GetDynamicKitUnitPriceCmd
dynamicKitId
- The dynamic kit id can not be null.GetDynamicKitUnitPriceCmd.setDynamicKitId(Long)
public void setQuantity(QuantityAmount newQuantity)
GetDynamicKitUnitPriceCmd
setQuantity
in interface GetDynamicKitUnitPriceCmd
newQuantity
- the quantity of the dkpublic void setTradingIds(java.lang.Long[] tradingIdsIn)
GetDynamicKitUnitPriceCmd
Each member is entitled to a number of trading agreements (possibly zero). The trading agreements for each catalog entry are provided in one of two ways (from highest to lowest precedence):
ContractCmdUtil#getCurrentTradingAgreements(CommandContext)
.
This input value is optional. The default value is null.
setTradingIds
in interface GetDynamicKitUnitPriceCmd
tradingIdsIn
- The identifiers of the trading agreements to be used to
determine the prices. If null or empty, the current or
entitled trading agreements will be used as described above.GetDynamicKitUnitPriceCmd.setTradingIds(Long[])
public 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