com.ibm.commerce.price.commands

Class ComposePriceForCatalogEntryCmdImpl

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


    public class ComposePriceForCatalogEntryCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements ComposePriceForCatalogEntryCmd
    This ComposePriceForCatalogEntryCmdImpl Task Command Implementation composes the PriceInfoType array for given catalog entries.

    Input parameters:

    Name Type Requirement Description
    catentryIds String[] mandatory The catentry Ids
    contractIds String[] optional The specified contract Ids for the given catentries
    profileString String[] optional The profile of the sub prices, the values should be StandardPrice, ContracePrice or FloorPrice

    Output parameters:

    Name Type Description
    iPriceTypes PriceInfoType[] The PriceInfoType array object which contain all the request prices type of the given catentries
    The process goes like following
  • If the iProfileString isn't null, retrieve the sub price(StandardPrice/ContractPrice/FloorPrice) separately according with the content of iProfileString for given catentries. If the iProfileString is null, retrieve all the sub price for given catentries.
  • Compose the PriceInfoType array using the valid sub prices of the given catentries. If there isn't any valid price for one catentry, the PriceInfoType will be null. If one kinds of sub prices is not valid, or exception occurred during retrieving, the sub price of the corresponding PriceInfoType will be null.
  • This command calls the following TaskCommands:
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      • Fields inherited from interface com.ibm.commerce.command.CacheableECCommand

        defaultCommandClassName
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.commerce.exception.ECException[] getECException()
      If the PriceInfoType the caller gotten is null, maybe there is exception occurred, the caller could get ECException object using this method.
      com.ibm.commerce.foundation.common.datatypes.PriceInfoType[] getPrice()
      The function of this method is returning the PriceInfoType of the catentry.
      boolean isReadyToCallExecute()
      This method will be invoked before execute performExecute(), this method checks if the necessary parameter is specified.
      void performExecute()
      This method realizes the main business logic.
      void reset()
      This method is resetting all the global variable in this class.
      void setCatalogEntryIds(java.lang.String[] catEntryIds)
      Set the catentryID to the global variable.
      void setContractIds(java.lang.String[] contractIds)
      The function of this method is setting the contractIds to the global variable.
      void setProfile(java.lang.String[] profileString)
      Set the profileString to the global variable.
      • 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, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
      • 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, validateParameters
    • Field Detail

      • COPYRIGHT

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

      • ComposePriceForCatalogEntryCmdImpl

        public ComposePriceForCatalogEntryCmdImpl()
    • Method Detail

      • getECException

        public com.ibm.commerce.exception.ECException[] getECException()
        If the PriceInfoType the caller gotten is null, maybe there is exception occurred, the caller could get ECException object using this method. The ECException array sequence is consistent with catentry array sequence.
        Returns:
        return the ECException array.
      • getPrice

        public com.ibm.commerce.foundation.common.datatypes.PriceInfoType[] getPrice()
        The function of this method is returning the PriceInfoType of the catentry. If there isn't any valid price, will return null, for every sub type, if there isn't valid price, the sub price will be null.
        Specified by:
        getPrice in interface ComposePriceForCatalogEntryCmd
        Returns:
        return the PriceInfoType
      • isReadyToCallExecute

        public final boolean isReadyToCallExecute()
        This method will be invoked before execute performExecute(), this method checks if the necessary parameter is specified.
        Overrides:
        isReadyToCallExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        boolean indicate if the parameter is ready.
      • performExecute

        public void performExecute()
        This method realizes the main business logic. In this method, StandardPrice & ContractPrice & FloorPrice are set separately according with the values of iProfileString. If the iProfileString is null or length is 0, all the three kinds prices will be retrieved. After all the necessary kinds of sub prices is retrieved, all the valid sub prices is set to iPriceTypes. If there isn't any valid sub prices, the iPriceTypes will be set to null. The caller which invoke this command could get iPriceTypes via getPrice() method.
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
      • reset

        public void reset()
        This method is resetting all the global variable in this class.
        Overrides:
        reset in class com.ibm.commerce.command.AbstractECTargetableCommand
      • setCatalogEntryIds

        public void setCatalogEntryIds(java.lang.String[] catEntryIds)
        Set the catentryID to the global variable.
        Specified by:
        setCatalogEntryIds in interface ComposePriceForCatalogEntryCmd
        Parameters:
        catEntryIds - the catentry id of the catentry which prices will be gotten in this Command.
      • setContractIds

        public void setContractIds(java.lang.String[] contractIds)
        The function of this method is setting the contractIds to the global variable. The param contractIds is a contractId array which specified for all the catentries(only applicable for product/item/package).
        For example, the specified catentries is cat1, cat2, cat3.

        cat1 have valid contract price under: contract1, contract2, contract3.

        cat2 have valid contract price under: contract2,

        cat3 have valid contract price under: contract2, contract3,

        The contractIds contain contract1, contract3. Then finally, the valid contractprices returned are:

        cat1: contract1 price, contract3 price.

        cat2: no valid contract price.

        cat3: contract3 price.
        Specified by:
        setContractIds in interface ComposePriceForCatalogEntryCmd
        Parameters:
        contractIds - indicates the specified contractIds of the catentries.
      • setProfile

        public void setProfile(java.lang.String[] profileString)
        Set the profileString to the global variable. profileString is String array. The value and the description is listed:
        Value Description
        StandardPrice indicates get Standard Price
        ContractPrice indicates get Contract Price
        FloorPrice indicates get Floor Price
        If the profileString is null, that mean, all the kinds of prices need to be returned.
        Specified by:
        setProfile in interface ComposePriceForCatalogEntryCmd
        Parameters:
        profileString - indicates what kinds of price need to be retrieved.