com.ibm.commerce.order.calculation

Class CalculationRegistry

  • java.lang.Object
    • com.ibm.commerce.order.calculation.CalculationRegistry
  • All Implemented Interfaces:
    Registry


    public class CalculationRegistry
    extends java.lang.Object
    implements Registry
    This registry caches tables referenced by the Calculation Framework. They include:
    • CALUSAGE
    • STENCALUSG
    • CALMETHOD
    • TAXCGRY
    • CATENCALCD
    • CATGPCALCD
    • CALCODE
    • CALRULE
    • SHPJCRULE
    • TAXJCRULE
    • CRULESCALE
    • CALSCALE
    • CALRANGE
    • CALRLOOKUP
    • Field Detail

      • COPYRIGHT

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

      • CalculationRegistry

        public CalculationRegistry()
        Constructor for CalculationRegistry.
    • Method Detail

      • getApplyCalculationUsageMethod

        public CalculationMethodAccessBean getApplyCalculationUsageMethod(java.lang.Integer anStoreId,
                                                                          java.lang.Integer anUsageId)
                                                                   throws ECException
        Returns the apply calculation usage method.
        Parameters:
        anStoreId - the store ID.
        anUsageId - the usage ID.
        Returns:
        the apply calculation usage method.
        Throws:
        ECException
      • getCode

        public CalculationCodeAccessBean getCode(java.lang.Integer anCodeId)
                                          throws ECException
        Returns the calculation code access bean for the specified calculation code ID.
        Parameters:
        anCodeId - the calculation code ID.
        Returns:
        the calculation code access bean.
        Throws:
        ECException
      • getCodeCombineMethod

        public CalculationMethodAccessBean getCodeCombineMethod(java.lang.Integer anStoreId,
                                                                java.lang.Integer anUsageId)
                                                         throws ECException
        Returns the calculation method for the specified store and usage.
        Parameters:
        anStoreId - the store id.
        anUsageId - the usage id.
        Returns:
        the calculation method
        Throws:
        ECException
      • getCodeMemberGroupIds

        public java.lang.Long[] getCodeMemberGroupIds(java.lang.Integer anCodeId)
                                               throws ECException
        Returns the member group ids for the specified calculation code id.
        Parameters:
        anCodeId - the calculation code id.
        Returns:
        the member group ids.
        Throws:
        ECException
      • getDefaultCode

        public CalculationCodeAccessBean getDefaultCode(java.lang.Integer anStoreId,
                                                        java.lang.Integer anUsageId,
                                                        java.sql.Timestamp aTimestamp)
                                                 throws ECException
        Returns the effective default calculation code for the specified store and usage.
        Parameters:
        anStoreId - the store id
        anUsageId - the usage id
        aTimestamp - the returned code must be effective at the specified time.
        Returns:
        he effective default calculation code
        Throws:
        ECException
      • getRulesForCode

        public CalculationRuleAccessBean[] getRulesForCode(java.lang.Integer anCodeId)
                                                    throws ECException
        Returns the calculation rules for the specified calculation code.
        Parameters:
        anCodeId - the calculation code id.
        Returns:
        the calculation rules.
        Throws:
        ECException
      • getEffectiveRules

        public CalculationRuleAccessBean[] getEffectiveRules(java.lang.Integer anCodeId,
                                                             java.sql.Timestamp aTimestamp)
                                                      throws ECException
        Returns the effective calculation rules for the specified calculation code and time.
        Parameters:
        anCodeId - the calculation code id.
        aTimestamp - the time at which the rules are effective.
        Returns:
        the effective calculation rules
        Throws:
        ECException
      • getFinalizeCalculationUsageMethod

        public CalculationMethodAccessBean getFinalizeCalculationUsageMethod(java.lang.Integer anStoreId,
                                                                             java.lang.Integer anUsageId)
                                                                      throws ECException
        Returns the finalize calculation usage method for the specified store and usage.
        Parameters:
        anStoreId - the store id
        anUsageId - the usage id
        Returns:
        the finalize calculation usage method
        Throws:
        ECException
      • getIndirectlyAttachedCodes

        public CalculationCodeAccessBean[] getIndirectlyAttachedCodes(java.lang.Long anCatalogEntryId,
                                                                      java.lang.Long anContractId,
                                                                      java.lang.Integer anStoreId,
                                                                      java.lang.Integer anUsageId,
                                                                      java.sql.Timestamp aTimestamp)
                                                               throws ECException
        Returns the effective indirectly attached calculation codes for the specified parameters.
        Parameters:
        anCatalogEntryId - the catalog entry id.
        anContractId - the contract id.
        anStoreId - the store id.
        anUsageId - the usage id.
        aTimestamp - the time at which the calculation codes are effective.
        Returns:
        the effective indirectly attached calculation codes
        Throws:
        ECException
      • getInitializeCalculationUsageMethod

        public CalculationMethodAccessBean getInitializeCalculationUsageMethod(java.lang.Integer anStoreId,
                                                                               java.lang.Integer anUsageId)
                                                                        throws ECException
        Returns the initialize calculation usage method for the specified parameters.
        Parameters:
        anStoreId - the store id
        anUsageId - the usage id
        Returns:
        the initialize calculation usage method
        Throws:
        ECException
      • getInstance

        public static CalculationRegistry getInstance()
        Returns an instance of this class.
        Returns:
        an instance of this class.
      • getLookupResult

        public CalculationRangeLookupResultAccessBean getLookupResult(java.lang.Integer anRangeId,
                                                                      java.lang.String astrCurrency,
                                                                      CommandContext commandContext)
                                                               throws ECException
        Returns the lookup result for the specified parameters.
        Parameters:
        anRangeId - the range id.
        astrCurrency - the currency
        commandContext - the command context to be used if currency conversion is required.
        Returns:
        the lookup result.
        Throws:
        ECException
      • getRangesInDescendingOrder

        public CalculationRangeAccessBean[] getRangesInDescendingOrder(java.lang.Integer anScaleId,
                                                                       java.math.BigDecimal adLookupNumber)
                                                                throws ECException
        Returns the ranges in descending sequence for the specified parameters.
        Parameters:
        anScaleId - the scale id.
        adLookupNumber - the lookup number
        Returns:
        the ranges in descending sequence
        Throws:
        ECException
      • getRuleCombineMethod

        public CalculationMethodAccessBean getRuleCombineMethod(java.lang.Integer anStoreId,
                                                                java.lang.Integer anUsageId)
                                                         throws ECException
        Returns the rule combine method for the specified store and usage.
        Parameters:
        anStoreId - the store id.
        anUsageId - the usage id.
        Returns:
        the rule combine method.
        Throws:
        ECException
      • getRuleMemberGroupIds

        public java.lang.Long[] getRuleMemberGroupIds(java.lang.Integer anRuleId)
                                               throws ECException
        Returns the rule member group ids for the specified rule.
        Parameters:
        anRuleId - the rule id.
        Returns:
        the rule member group ids.
        Throws:
        ECException
      • getShippingRules

        public ShippingJurisdictionGroupCalculationRuleAccessBean[] getShippingRules(java.lang.Integer anFulfillmentCenterId,
                                                                                     java.lang.Integer[] anJurisdictionIds,
                                                                                     java.lang.Integer anShippingModeId)
                                                                              throws ECException
        Returns the shipping jurisdiction group calculation rules for the specified parameters.
        Parameters:
        anFulfillmentCenterId - the fulfillment center id
        anJurisdictionIds - the jurisdiction ids
        anShippingModeId - the shipping mode id
        Returns:
        the shipping jurisdiction group calculation rules
        Throws:
        ECException
      • getShippingRules

        public ShippingJurisdictionGroupCalculationRuleAccessBean[] getShippingRules(java.lang.Integer shipCode,
                                                                                     java.lang.Integer anFulfillmentCenterId,
                                                                                     java.lang.Integer[] anJurisdictionIds,
                                                                                     java.lang.Integer anShippingModeId)
                                                                              throws ECException
        Gets array of ShippingJurisdictionGroupCalculationRuleAccessBean for specified shipping calculation code Id, fulfillment center Id, array of shipping jurisdiction Ids and shipping mode Id.
        Parameters:
        shipCode - shipping calculation code Id.
        anFulfillmentCenterId - fulfillment center Id.
        anJurisdictionIds - shipping jurisdiction Id.
        anShippingModeId - shipping mode Id.
        Returns:
        array of ShippingJurisdictionGroupCalculationRuleAccessBean
        Throws:
        ECException
      • getSummarizeCalculationUsageMethod

        public CalculationMethodAccessBean getSummarizeCalculationUsageMethod(java.lang.Integer anStoreId,
                                                                              java.lang.Integer anUsageId)
                                                                       throws ECException
        Returns the summarize calculation usage mthod for the specified store and usage.
        Parameters:
        anStoreId - the store id.
        anUsageId - the usage id.
        Returns:
        the summarize calculation usage method.
        Throws:
        ECException
      • getTaxCategoryIds

        public java.lang.Integer[] getTaxCategoryIds(java.lang.Integer anStoreId,
                                                     java.lang.Integer anUsageId)
                                              throws ECException
        Returns the tax category ids for the specified store and usage.
        Parameters:
        anStoreId - the store id.
        anUsageId - the usage id.
        Returns:
        the tax category ids.
        Throws:
        ECException
      • getTaxRules

        public TaxJurisdictionGroupCalculationRuleAccessBean[] getTaxRules(java.lang.Integer anFulfillmentCenterId,
                                                                           java.lang.Integer[] anJurisdictionIds)
                                                                    throws ECException
        Returns the tax rules for the specified parameters.
        Parameters:
        anFulfillmentCenterId - the fulfillment center id.
        anJurisdictionIds - the tax jurisdiction ids.
        Returns:
        the tax rules
        Throws:
        ECException
      • getTaxRules

        public TaxJurisdictionGroupCalculationRuleAccessBean[] getTaxRules(java.lang.Integer taxCodeId,
                                                                           java.lang.Integer anFulfillmentCenterId,
                                                                           java.lang.Integer[] anJurisdictionIds)
                                                                    throws ECException
        Gets the TaxJurisdictionGroupCalculationRuleAccessBean by tax Code Id, FulfillmentCenter Id and tax jurisdiction Ids.
        Parameters:
        taxCodeId - tax calculation code Id.
        anFulfillmentCenterId - fulfillment center Id.
        anJurisdictionIds - array of tax jurisdiction Ids.
        Returns:
        array of TaxJurisdictionGroupCalculationRuleAccessBean
        Throws:
        ECException
      • getTaxType

        public TaxTypeAccessBean getTaxType(java.lang.Integer anTaxTypeId)
                                     throws ECException
        Returns the specified tax type.
        Parameters:
        anTaxTypeId - the tax type id.
        Returns:
        the tax type.
        Throws:
        ECException
      • getUsageFlags

        public java.lang.Integer getUsageFlags(java.lang.Integer anStoreId,
                                               java.lang.Integer anUsageId)
                                        throws ECException
        Returns the usage flags for the specified store and usage.
        Parameters:
        anStoreId - the store id.
        anUsageId - the usage id.
        Returns:
        the usage flags.
        Throws:
        ECException
      • getUsageIds

        public java.lang.Integer[] getUsageIds(java.lang.Integer anStoreId)
                                        throws ECException
        Returns the usage ids in sequence for the specified store.
        Parameters:
        anStoreId - the store id.
        Returns:
        the usage ids.
        Throws:
        ECException
      • getCodeDescriptions

        public java.util.HashMap getCodeDescriptions(java.lang.Integer anCodeId)
                                              throws ECException
        Returns descriptions of a calclulation code.
        Parameters:
        anCodeId - the calculation code id
        Returns:
        the descriptions. Each key is an Integer language id. Each value is a String description.
        Throws:
        ECException
      • getCodeTaxExemptions

        public java.lang.Integer[] getCodeTaxExemptions(java.lang.Integer anCodeId)
                                                 throws ECException
        Returns the tax category ids of exempt tax tagerories for the specified calculation code.
        Parameters:
        anCodeId - the calculation code id.
        Returns:
        the tax category ids of exempt tax tagerories
        Throws:
        ECException
      • initialize

        public void initialize()
                        throws java.lang.Exception
        Initializes the registry.
        Specified by:
        initialize in interface Registry
        Throws:
        java.lang.Exception
      • refresh

        public void refresh()
                     throws java.lang.Exception
        Refreshes the registry. This implementation clears all data from the registry.
        Specified by:
        refresh in interface Registry
        Throws:
        java.lang.Exception
      • getTaxCategoryIdsByStorePath

        public java.lang.Integer[] getTaxCategoryIdsByStorePath(java.lang.Integer anStoreId,
                                                                java.lang.Integer anUsage)
                                                         throws ECException
        Gets all the tax categories by store path.
        Parameters:
        anStoreId - The specified store Id.
        anUsage - The calculation usage of the tax category, i.e. the tax type.
        Returns:
        All the tax categories of the store path.
        Throws:
        ECException
      • getDisplayTaxCategoryIdsByStorePath

        public java.lang.Integer[] getDisplayTaxCategoryIdsByStorePath(java.lang.Integer anStoreId)
                                                                throws ECException
        Gets all the sales tax categories by store path for display purpose.
        Parameters:
        anStoreId - The specified store Id.
        Returns:
        All the tax categories for display purpose.
        Throws:
        ECException
      • getCalculationUsageRuntimeStoreRelationType

        public java.lang.String getCalculationUsageRuntimeStoreRelationType(java.lang.Integer usageId)
                                                                     throws ECException
        Gets the runtime store relation type configuration for the calculation usage.
        Parameters:
        usageId - The calculation usage Id.
        Returns:
        The runtime store relation type configuration for the calculation usage
        Throws:
        ECException
      • getTaxCategoryDisplayUsage

        public java.lang.Integer getTaxCategoryDisplayUsage(java.lang.Integer categoryId)
                                                     throws ECException
        Gets the tax category display usage flag of a tax category.
        Parameters:
        categoryId - The tax category ID.
        Returns:
        The tax category display usage flag.
        Throws:
        ECException