com.ibm.commerce.price.commands

Class CreateNominalCostCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.price.commands.CreateNominalCostCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, CreateNominalCostCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class CreateNominalCostCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements CreateNominalCostCmd
    This CreateNominalCostCmdImpl Task Command Implementation creates the nominal cost of a product

    This implementation first obtains a TradingPositionContainer ID of the nominal cost pricelist; then creates an entry in OFFER table; and add one new record to OFFERPRICE table in one transaction.

    This command uses the following AccessBeans:

    • OfferAccessBean
    • OfferPriceAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getCurrency()
      Returns the currency.
      void performExecute()
      First validates the input parameters; Second retrieves the nominal cost pricelist ID; Third check if there exists a nominal cost, if yes, throw ECException; Finally add record to OFFER and OFFERPRICE tables in a single transaction
      void reset() 
      void setCatEntryId(java.lang.Long aCatEntryID)
      Sets the catalog entry ID whose nominal cost is going to be created.
      void setCurrency(java.lang.String aCurrency)
      Set the currency of the nominal cost.
      void setNominalCost(java.math.BigDecimal aNominalCost)
      Set the new value of the nominal cost of the product under this offer.
      void setStoreId(java.lang.Integer aStoreId)
      Set the store ID to which the catalog entry belongs.
      void setTSRId(java.lang.Long aTSRId)
      Set TSR ID who helps customer on shopping
      void validateParameters() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand

        accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.command.CacheableECCommand

        execute
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CreateNominalCostCmdImpl

        public CreateNominalCostCmdImpl()
    • Method Detail

      • getCurrency

        public java.lang.String getCurrency()
                                     throws com.ibm.commerce.exception.ECSystemException
        Returns the currency.
        Returns:
        String
        Throws:
        com.ibm.commerce.exception.ECSystemException
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        First validates the input parameters; Second retrieves the nominal cost pricelist ID; Third check if there exists a nominal cost, if yes, throw ECException; Finally add record to OFFER and OFFERPRICE tables in a single transaction
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        throw - ECException when failure encountered.
        com.ibm.commerce.exception.ECException
      • reset

        public void reset()
        Overrides:
        reset in class com.ibm.commerce.command.AbstractECTargetableCommand
        See Also:
        com.ibm.websphere.command.Command#reset()
      • setCatEntryId

        public void setCatEntryId(java.lang.Long aCatEntryID)
        Sets the catalog entry ID whose nominal cost is going to be created. (Mandatory)
        Specified by:
        setCatEntryId in interface CreateNominalCostCmd
        Parameters:
        catEntryId - A reference number of catalog entry.
      • setCurrency

        public void setCurrency(java.lang.String aCurrency)
        Set the currency of the nominal cost. If not provided, uses the one stored in CommandContext (Mandatory)
        Specified by:
        setCurrency in interface CreateNominalCostCmd
        Parameters:
        aCurrency - A currency.
      • setNominalCost

        public void setNominalCost(java.math.BigDecimal aNominalCost)
        Set the new value of the nominal cost of the product under this offer. (Mandatory)
        Specified by:
        setNominalCost in interface CreateNominalCostCmd
        Parameters:
        nominalCost - BigDecimal A nominal cost amount
      • setStoreId

        public void setStoreId(java.lang.Integer aStoreId)
        Set the store ID to which the catalog entry belongs.
        Specified by:
        setStoreId in interface CreateNominalCostCmd
        Parameters:
        storeId - A store ID
      • setTSRId

        public void setTSRId(java.lang.Long aTSRId)
        Set TSR ID who helps customer on shopping
        Specified by:
        setTSRId in interface CreateNominalCostCmd
        Parameters:
        aTSRId - Long A TSR ID
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException
        See Also:
        ECCommand.validateParameters()