com.ibm.commerce.catalog.commands
Class ResolveSkuCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.catalog.commands.ResolveSkuCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, ResolveSkuCmd, TaskCommand

public class ResolveSkuCmdImpl
extends TaskCommandImpl
implements ResolveSkuCmd

This command first determines the type of CatalogEntry that is provided as input to the command. If it is a Package, then the PackageResolveSku command is called. If it is a Product, then first the command determines the distinct Attributes that are needed to resolve the Product into an orderable Item. For each of these Attributes, the command ensures that an appropriate AttributeValue has been supplied as input. Once these Attribute name-value pairs have been identified, the command resolves this information into an ItemId that represents the orderable Item. Also, the command sets the ItemSpecId to be the ItemSpecification for the resolved CatalogEntry. If Attributes are missing or are incorrect, the ErrorMissingAttributeErrorCmd or ErrorProductAttributeErrorCmd error tasks are launched respectively. If the type of CatalogEntry that is provided as input to the command is neither a Package nor a Product, then the command returns and sets the ItemId to be equal to the ProductId.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.catalog.commands. ResolveSkuCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
ResolveSkuCmdImpl()
          No value constructor.
 
Method Summary
protected  java.util.Hashtable getAttributeNVPs()
          Returns the hashtable that represents the Attribute names and values that will be used to perform the Item resolution.
 java.lang.Long getItemId()
          Returns the ItemId that represents the primary key of the resolved Item
 java.lang.Long getItemSpecId()
          Returns the ItemSpecId that represents the ItemSpecification identifier for the resolved Item.
protected  java.lang.Long getProductId()
          Returns the ProductId that represents the primary key of the CatalogEntry that is to be resolved,
 boolean isReadyToCallExecute()
          This method is called by the Targettable Command frame work before the execution of the command.
 void performExecute()
          The business logic for this command.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
 void setAttributeNVPs(java.util.Hashtable ahshAttrNVPs)
          Sets the hashtable that represents the Attribute names and values that will be used to perform the Item resolution.
protected  void setItemId(java.lang.Long anItemNumber)
          Sets the ItemId that represents the primary key of the resolved Item
protected  void setItemSpecId(java.lang.Long anItemSpecId)
          Sets the ItemSpecId that represents the ItemSpecification identifier for the resolved Item.
 void setProductId(java.lang.Long anProductNumber)
          Sets the ProductId that represents the primary key of the CatalogEntry that is to be resolved,
 void validateParameters()
          Performs parameter checking.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
The internal copyright field.
See Also:
Constant Field Values
Constructor Detail

ResolveSkuCmdImpl

public ResolveSkuCmdImpl()
No value constructor.
Method Detail

getAttributeNVPs

protected java.util.Hashtable getAttributeNVPs()
Returns the hashtable that represents the Attribute names and values that will be used to perform the Item resolution.
Returns:
java.util.Hashtable

getItemId

public java.lang.Long getItemId()
Returns the ItemId that represents the primary key of the resolved Item
Specified by:
getItemId in interface ResolveSkuCmd
Returns:
java.lang.Long

getItemSpecId

public java.lang.Long getItemSpecId()
Returns the ItemSpecId that represents the ItemSpecification identifier for the resolved Item.
Specified by:
getItemSpecId in interface ResolveSkuCmd
Returns:
java.lang.Long

getProductId

protected java.lang.Long getProductId()
Returns the ProductId that represents the primary key of the CatalogEntry that is to be resolved,
Returns:
java.lang.Long

isReadyToCallExecute

public boolean isReadyToCallExecute()
Description copied from class: AbstractECTargetableCommand
This method is called by the Targettable Command frame work before the execution of the command. The default implementation is to return true.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
Description copied from class: AbstractECTargetableCommand
The business logic for this command. This method should be overwritten by all command writers. Command writers should call super.performExecute() as the first line in their method.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
ECException

reset

public void reset()
Description copied from class: AbstractECTargetableCommand
This method should be called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class AbstractECTargetableCommand

setAttributeNVPs

public void setAttributeNVPs(java.util.Hashtable ahshAttrNVPs)
Sets the hashtable that represents the Attribute names and values that will be used to perform the Item resolution.
Specified by:
setAttributeNVPs in interface ResolveSkuCmd
Parameters:
ahshAttrNVPs - java.util.Hashtable

setItemId

protected void setItemId(java.lang.Long anItemNumber)
Sets the ItemId that represents the primary key of the resolved Item
Parameters:
anItemNumber - java.lang.Long

setItemSpecId

protected void setItemSpecId(java.lang.Long anItemSpecId)
Sets the ItemSpecId that represents the ItemSpecification identifier for the resolved Item.
Parameters:
anItemSpecId - java.lang.Long

setProductId

public void setProductId(java.lang.Long anProductNumber)
Sets the ProductId that represents the primary key of the CatalogEntry that is to be resolved,
Specified by:
setProductId in interface ResolveSkuCmd
Parameters:
anProductNumber - the primary key of the product

validateParameters

public void validateParameters()
                        throws ECException
Description copied from class: AbstractECTargetableCommand
Performs parameter checking. This method replaces checkParameters() in 5.1. The default implementation of validateParameters() is a no op. It is the responsibility of the command writers to implements this method if they want to perform server side parameter checking.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
ECException