com.ibm.commerce.negotiation.commands
Class CheckBidControlCmdImpl

com.ibm.commerce.negotiation.commands.CheckBidControlCmdImpl
All Implemented Interfaces:
CheckBidControlCmd, ECCommand, TaskCommand

public class CheckBidControlCmdImpl
implements CheckBidControlCmd

Task command verifies that a bid complies with the auction rules.


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.CheckBidControlCmd
defaultCommandClassName, NAME
 
Constructor Summary
CheckBidControlCmdImpl()
          CheckBidControlCmdImpl constructor.
 
Method Summary
 java.lang.String getBidQuantity()
          Gets the bid quantity.
 java.lang.String getBidValue()
          Gets the bid value.
 java.lang.String getErrorTaskName()
          Gets the error task name; if null, returns the default error task name.
 java.lang.String getLowestWinningBid()
          Gets the lowest winning bid.
 boolean isBidOkay()
          Returns the status of bid-control compliance test.
 boolean isReadyToCallExecute()
          Verifies that the this command is ready to be executed.
 void performExecute()
          Determines whether the bid complies with the applicable bid control rules.
 void setAuction(AuctionAccessBean auction)
          Sets the auction access bean.
protected  void setBidOkay(boolean newBidOkay)
          Sets a flag indicating whether the bid complies with its control rules.
 void setBidQuantity(java.lang.String newBidQuantity)
          Sets the bid quantity.
 void setBidValue(java.lang.String newBidValue)
          Sets the bid value.
 void setErrorTaskName(java.lang.String newErrorTaskName)
          Sets the error task name.
 void setLowestWinningBid(java.lang.String newLowestWinningBid)
          Sets the lowest winning bid.
protected  void validateAuction()
          Validates the bid (quantity and value) against the auction specification.
 void validateParameters()
          Determines whether required parameters have been supplied.
 
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
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

CheckBidControlCmdImpl

public CheckBidControlCmdImpl()
CheckBidControlCmdImpl constructor.
Method Detail

getBidQuantity

public java.lang.String getBidQuantity()
Gets the bid quantity.
Specified by:
getBidQuantity in interface CheckBidControlCmd
Returns:
The bid quantity.

getBidValue

public java.lang.String getBidValue()
Gets the bid value.
Specified by:
getBidValue in interface CheckBidControlCmd
Returns:
The bid value.

getErrorTaskName

public java.lang.String getErrorTaskName()
Gets the error task name; if null, returns the default error task name.
Specified by:
getErrorTaskName in interface CheckBidControlCmd
Returns:
The error task name.

getLowestWinningBid

public java.lang.String getLowestWinningBid()
Gets the lowest winning bid.
Specified by:
getLowestWinningBid in interface CheckBidControlCmd
Returns:
The lowest winning bid.

isBidOkay

public boolean isBidOkay()
Returns the status of bid-control compliance test.
Specified by:
isBidOkay in interface CheckBidControlCmd
Returns:
true if the bid control compliance test is met, false otherwise.

isReadyToCallExecute

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

performExecute

public void performExecute()
                    throws ECException
Determines whether the bid complies with the applicable bid control rules.
Specified by:
performExecute in interface ECCommand
Throws:
ECException - if any problems are encountered.

setAuction

public void setAuction(AuctionAccessBean auction)
Sets the auction access bean.
Specified by:
setAuction in interface CheckBidControlCmd
Parameters:
auction - AuctionAcessBean

setBidOkay

protected void setBidOkay(boolean newBidOkay)
Sets a flag indicating whether the bid complies with its control rules.
Parameters:
newBidOkay - The flag indicating whether the bid complies with its control rules.

setBidQuantity

public void setBidQuantity(java.lang.String newBidQuantity)
                    throws ECApplicationException
Sets the bid quantity.
Specified by:
setBidQuantity in interface CheckBidControlCmd
Parameters:
newBidQuantity - The bid quantity.
Throws:
ECApplicationException - on invalid number.

setBidValue

public void setBidValue(java.lang.String newBidValue)
                 throws ECApplicationException
Sets the bid value.
Specified by:
setBidValue in interface CheckBidControlCmd
Parameters:
newBidValue - The bid value.
Throws:
ECApplicationException - on invalid number.

setErrorTaskName

public void setErrorTaskName(java.lang.String newErrorTaskName)
Sets the error task name.
Specified by:
setErrorTaskName in interface CheckBidControlCmd
Parameters:
newErrorTaskName - The error task name.

setLowestWinningBid

public void setLowestWinningBid(java.lang.String newLowestWinningBid)
Sets the lowest winning bid.
Specified by:
setLowestWinningBid in interface CheckBidControlCmd
Parameters:
newLowestWinningBid - The lowest winning bid.

validateAuction

protected void validateAuction()
                        throws java.lang.Exception
Validates the bid (quantity and value) against the auction specification.
Throws:
ECException - if auction not in database.

validateParameters

public void validateParameters()
                        throws ECException
Determines whether required parameters have been supplied.
Specified by:
validateParameters in interface ECCommand
Throws:
ECException - if a parameter is null.