java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.negotiation.commands.DetermineWinnersCmdImpl
Determines the winning auto-bids's next bidding price for an auction.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT Copyright statement. |
protected
java.util.Vector |
winners A list of auto bids that are winning. |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.negotiation.commands. DetermineWinnersCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
DetermineWinnersCmdImpl() DetermineWinnersCmdImpl default constructor. |
Method Summary | |
---|---|
protected
java.math.BigDecimal |
calculateNextBidValue(java.math.BigDecimal currMaxBidValue) Calculates the next bid value based on the current maximum bid value and the bid rule range/increment. |
protected
BidDataLight |
findNextLoser(int start, double availQuant) Given the index of a winning auto bid, to find the closest loser(the runner-up) which is defined as the bid that is going to win if this winning autobid doesn't exist. |
protected
java.util.Vector |
getActiveBids() Get the list of active bids for processing. |
protected
ControlRuleAccessBean |
getBidRule() A singleton method for retrieving Control Rule Access Bean. |
protected
java.lang.Long |
getBidRuleId() Gets the auction's Bid Rule Id. |
protected
java.math.BigDecimal |
getDefaultBidIncrement() Return a default bid increment value. |
protected
java.math.BigDecimal |
getDefaultMinBidValue() Return a default minimum bid value. |
protected
java.lang.String |
getErrorTaskName() returns error task name that will be returned by the exceptions. |
protected
java.lang.Double |
getQuantityOnAuction() Get the quantity available for auction. |
java.util.Vector |
getWinners() Get the list of auto bids that are winning. |
protected
void |
handleException(java.lang.Exception e) Formats an ECException based on the input exception value. |
boolean |
isReadyToCallExecute() Verifies that the this command is ready to be executed. |
void |
performExecute() For all active auto bids, determine if a new bid value should be submitted on behalf of the auto bid, in order to put the auto bid in a winning position. |
void |
reset() Resets this command to allow for future reuse. |
void |
setActiveBids(java.util.Vector bids) Sets the list of active bids to be processed. |
void |
setBidRuleId(java.lang.Long id) Sets the auction Bid Rule id |
void |
setErrorTaskName(java.lang.String errorTaskName) Set error task name that will be returned by the exceptions. |
void |
setQuantityOnAuction(java.lang.Double quantity) Set the quantity available for auction. |
void |
setWinners(java.util.Vector newWinners) Set the list of autobids that are currently winning. |
static java.lang.String |
traceBid(BidDataLight bid) Return a string that shows the information about a bid. |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties,
validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected java.util.Vector winners
Constructor Detail |
---|
public DetermineWinnersCmdImpl()
Method Detail |
---|
protected java.math.BigDecimal calculateNextBidValue(java.math.BigDecimal currMaxBidValue) throws ECException
ECException
- - Invalid input bid value or, error during bid control rule bean
lookup.protected BidDataLight findNextLoser(int start, double availQuant)
start
- intavailQuant
- doubleprotected java.util.Vector getActiveBids()
protected ControlRuleAccessBean getBidRule() throws java.lang.Exception
java.lang.Exception
- - FinderException or data base retrieval
exception.protected java.lang.Long getBidRuleId()
protected java.math.BigDecimal getDefaultBidIncrement()
protected java.math.BigDecimal getDefaultMinBidValue()
protected java.lang.String getErrorTaskName()
protected java.lang.Double getQuantityOnAuction()
public java.util.Vector getWinners()
protected void handleException(java.lang.Exception e) throws ECException
e
- Exception - The exception instance to be formatted.ECException
public boolean isReadyToCallExecute()
isReadyToCallExecute
in class
AbstractECTargetableCommand
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
public void reset()
reset
in class
AbstractECTargetableCommand
public void setActiveBids(java.util.Vector bids)
setActiveBids
in interface
DetermineWinnersCmd
bids
- Vector - Active bids listpublic void setBidRuleId(java.lang.Long id)
setBidRuleId
in interface
DetermineWinnersCmd
id
- Long - Bid rule idpublic void setErrorTaskName(java.lang.String errorTaskName)
setErrorTaskName
in interface
DetermineWinnersCmd
errorTaskName
- java.lang.Stringpublic void setQuantityOnAuction(java.lang.Double quantity)
setQuantityOnAuction
in interface
DetermineWinnersCmd
quantity
- Double - Quantity available for
auction.public void setWinners(java.util.Vector newWinners)
setWinners
in interface
DetermineWinnersCmd
newWinners
- java.util.Vectorpublic static java.lang.String traceBid(BidDataLight bid)
bid
- BidDataLight