com.ibm.commerce.negotiation.commands
Class BidUpdateFormCmdImpl

com.ibm.commerce.negotiation.commands.BidUpdateFormCmdImpl
All Implemented Interfaces:
AccCommand, BidUpdateFormCmd, ControllerCommand, ECCommand, Protectable

public class BidUpdateFormCmdImpl
implements BidUpdateFormCmd

Displays the Bid Update Form page after completing the following tasks:

  1. 1. Check whether auction is currently going on or not
  2. 2. Verifies that the auction is open cry or sealed bid
  3. 3. Verify that the user is authorized to participate in the bidding process.
  4. 4. Verifies that the bidder is qualified to bid.
  5. 5. Verify that the user has viewed the Auction rules. ==> ny pending
  6. 6. Generate a bid reference number.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String EC_BID_FORM_UPDATE_ERROR_VIEW_CMD
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.BidUpdateFormCmd
defaultCommandClassName, NAME
 
Constructor Summary
BidUpdateFormCmdImpl()
          BidUpdateFormCmdImpl default constructor.
 
Method Summary
protected  java.lang.Long getBidId()
          Returns the bid id for which a bid is to be updated.
protected  java.lang.String getBidType()
          Returns this bid type.
protected  java.lang.String getLocalErrorTaskName()
          Returns this command's error task name.
 AccessVector getResources()
          This method returns the resources resources accessed by this command It will return null if no resource if being accessed by this command.
protected  void handleException(java.lang.Exception e)
          Formats an ECException based on the input exception value.
protected  boolean isBidderQualified()
          Checks if current Bidder (user) is qualified to Bid on the current auction.
 boolean isReadyToCallExecute()
          Verifies that the this command is ready to be executed.
 void performExecute()
          Executes a bid form update task.
protected  void saveRequestProp(TypedProperty reqProp)
          Saves current request properties
protected  void setBidId(java.lang.String bidId)
          Sets the bid id for which a bid is to be updated.
protected  void setBidType(java.lang.String bidType)
          Sets this bid type.
protected  void setLocalErrorTaskName(java.lang.String errorTaskName)
          Sets this command's error task name
 void setRequestProperties(TypedProperty requestParam)
          Saves the Mandatory and optional command parameter values.
protected  boolean validBidderStatus(java.lang.String auctionRefKey)
          Checks that the bidder status is valid for the current auction.
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

EC_BID_FORM_UPDATE_ERROR_VIEW_CMD

public static final java.lang.String EC_BID_FORM_UPDATE_ERROR_VIEW_CMD
Constructor Detail

BidUpdateFormCmdImpl

public BidUpdateFormCmdImpl()
BidUpdateFormCmdImpl default constructor.
Method Detail

getBidId

protected java.lang.Long getBidId()
Returns the bid id for which a bid is to be updated.
Returns:
Long - Bid id

getBidType

protected java.lang.String getBidType()
Returns this bid type.
Returns:
java.lang.String - Regular bid, or auto bid

getLocalErrorTaskName

protected java.lang.String getLocalErrorTaskName()
Returns this command's error task name.
Returns:
tring - Error task name

getResources

public AccessVector getResources()
                          throws ECException
This method returns the resources resources accessed by this command It will return null if no resource if being accessed by this command.
Specified by:
getResources in interface ECCommand
Returns:
Object[] - an array of protectable resources

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:
ECException - - could be one of many diffrenet exceptions: ECApplicationException. RemoteException, CreateException, FinderException, or NamingException.

isBidderQualified

protected boolean isBidderQualified()
                             throws ECException
Checks if current Bidder (user) is qualified to Bid on the current auction.
Returns:
boolean = true if user is qualified, otherwise false
Throws:
ECException - - thorws an exception if an error occurred whilr executing the bidder qualification task.

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
Executes a bid form update task.
Specified by:
performExecute in interface ECCommand
Throws:
ECException - -

saveRequestProp

protected void saveRequestProp(TypedProperty reqProp)
Saves current request properties
Parameters:
reqProp - com.ibm.commerce.datatype.TypedProperty

setBidId

protected void setBidId(java.lang.String bidId)
                 throws InvalidParameterValueException
Sets the bid id for which a bid is to be updated.
Parameters:
bidId - String - String representation for bid id
Throws:
InvalidParameterValueException - - Throws an exception if the bid id is not numeric.

setBidType

protected void setBidType(java.lang.String bidType)
Sets this bid type.
Parameters:
bidType - java.lang.String - Regular or Auto bid type.

setLocalErrorTaskName

protected void setLocalErrorTaskName(java.lang.String errorTaskName)
Sets this command's error task name
Parameters:
errorTaskName - java.lang.String

setRequestProperties

public void setRequestProperties(TypedProperty requestParam)
                          throws ECApplicationException
Saves the Mandatory and optional command parameter values.
Specified by:
setRequestProperties in interface ControllerCommand
Parameters:
requestParam - TypedProperty - Request parameters table.
Throws:
ECApplicationException: - An exception is returned if the mandatory parameter (bid id) is missing, or invalid

validBidderStatus

protected boolean validBidderStatus(java.lang.String auctionRefKey)
                             throws ECException
Checks that the bidder status is valid for the current auction.
Parameters:
auctionRefKey - String - Auction Reference Key
Returns:
boolean - true if bidder status is valid, otherwise false.
Throws:
ECException - - Error creating CheckBidderStatusCmd command instance, or excuting the created command.