public class FloorPriceLookupCmdImpl extends TaskCommandImpl implements FloorPriceLookupCmd
Behaviour
1) Retrieve all the entitled Delegation Grid IDs from the contract entitlement utility based on TSR ID and store ID;
2) Resolve grid-memberGroup relationship:
1 * TSR -------- MemberGroupand
1 * Grid -------- MemberGroup(as participant);We proceed as follows:
3) Retrieve the floor price via GetContractUnitPriceCmd for given contract IDs, which are the delegation grid IDs obtained previously.
4) Partition all retrieved contract prices on member group and pricelist
1 * 1 * 1 * TSR -------- MemberGroup -------- PriceList -------- ContractPriceThe last relationship is one-to-one in the current requirements, but we offer the more general classification.
5) Select a price based on the following rules:
6) Validate the final selected price: if there is no price,
7) Round/convert price.
This command calls the following TaskCommands:
This command uses the following AccessBeans:Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
FloorPriceLookupCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected void | findDelegationGridIDs()
Tells the command to load (or re-load) it's delegation grid
|
java.lang.Long | getCatEntryId()
Returns the catEntryIds.
|
protected java.lang.String | getCatEntryType(java.lang.Long aCatEnryID)
Gets the catalog entry type.
|
java.lang.String | getConfigurationID()
Gets the configuration ID of a dynamic-kit
|
java.lang.String | getCurrency()
Returns the currency.
|
java.lang.String | getCustomPartnumber()
Returns the custom partnumber.
|
protected java.lang.Long[] | getEntitledTradingIds()
Gets the entitled delegation grid IDs for the TSR
|
boolean | getErrorMode()
Gets the flag to indicate if an exception will be thrown when the price cannot be found.
|
MonetaryAmount | getFloorPrice()
Gets the floor price for the given catalog entry with the requested currency.
|
protected java.lang.String | getInputInfo()
Gets the input information.
|
protected GetContractUnitPriceCmd | getPriceCmd()
Gets an instance of GetContractUnitPriceCmd.
|
QuantityAmount | getQuantity()
Gets a quantity object of the catalog entry.
|
java.lang.Integer | getStoreId()
Get the store ID
|
java.lang.Long | getTSRId()
Get the TSR ID
|
protected void | log(java.lang.String methodName, java.lang.String msg)
Log a message into the trace file.
|
void | performExecute()
Executes main business logic of the command.
|
void | reset()
This method is called after a command has been executed.
|
protected MonetaryAmount[] | retrievePriceForBundle()
Returns the price of the bundle passed in a MonetaryAmount array
|
protected MonetaryAmount[] | retrievePriceForDynamicKit()
Returns the price of the dynamic kit passed in a MonetaryAmount array
|
protected MonetaryAmount[] | retrievePriceForItem()
Returns the price of the item passed in a MonetartAmount array
|
protected MonetaryAmount | selectHighestPrice(java.util.List prices)
Select the highest price value among a set of prices.
|
protected MonetaryAmount | selectLowestPrice(java.util.List prices)
Select the lowest price value among a set of prices.
|
protected MonetaryAmount | selectPriceAmongMbrGrps(java.util.List selectedPricesForMbrGrps)
Select a price from a set of prices, each of which belongs to a specific member-group.
|
protected MonetaryAmount | selectPriceAmongPriceListsWithinMbrGrp(java.util.Map priceListTypeToPricesMap)
Select a price among a set of prices, each of which is associated with a specific pricelist.
|
protected MonetaryAmount | selectPriceWithinPriceList(java.util.List prices, java.lang.String aPriceListType)
Select a price among a set of prices which have the same pricelist.
|
void | setCatEntryId(java.lang.Long aCatEntryID)
Sets the catEntryIds.
|
void | setConfigurationID(java.lang.String aConfigID)
Sets the configuration ID, if this catalog entry is a DynamicKit.
|
void | setCurrency(java.lang.String aCurrency)
Sets the currency.
|
void | setCustomPartnumber(java.lang.String aCustomPartnumber)
Sets the custom partnumber whose floor price is to be retrieved.
|
void | setErrorMode(boolean anErrorMode)
Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional).
|
protected void | setFloorPrice(MonetaryAmount ma)
Sets the floor price for the given catalog entry
|
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)
Set the store ID
|
void | setTSRId(java.lang.Long aTsrId)
Set the TSR ID.
|
void | validateParameters()
Check mandatory parameters.
|
public static final java.lang.String COPYRIGHT
public java.lang.Long getCatEntryId()
public void setCatEntryId(java.lang.Long aCatEntryID)
public void setCustomPartnumber(java.lang.String aCustomPartnumber)
public java.lang.String getCustomPartnumber()
public java.lang.String getCurrency()
public void setCurrency(java.lang.String aCurrency)
public java.lang.Long getTSRId()
public void setTSRId(java.lang.Long aTsrId)
public java.lang.Integer getStoreId()
public void setStoreId(java.lang.Integer aStoreId)
public java.lang.String getConfigurationID()
public void setConfigurationID(java.lang.String aConfigID)
public void setErrorMode(boolean anErrorMode)
public boolean getErrorMode()
public QuantityAmount getQuantity()
public void setQuantity(QuantityAmount aQuantityAmount)
public MonetaryAmount getFloorPrice()
protected void setFloorPrice(MonetaryAmount ma)
public void performExecute() throws ECException
protected java.lang.String getCatEntryType(java.lang.Long aCatEnryID) throws javax.naming.NamingException, javax.ejb.CreateException, javax.ejb.FinderException, java.rmi.RemoteException
protected MonetaryAmount[] retrievePriceForBundle() throws javax.naming.NamingException, javax.ejb.CreateException, javax.ejb.FinderException, java.rmi.RemoteException, ECException
protected MonetaryAmount[] retrievePriceForDynamicKit() throws javax.naming.NamingException, javax.ejb.CreateException, javax.ejb.FinderException, java.rmi.RemoteException, ECException
protected MonetaryAmount[] retrievePriceForItem() throws javax.naming.NamingException, javax.ejb.CreateException, javax.ejb.FinderException, java.rmi.RemoteException, ECException
protected GetContractUnitPriceCmd getPriceCmd() throws ECException
protected MonetaryAmount selectPriceAmongMbrGrps(java.util.List selectedPricesForMbrGrps)
protected MonetaryAmount selectPriceAmongPriceListsWithinMbrGrp(java.util.Map priceListTypeToPricesMap)
protected MonetaryAmount selectPriceWithinPriceList(java.util.List prices, java.lang.String aPriceListType)
protected MonetaryAmount selectHighestPrice(java.util.List prices)
protected MonetaryAmount selectLowestPrice(java.util.List prices)
protected java.lang.Long[] getEntitledTradingIds()
protected void findDelegationGridIDs() throws ECSystemException, ECApplicationException
public void reset()
protected java.lang.String getInputInfo()
public void validateParameters() throws ECException
protected void log(java.lang.String methodName, java.lang.String msg)