com.ibm.commerce.price.commands

Class UpdateNominalCostCmdImpl

  • 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.UpdateNominalCostCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, UpdateNominalCostCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class UpdateNominalCostCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements UpdateNominalCostCmd
    This UpdateNominalCostCmdImpl Task Command Implementation updates the nominal cost of a product with the same currency. If the currencies are different, one should delete the current one, and create a new one.

    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.
      java.lang.Integer getStoreId()
      Returns the store ID.
      void performExecute()
      First validates the input parameters.
      void reset() 
      void setCatEntryId(java.lang.Long aCatEntryId)
      Sets the catalog entry ID whose delegated price is to be checked for limit violation.
      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 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, 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, 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

      • UpdateNominalCostCmdImpl

        public UpdateNominalCostCmdImpl()
    • 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
      • getStoreId

        public java.lang.Integer getStoreId()
        Returns the store ID.
        Specified by:
        getStoreId in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getStoreId in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        Integer
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        First validates the input parameters. Second checks if there exists a nominal cost, if no, throw ECException. Third checks if the currency of the existing nominal cost is the same as the given currency, if not, throw ECException. Finally update the entry in OFFERPRICE table and reset the LASTUPDATE timestamp of the offer in OFFER table within a single transaction.
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        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 delegated price is to be checked for limit violation.
        Specified by:
        setCatEntryId in interface UpdateNominalCostCmd
        Parameters:
        catEntryId - A reference number of catalog entry.
      • setCurrency

        public void setCurrency(java.lang.String aCurrency)
        Set the currency of the nominal cost.
        Specified by:
        setCurrency in interface UpdateNominalCostCmd
        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 UpdateNominalCostCmd
        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 UpdateNominalCostCmd
        Parameters:
        storeId - A store 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()