com.ibm.commerce.negotiation.commands
Class OpenCryBidsTaskCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.negotiation.commands.ProcessTaskCmdImpl
                          |
                          +--com.ibm.commerce.negotiation.commands.OpenCryBidsTaskCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, OpenCryBidsTaskCmd, ProcessTaskCmd, TaskCommand

public class OpenCryBidsTaskCmdImpl
extends ProcessTaskCmdImpl
implements OpenCryBidsTaskCmd

Process Open Cry Bids (submitted by users).

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
protected  java.math.BigDecimal newBestBidPrice
           
protected  java.math.BigDecimal oldBestBidPrice
           
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.negotiation.commands. OpenCryBidsTaskCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
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 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
 
Methods inherited from interface com.ibm.commerce.negotiation.commands. OpenCryBidsTaskCmd
getActiveBids
 
Methods inherited from interface com.ibm.commerce.negotiation.commands. ProcessTaskCmd
setDataHandle, setErrorTaskName
 

Field Detail
public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

oldBestBidPrice

protected java.math.BigDecimal oldBestBidPrice

newBestBidPrice

protected java.math.BigDecimal newBestBidPrice
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
Overrides:
performExecute in class AbstractECTargetableCommand
ECException

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