com.ibm.commerce.inventory.scheduled.commands
Class ReleaseExpiredAllocationsCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.inventory.scheduled.commands.ReleaseExpiredAllocationsCmdImpl
-
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReleaseExpiredAllocationsCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class ReleaseExpiredAllocationsCmdImpl extends ControllerCommandImpl implements ReleaseExpiredAllocationsCmd
This is the default implementation of the controller commandReleaseExpiredAllocationsCmd
interface.Input parameters:
- storeId
- the store id.
Behaviour:
It is invoked by the WebSphere Commerce scheduler, this command releases order item allocations for a given store that have exceeded their expiration times. If ATP is enable, then:- If the item has been allocated then it calls task command
DeallocateExistingInventoryCmd
. - else, if the item has been backordered, it calls task command
DeallocateExpectedInventoryCmd
.
It utilizes the following access beans:
Task commands called:
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.commerce.inventory.scheduled.commands.ReleaseExpiredAllocationsCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description ReleaseExpiredAllocationsCmdImpl()
This is the class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AccessVector
getResources()
This method returns command resources for access control.boolean
isGeneric()
This method returns false if this command can't be run by a generic user.boolean
isReadyToCallExecute()
This method returns true if this command is ready to be executed.void
performExecute()
This method releases order item allocations for a given store that have exceeded their expiration times.void
reset()
This method resets instance variables.void
setRequestProperties(TypedProperty reqParms)
This method sets the request properties of this command implementation.void
validateParameters()
This method extracts and validates the input parameters of this command implementation.-
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
-
-
Constructor Detail
-
ReleaseExpiredAllocationsCmdImpl
public ReleaseExpiredAllocationsCmdImpl()
This is the class constructor.
-
-
Method Detail
-
getResources
public AccessVector getResources() throws ECException
This method returns command resources for access control.- Specified by:
getResources
in interfaceECCommand
- Overrides:
getResources
in classAbstractECTargetableCommand
- Returns:
- an AccessVector containing a StoreAccessBean.
- Throws:
ECException
- for failures obtaining the StoreAccessBean
-
isGeneric
public boolean isGeneric()
This method returns false if this command can't be run by a generic user.- Specified by:
isGeneric
in interfaceControllerCommand
- Overrides:
isGeneric
in classControllerCommandImpl
- Returns:
- Return false to indicate that this command cannot be run by a generic user.
-
isReadyToCallExecute
public boolean isReadyToCallExecute()
This method returns true if this command is ready to be executed.- Specified by:
isReadyToCallExecute
in interfacecom.ibm.websphere.command.Command
- Overrides:
isReadyToCallExecute
in classAbstractECTargetableCommand
- Returns:
- Return true to indicate that this command is ready to be executed.
-
performExecute
public void performExecute() throws ECException
This method releases order item allocations for a given store that have exceeded their expiration times. If it cannot commit the transaction started by the command, it throws the ECSystemException with ECMessage.STA_COMMIT_DB_FAILURE. If the OrderJDBCHelper.findStaleOrderItems has SQL exception,it throws com.ibm.commerce.exception.ECSystemException with ECMessage._ERR_FINDER_EXCEPTION.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException.
ECException
-
reset
public void reset()
This method resets instance variables.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
setRequestProperties
public void setRequestProperties(TypedProperty reqParms) throws ECApplicationException
This method sets the request properties of this command implementation.- Specified by:
setRequestProperties
in interfaceControllerCommand
- Overrides:
setRequestProperties
in classControllerCommandImpl
- Parameters:
reqParms
- input request properties.- Throws:
ECApplicationException
- for failures
-
validateParameters
public void validateParameters() throws ECException
This method extracts and validates the input parameters of this command implementation. It checks the mandatory parameters.Parameters
- storeId
- the store id
- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
com.ibm.commerce.exception.ECException.
- If the store id has not been specified, it throws com.ibm.commerce.exception.ECSystemException with ECMessage._ERR_DIDNT_SET_MERCHANTECException
- storeId
-
-