com.ibm.commerce.negotiation.commands
Class ProcessControllerCmdImpl

com.ibm.commerce.negotiation.commands.ProcessControllerCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ProcessControllerCmd, Protectable
Direct Known Subclasses:
ProcessAutoBidsCmdImpl, ProcessDutchBidsCmdImpl, ProcessOpenCryBidsCmdImpl

public abstract class ProcessControllerCmdImpl
implements ProcessControllerCmd

Process controller command. Implements common behavior for the bids processing commands.


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from interface com.ibm.commerce.negotiation.commands.ProcessControllerCmd
NAME
 
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
 
Constructor Summary
ProcessControllerCmdImpl()
          Default constructor.
 
Method Summary
protected  boolean dispatchJob(java.lang.Runnable runner, java.lang.String threadPoolType, java.lang.Long auctionId)
          Dispatch a job using a thread from the specified scheduler thread pool
 java.util.Hashtable getAllExceptions()
          Get a list of all the exceptions generated by this process.
protected  java.lang.String getErrorTaskName()
          Returns this command's error task name.
protected  void handleException(java.lang.Exception e)
          Formats and saves an ECException based on the input exception value.
 boolean isReadyToCallExecute()
          Verifies that the this command is ready to be executed.
 void reset()
          Reset current command to its initial state to allow for reuse.
protected  java.util.Vector retrieveActiveAuctions(java.lang.String type, com.ibm.commerce.negotiation.commands.SortingAttribute sortBy)
          Retrieve all active auctions for the specified type and sort them by the specified sorting attribute.
 void setErrorTaskName(java.lang.String errorTaskName)
          Sets this command's error task name
 void setRequestProperties(TypedProperty requestParam)
          Saves the optional command parameter values.
 
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, getResources, getStoreId, getUser, getUserId, performExecute, 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
Constructor Detail

ProcessControllerCmdImpl

public ProcessControllerCmdImpl()
Default constructor.
Method Detail

dispatchJob

protected boolean dispatchJob(java.lang.Runnable runner,
                              java.lang.String threadPoolType,
                              java.lang.Long auctionId)
                       throws java.lang.Exception
Dispatch a job using a thread from the specified scheduler thread pool
Parameters:
runner - java.lang.Runnable
threadPoolType - String
auctionId - Long
Returns:
true if the job is dispatched successfully, false otherwise.
Throws:
ECApplicationException - - Exception starting a new thread or the scheduler has not started.

getAllExceptions

public java.util.Hashtable getAllExceptions()
Get a list of all the exceptions generated by this process.
Specified by:
getAllExceptions in interface ProcessControllerCmd
Returns:
Hashtable - Exceptions table, or null if no exceptions.

getErrorTaskName

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

handleException

protected void handleException(java.lang.Exception e)
Formats and saves an ECException based on the input exception value.
Parameters:
e - Exception - The exception instance to be formatted.

isReadyToCallExecute

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

reset

public void reset()
Reset current command to its initial state to allow for reuse.

retrieveActiveAuctions

protected java.util.Vector retrieveActiveAuctions(java.lang.String type,
                                                  com.ibm.commerce.negotiation.commands.SortingAttribute sortBy)
                                           throws java.lang.Exception
Retrieve all active auctions for the specified type and sort them by the specified sorting attribute. An active auction is Current, has Active bids and a book keeping time earlier than one of the active bid.
Parameters:
type - String - Auction type. param sortBy Sorting Attribute(s) - Auction list sorting criteria.
Returns:
Vector - A list of currently active auctions of the specified type.
Throws:
java.lang.Exception - - Exception on retrieving auctions.

setErrorTaskName

public void setErrorTaskName(java.lang.String errorTaskName)
Sets this command's error task name
Specified by:
setErrorTaskName in interface ProcessControllerCmd
Parameters:
errorTaskName - java.lang.String

setRequestProperties

public void setRequestProperties(TypedProperty requestParam)
                          throws ECException
Saves the optional command parameter values.
Specified by:
setRequestProperties in interface ControllerCommand
Parameters:
TypedPropery - requestParam - Request properties
Throws:
ECApplicationException: - An exception is returned if any of the mandatory parameters are missing, or invalid