com.ibm.commerce.negotiation.commands
Class AutoBidsTaskCmdImpl

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

public class AutoBidsTaskCmdImpl
extends ProcessTaskCmdImpl
implements AutoBidsTaskCmd

The task command that computes and updates the prices of the bids that belong to auto-bids for a specified auction.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String EC_AUTOBIDS_TASK_ERROR_VIEW_CMD
           
protected  java.util.Vector winners
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.AutoBidsTaskCmd
defaultCommandClassName, NAME
 
Constructor Summary
AutoBidsTaskCmdImpl()
          AutoBidsTaskCmdImpl constructor.
 
Method Summary
protected  double allocateQuantity()
          Allocates the quantity on auction among the specified sorted list of bids.
protected  int calcExpectedBidCount()
          Calculates the expected number of bids to be retrieved required to fully allocate the auction quantity.
protected  void determineWinnersNextBidPrices()
          Determines the current potential bid winners's next bid prices for the current auction.
protected  java.util.Vector getWinners()
          Get the winner list.
protected  void handleException(java.lang.Exception e)
          Formats an ECException based on the input exception value.
 void performExecute()
          Auto Bids processing task.
 void reset()
          reset the command, so that it can be reused.
protected  java.util.Vector retrieveActiveBids(int count)
          Retrieve the specified number of active bids sorted by bid price/upper limit (desc), quantity (desc) and creation time (asc)
protected  void updateAuction(long auctionBookKeepTime)
          Update current auction highest/lowest winning bids, Lock flag and time.
 
Methods inherited from class com.ibm.commerce.negotiation.commands.ProcessTaskCmdImpl
getActiveBids, getAuction, getAuctionId, getDefaultBestBidValue, getDefaultBidCount, getErrorTaskName, isReadyToCallExecute, setActiveBids, setDataHandle, setErrorTaskName
 
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

EC_AUTOBIDS_TASK_ERROR_VIEW_CMD

public static final java.lang.String EC_AUTOBIDS_TASK_ERROR_VIEW_CMD

winners

protected java.util.Vector winners
Constructor Detail

AutoBidsTaskCmdImpl

public AutoBidsTaskCmdImpl()
AutoBidsTaskCmdImpl constructor.
Method Detail

allocateQuantity

protected double allocateQuantity()
                           throws java.lang.Exception
Allocates the quantity on auction among the specified sorted list of bids.
Parameters:
bids - Vector -
Returns:
double - Remaining quantity after a complete round of allocation on target bids.

calcExpectedBidCount

protected int calcExpectedBidCount()
                            throws java.lang.Exception
Calculates the expected number of bids to be retrieved required to fully allocate the auction quantity.
Returns:
int - Expected number of bids to retrieve
Throws:
ECException - - Control Rule lookup error.

determineWinnersNextBidPrices

protected void determineWinnersNextBidPrices()
                                      throws java.lang.Exception
Determines the current potential bid winners's next bid prices for the current auction.
Throws:
java.lang.Exception - - throws an exception when encounters an error during Determine Winner task processing.

getWinners

protected java.util.Vector getWinners()
Get the winner list.
Returns:
java.util.Vector

handleException

protected void handleException(java.lang.Exception e)
                        throws ECException
Formats an ECException based on the input exception value.
Overrides:
handleException in class ProcessTaskCmdImpl
Parameters:
e - Exception - The exception instance to be formatted.
Throws:
ECException - - could be one of many diffrenet exceptions: ECApplicationException. RemoteException, CreateException, FinderException, or NamingException.

performExecute

public void performExecute()
                    throws ECException
Auto Bids processing task.
Specified by:
performExecute in interface ECCommand
Throws:
ECException - -

reset

public void reset()
reset the command, so that it can be reused.
Overrides:
reset in class ProcessTaskCmdImpl

retrieveActiveBids

protected java.util.Vector retrieveActiveBids(int count)
                                       throws ECException
Retrieve the specified number of active bids sorted by bid price/upper limit (desc), quantity (desc) and creation time (asc)
Parameters:
count - int - Number of active bids to retrieve. A zero count implies all active bids.
Returns:
Vector - A list of currently active bids for the current auction.
Throws:
ECException - - Exception on retrieving bids.

updateAuction

protected void updateAuction(long auctionBookKeepTime)
                      throws java.lang.Exception
Update current auction highest/lowest winning bids, Lock flag and time.
Parameters:
auctionBookKeepTime - long - Time of auction update.
Throws:
java.lang.Exception - - Exception on Auction update operation.