com.ibm.commerce.price.commands

Class ValidateDelegatedPriceCmdImpl

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


    public class ValidateDelegatedPriceCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements ValidateDelegatedPriceCmd
    This ValidateDelegatedPriceCmdImpl Task Command Implementation checks the lower limit of the negotiated price (which is the price TSR and the customer agreed with) for a given catalog entry.

    Retrieve the floor price for the product. the relevant ones are

  • The store ID
  • The catalog entry ID
  • The currency
  • If the floor price is not found, throw ECApplicationException

    Then check if the delegated price is lower than the floor price, if yes, it is an invalid delegated price, otherwise ok.

    This command calls the following TaskCommands:

    This command uses the following AccessBeans:
    • CatalogEntryShippingAccessBean
    • OrderItemAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Long getCatEntryId()
      Gets the catalog entry ID whose delegated price is to be checked for limit violation.
      java.lang.String getConfigurationID()
      Gets the configuration ID of a dynamic-kit
      java.lang.String getCurrency()
      Gets the currency to be used for finding the price.
      java.lang.String getCustomPartnumber()
      Returns the custom partnumber.
      java.math.BigDecimal getNegotiatedPrice()
      Gets the negotiated price.
      QuantityAmount getQuantity()
      Gets a quantity object of the catalog entry.
      java.lang.Integer getStoreId()
      Gets the store ID to which the catalog entry belongs.
      java.lang.Long getTSRId()
      Get a TSR ID
      boolean hasFloorPrice()
      Check if there exists a floor price for the input catalog.
      boolean isValid()
      Check if the delegated price is in the proper range.
      void performExecute()
      Retrieve the floor price of the catalog entry for the TSR, then check if the delegated price is in the proper range.
      void reset() 
      void setCatEntryId(java.lang.Long aCatEntryId)
      Sets the catalog entry ID whose delegated price is to be checked for limit violation.
      void setConfigurationID(java.lang.String aConfigID)
      Sets the configuration ID, if this catalog entry is a DynamicKit.
      void setCurrency(java.lang.String aCurrency)
      Set the currency to be used for finding the price.
      void setCustomPartnumber(java.lang.String aCustomPartnumber)
      Sets the custom partnumber whose delegated price is to be checked for limit violation.
      void setNegotiatedPrice(java.math.BigDecimal negotiatedPrice)
      Set the negotiated price.
      void setQuantity(QuantityAmount aQuantityAmount)
      Sets the quantity amount of the input catalog entry that is to be priced (Optional).
      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, 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

      • ValidateDelegatedPriceCmdImpl

        public ValidateDelegatedPriceCmdImpl()
    • Method Detail

      • getCatEntryId

        public java.lang.Long getCatEntryId()
        Gets the catalog entry ID whose delegated price is to be checked for limit violation.
        Returns:
        Long the catalog entry ID
      • getConfigurationID

        public java.lang.String getConfigurationID()
        Gets the configuration ID of a dynamic-kit
        Returns:
        String
      • getCurrency

        public java.lang.String getCurrency()
        Gets the currency to be used for finding the price.
        Returns:
        String the currency.
      • getCustomPartnumber

        public java.lang.String getCustomPartnumber()
        Returns the custom partnumber.
        Returns:
        String
      • getNegotiatedPrice

        public java.math.BigDecimal getNegotiatedPrice()
        Gets the negotiated price.
        Returns:
        BigDecimal the negotiated price.
      • getQuantity

        public QuantityAmount getQuantity()
        Gets a quantity object of the catalog entry.
        Returns:
        QuantityAmount
      • getStoreId

        public java.lang.Integer getStoreId()
        Gets the store ID to which the catalog entry belongs.
        Specified by:
        getStoreId in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getStoreId in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        Integer the store ID
      • getTSRId

        public java.lang.Long getTSRId()
        Get a TSR ID
        Returns:
        Long A TSR ID
      • hasFloorPrice

        public boolean hasFloorPrice()
        Check if there exists a floor price for the input catalog.
        Specified by:
        hasFloorPrice in interface ValidateDelegatedPriceCmd
        Returns:
        boolean Indicates if there is a floor price for a given product
      • isValid

        public boolean isValid()
        Check if the delegated price is in the proper range. If it is lower than the floor price, return false which means the delegated price is not in the proper range, otherwise return true.
        Specified by:
        isValid in interface ValidateDelegatedPriceCmd
        Returns:
        boolean Indicates if the delegated price is in the right range.
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Retrieve the floor price of the catalog entry for the TSR, then check if the delegated price is in the proper range. Its lower limit is the floor price.
        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 ValidateDelegatedPriceCmd
        Parameters:
        catEntryId - A reference number of catalog entry.
      • setConfigurationID

        public void setConfigurationID(java.lang.String aConfigID)
        Sets the configuration ID, if this catalog entry is a DynamicKit. (Optional)
        Specified by:
        setConfigurationID in interface ValidateDelegatedPriceCmd
        Parameters:
        aConfigID - A String of pre-configuration ID for a DynamicKit
      • setCurrency

        public void setCurrency(java.lang.String aCurrency)
        Set the currency to be used for finding the price. If the currency is not specified, then the currency of the order-item is used.
        Specified by:
        setCurrency in interface ValidateDelegatedPriceCmd
        Parameters:
        aCurrency - A currency.
      • setCustomPartnumber

        public void setCustomPartnumber(java.lang.String aCustomPartnumber)
        Sets the custom partnumber whose delegated price is to be checked for limit violation.
        Specified by:
        setCustomPartnumber in interface ValidateDelegatedPriceCmd
        Parameters:
        customPartnumber - The custom partnumber.
      • setNegotiatedPrice

        public void setNegotiatedPrice(java.math.BigDecimal negotiatedPrice)
        Set the negotiated price.
        Specified by:
        setNegotiatedPrice in interface ValidateDelegatedPriceCmd
        Parameters:
        negotiatedPrice - A negotiated price.
      • setQuantity

        public void setQuantity(QuantityAmount aQuantityAmount)
        Sets the quantity amount of the input catalog entry that is to be priced (Optional).
        Specified by:
        setQuantity in interface ValidateDelegatedPriceCmd
        Parameters:
        aQuantityAmount - The quantity amount of the catalog entry.
      • setStoreId

        public void setStoreId(java.lang.Integer aStoreId)
        Set the store ID to which the catalog entry belongs.
        Specified by:
        setStoreId in interface ValidateDelegatedPriceCmd
        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 ValidateDelegatedPriceCmd
        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()