com.ibm.commerce.catalog.commands
Class ResolveSkuCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.catalog.commands.ResolveSkuCmdImpl
All Implemented Interfaces:
ECCommand, 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.


Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.catalog.commands.ResolveSkuCmd
defaultCommandClassName, NAME
 
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()
          isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void reset()
          This method is 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 server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
The internal copyright field.
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: AbstractECCommand
isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command. The default implementation is to return true.

Overrides:
isReadyToCallExecute in class AbstractECCommand
Following copied from class: com.ibm.commerce.command.AbstractECCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

reset

public void reset()
Description copied from class: AbstractECCommand
This method is 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 AbstractECCommand

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:
anProductId - java.lang.Long

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -