com.ibm.commerce.price.commands

Class CalculateContractPricesCmdImpl

  • 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.CalculateContractPricesCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, CalculateContractPricesCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command
    Direct Known Subclasses:
    MarketplaceCalculateContractPricesCmdImpl


    public class CalculateContractPricesCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements CalculateContractPricesCmd
    This CalculateContractPricesCmd Task Command Implementation retrieves all the qualified contract prices and calculates the price adjustment specified by the contract for one or more catalog entries.

    If the command is successful in retrieving offers, it will return a list of qualified offers. It provides the offer prices which have been adjusted according the corresponding Ts&Cs defined in the trading agreements.

    If unsuccessful, it will return an empty list.

    Behaviour

    Obtain all the qualified offers for each catalog entries. Each offer to be retrieved, to find the price of a catalog entry must satisfy certain criteria.

    If no valid offer can be found, the parent product offers will be searched, for providing the catalog entry. And the parent product is not excluded from the trading agreements.

    Select the best adjustments for each of the offers. The price adjustments are retrieved from those Ts&Cs which references the price list containing the offer.

    Calculate the price adjustments for each of the offers.

    This command calls the following TaskCommands:

    This command uses the following AccessBeans:
    • StoreAccessBean
    • CatalogEntryShippingAccessBean
    • TradingAgreementAccessBean
    • OfferAccessBean
    • OfferPriceAccessBean
    • ProductSetCeRelAccessBean
    • CatalogEntryAccessBean
    • TermConditionAccessBean
    • PriceTCMasterCatalogWithOptionalAdjustmentAccessBean
    • PriceTCMasterCatalogWithFilteringAccessBean
    • PriceTCPriceListWithOptionalAdjustmentAccessBean
    • PriceTCPriceListWithSelectiveAdjustmentAccessBean
    • 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 setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
      Sets the ids the price list associated with the Master Catalog (Optional).
      void setPriceListIds(java.lang.Long[] aPriceListIds)
      Sets the ids of the input price lists to be used for retrieving the offers.
      void setStoreId(java.lang.Integer aStoreId)
      Sets the id of the input store to be used for calculating the price (Optional).
      void setTradingABs(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] aTradingABs)
      Sets the input trading agreement access beans for determining the contract prices.
      void setUseGlobalPriceList(boolean aUseGlobalPriceList)
      Sets the flag, to indicate if the list of input price lists can be used globally, for retrieving the offers for all of the input catentries (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

      • COPYRIGHT

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

      • CalculateContractPricesCmdImpl

        public CalculateContractPricesCmdImpl()
        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 CalculateContractPricesCmd
        Parameters:
        astrCurrency - a 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 CalculateContractPricesCmd
        Parameters:
        aErrorMode - the exception will be thrown if set true.
      • setItemPriceInfo

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

        public void setMasterCatalogPriceListIds(java.lang.Long[] aMasterpriceListIds)
        Sets the ids the price list associated with the Master Catalog (Optional).
        Specified by:
        setMasterCatalogPriceListIds in interface CalculateContractPricesCmd
        Parameters:
        aMasterpriceListIds - an array of master pricelists
      • setPriceListIds

        public void setPriceListIds(java.lang.Long[] aPriceListIds)
        Sets the ids of the input price lists to be used for retrieving the offers.
        Specified by:
        setPriceListIds in interface CalculateContractPricesCmd
        Parameters:
        aPriceListIds - an array of pricelist Ids
      • 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 CalculateContractPricesCmd
        Parameters:
        aStoreId - the ID of the input store
      • setTradingABs

        public void setTradingABs(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] aTradingABs)
        Sets the input trading agreement access beans for determining the contract prices.
        Specified by:
        setTradingABs in interface CalculateContractPricesCmd
        Parameters:
        aTradingABs - a set of Trading agreement access beans
      • setUseGlobalPriceList

        public void setUseGlobalPriceList(boolean aUseGlobalPriceList)
        Sets the flag, to indicate if the list of input price lists can be used globally, for retrieving the offers for all of the input catentries (Optional).
        Specified by:
        setUseGlobalPriceList in interface CalculateContractPricesCmd
        Parameters:
        aUseGlobalPriceLIst - a flag used to decide which price lists can be used
      • 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