com.ibm.commerce.negotiation.commands
Class OpenCryBidsTaskCmdImpl

com.ibm.commerce.negotiation.commands.ProcessTaskCmdImpl
  |
  +--com.ibm.commerce.negotiation.commands.OpenCryBidsTaskCmdImpl
All Implemented Interfaces:
ECCommand, OpenCryBidsTaskCmd, ProcessTaskCmd

public class OpenCryBidsTaskCmdImpl
extends ProcessTaskCmdImpl
implements OpenCryBidsTaskCmd

Process Open Cry Bids (submitted by users).


Field Summary
static java.lang.String COPYRIGHT
           
protected  java.math.BigDecimal newBestBidPrice
           
protected  java.math.BigDecimal oldBestBidPrice
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.OpenCryBidsTaskCmd
defaultCommandClassName, NAME
 
Constructor Summary
OpenCryBidsTaskCmdImpl()
          ProcessDutchBidsCmdImpl constructor.
 
Method Summary
protected  java.util.Vector calcWinningBidsRange()
          Determine the highest and lowest winning bids reference number.
 java.math.BigDecimal getNewBestBidPrice()
          Return the best bid price after this task is executed.
 java.math.BigDecimal getOldBestBidPrice()
          Return the best bid price before this task is executed.
 void performExecute()
          Currently, determines highest and lowest (best) winning bids, updates the current auction if necessary, and notifies bidders about any overriden bids.
 void reset()
          Reset the command's instance variables for the reuse of this command.
protected  java.math.BigDecimal retrieveBestBidVal(java.lang.Long bestBidId)
          Lookup the bid specified by the bid id, and return its current price.
protected  void setNewBestBidPrice(java.math.BigDecimal newNewBestBidPrice)
          Set the new best bid price.
protected  void setOldBestBidPrice(java.math.BigDecimal newOldBestBidPrice)
          Set old best bid price.
 
Methods inherited from class com.ibm.commerce.negotiation.commands.ProcessTaskCmdImpl
getActiveBids, getAuction, getAuctionId, getDefaultBestBidValue, getDefaultBidCount, getErrorTaskName, handleException, isReadyToCallExecute, setActiveBids, setDataHandle, setErrorTaskName
 
Methods inherited from interface com.ibm.commerce.negotiation.commands.OpenCryBidsTaskCmd
getActiveBids
 
Methods inherited from interface com.ibm.commerce.negotiation.commands.ProcessTaskCmd
setDataHandle, setErrorTaskName
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

newBestBidPrice

protected java.math.BigDecimal newBestBidPrice

oldBestBidPrice

protected java.math.BigDecimal oldBestBidPrice
Constructor Detail

OpenCryBidsTaskCmdImpl

public OpenCryBidsTaskCmdImpl()
ProcessDutchBidsCmdImpl constructor.
Method Detail

calcWinningBidsRange

protected java.util.Vector calcWinningBidsRange()
                                         throws java.lang.Exception
Determine the highest and lowest winning bids reference number.
Returns:
Vector - A two element vector containing highest (first) and lowest (second) winning bid ids.
Throws:
java.lang.Exception - - thorws an exception if an error occurred while executing the calculate best bid task,

getNewBestBidPrice

public java.math.BigDecimal getNewBestBidPrice()
Return the best bid price after this task is executed.
Specified by:
getNewBestBidPrice in interface OpenCryBidsTaskCmd
Returns:
java.math.BigDecimal

getOldBestBidPrice

public java.math.BigDecimal getOldBestBidPrice()
Return the best bid price before this task is executed.
Specified by:
getOldBestBidPrice in interface OpenCryBidsTaskCmd
Returns:
java.math.BigDecimal

performExecute

public void performExecute()
                    throws ECException
Currently, determines highest and lowest (best) winning bids, updates the current auction if necessary, and notifies bidders about any overriden bids.
Specified by:
performExecute in interface ECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

reset

public void reset()
Reset the command's instance variables for the reuse of this command.
Overrides:
reset in class ProcessTaskCmdImpl

retrieveBestBidVal

protected java.math.BigDecimal retrieveBestBidVal(java.lang.Long bestBidId)
                                           throws java.lang.Exception
Lookup the bid specified by the bid id, and return its current price.
Parameters:
bestBidId - Long - Best Bid Id.
Returns:
BigDecimal - Current Bid Price for valid Bid Ids, otherwise default best bid price.
Throws:
java.lang.Exception - - Error during bid retrieval operation.

setNewBestBidPrice

protected void setNewBestBidPrice(java.math.BigDecimal newNewBestBidPrice)
Set the new best bid price.
Parameters:
newNewBestBidPrice - java.math.BigDecimal

setOldBestBidPrice

protected void setOldBestBidPrice(java.math.BigDecimal newOldBestBidPrice)
Set old best bid price.
Parameters:
newOldBestBidPrice - java.math.BigDecimal