com.ibm.commerce.negotiation.commands
Class CalculateBestBidCmdImpl

com.ibm.commerce.negotiation.commands.CalculateBestBidCmdImpl
All Implemented Interfaces:
CalculateBestBidCmd, ECCommand

public class CalculateBestBidCmdImpl
implements CalculateBestBidCmd

Calculates the Highest Winning Bid and Lowest Winning Bid (aka Best Bid).


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.CalculateBestBidCmd
defaultCommandClassName, NAME
 
Constructor Summary
CalculateBestBidCmdImpl()
          CalculateBestBidCmdImpl default constructor.
 
Method Summary
 java.lang.Long getHighestWinningBid()
          Gets the highest winning bid id for the specified auction.
 java.lang.Long getLowestWinningBid()
          Gets the lowest winning bid (a.k.a Best Bid) id for the specified auction
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()
          Determines the current highest and lowest winning bids for the specified auction.
 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 setAuctionId(java.lang.Long id)
          Sets the current auction Id value,
 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.
 
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
Constructor Detail

CalculateBestBidCmdImpl

public CalculateBestBidCmdImpl()
CalculateBestBidCmdImpl default constructor.
Method Detail

getHighestWinningBid

public java.lang.Long getHighestWinningBid()
Gets the highest winning bid id for the specified auction.
Specified by:
getHighestWinningBid in interface CalculateBestBidCmd
Returns:
Long - Highest winning bid id. A null value is returned when there is no highest winning bid.

getLowestWinningBid

public java.lang.Long getLowestWinningBid()
Gets the lowest winning bid (a.k.a Best Bid) id for the specified auction
Specified by:
getLowestWinningBid in interface CalculateBestBidCmd
Returns:
String - Lowest winning bid id. A null value is returned when there is no lowest winning bid.

handleException

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

isReadyToCallExecute

public boolean isReadyToCallExecute()
Verifies that the this command is ready to be executed.
Returns:
boolean =true if command is ready, otherwise false.

performExecute

public void performExecute()
                    throws ECException
Determines the current highest and lowest winning bids for the specified auction.
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()
Resets this command to allow for future reuse.

setActiveBids

public void setActiveBids(java.util.Vector bids)
Sets the list of active bids to be processed.
Specified by:
setActiveBids in interface CalculateBestBidCmd
Parameters:
bids - Vector - Active bids list

setAuctionId

public void setAuctionId(java.lang.Long id)
Sets the current auction Id value,
Specified by:
setAuctionId in interface CalculateBestBidCmd
Parameters:
id - Long - Auction Id

setErrorTaskName

public void setErrorTaskName(java.lang.String errorTaskName)
Set error task name that will be returned by the exceptions.
Specified by:
setErrorTaskName in interface CalculateBestBidCmd
Parameters:
errorTaskName - java.lang.String

setQuantityOnAuction

public void setQuantityOnAuction(java.lang.Double quantity)
Set the quantity available for auction.
Specified by:
setQuantityOnAuction in interface CalculateBestBidCmd
Parameters:
quantity - Double - Quantity available for auction.