com.ibm.commerce.price.commands

Class SelectContractPricesCmdImpl

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


    public class SelectContractPricesCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements SelectContractPricesCmd
    This SelectContractPricesCmd Task Command Implementation selects the best offer among all the qualified offers for the input catalog entry.

    If the command is successful retrieving the price, it will return the best price, the offer id and access bean. And it will return the T&C id and the trading agreement id that determined the price.

    If unsuccessful, the command throws the ECApplicationException specifying an Error Message (ERR_RETRIEVE_PRICE), an Error Code (ERR_CODE_NO_PRICE) and the Error View (RetrievePriceErrorView).

    Behaviour The best offer will be selected based on the following criteria:

    • the price list provided the offer has the highest precedence among all the qualified price lists referenced by all the eligible trading agreements.
    • the offer has the highest possible precedence within its price list. A lower precedence offer may be chosen if there is no qualifying offer with a higher precedence level in the same price list.
    • the result offer price gives the lowest price, after applying the adjustment specified in the Ts&Cs from the trading agreements.

    Exception Conditions

    • If no price is found, the command throws the ECApplicationException specifying an Error Message (ERR_RETRIEVE_PRICE).

    If ErrorMode is false, these errors will be ignored and a null value price will be passed back to the caller.

    This command calls the following TaskCommands:

    This command uses the following AccessBeans:
    • StoreAccessBean
    • OfferAccessBean
    • TradingPositionContainerAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      ItemPriceInfo[] getItemPriceInfo()
      Returns the internal item info structure.
      void performExecute()
      Executes main business logic of the command.
      void setCurrency(java.lang.String astrCurrency)
      Sets the currency to be used for finding the price (Optional).
      void setErrorMode(boolean aErrorMode)
      Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional).
      void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
      Sets the item info structure for internal use on calculating the prices.
      void setStoreId(java.lang.Integer aStoreId)
      Sets the id of the input store to be used for calculating the price (Optional).
      void validateParameters()
      Checks mandatory parameters.
      • 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, reset, 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

      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        the class name.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

      • SelectContractPricesCmdImpl

        public SelectContractPricesCmdImpl()
        Constructor.
    • Method Detail

      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Executes main business logic of the command.
        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
      • setCurrency

        public void setCurrency(java.lang.String astrCurrency)
        Sets the currency to be used for finding the price (Optional).
        Specified by:
        setCurrency in interface SelectContractPricesCmd
        Parameters:
        astrCurrency - the currency
      • setErrorMode

        public void setErrorMode(boolean aErrorMode)
        Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional).
        Specified by:
        setErrorMode in interface SelectContractPricesCmd
        Parameters:
        aErrorMode - the error mode
      • setItemPriceInfo

        public void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
        Sets the item info structure for internal use on calculating the prices.
        Specified by:
        setItemPriceInfo in interface SelectContractPricesCmd
        Parameters:
        aItemPriceInfo - the internal data structure
      • setStoreId

        public void setStoreId(java.lang.Integer aStoreId)
        Sets the id of the input store to be used for calculating the price (Optional).
        Specified by:
        setStoreId in interface SelectContractPricesCmd
        Parameters:
        aStoreId - the store ID
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Checks mandatory parameters.
        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