com.ibm.commerce.giftregistry.registry

Class GiftRegistryRules

  • java.lang.Object
    • com.ibm.commerce.giftregistry.registry.GiftRegistryRules
  • All Implemented Interfaces:
    ECGiftRegistryRuleConstants


    public class GiftRegistryRules
    extends java.lang.Object
    implements ECGiftRegistryRuleConstants
    Provides a set of helper methods and code logic to retrieve business rule data from the GiftRegistryRuleRegistry Behaviour:
    • Searches for a business rule value for a specific store, event type and business rule, then provides input parameters of storeId (Integer), eventTypeName (string), and businessRuleName (Integer).

      Searches for a business rule value for a specific store and business rule only, then provides input parameters of storeId (Integer) and businessRuleName (Integer).

      All business rules available are defined as constants in the ECGiftRegistryRuleContstant class.

      When looking up a registry rule value, providing input parameters by storeId, eventTypeName, and businessRuleName, the IBM Gift Center rule cache will first check for a perfect match given the values provided. If there is no result found, then it will then check for the default value of the site with storeId of -1 and with the provided eventTypeName and businessRuleName.

      Looks up a registry rule value, providing input parameters by only the storeId and businessRuleName, the IBM Gift Center rule cache will first check for a perfect match given the values provided. If there is no result found, then it will then check for the default value of the site with storeId of -1 and default eventTypeName of Default with the provided business rule name.


    Exception conditions:
    • None. If no rule is found, then a null value is returned.
    • Field Detail

      • CLASS_NAME

        public static java.lang.String CLASS_NAME
        The name of this class
      • COPYRIGHT

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

      • GiftRegistryRules

        public GiftRegistryRules()
    • Method Detail

      • getRuleEntryByStoreIdByEventTypeNameByName

        public static GiftRegistryRuleRegistry.GiftRegistryRuleEntry getRuleEntryByStoreIdByEventTypeNameByName(java.lang.Integer storeId,
                                                                                                                java.lang.String eventTypeName,
                                                                                                                java.lang.Integer ruleName)
        Private method that returns the grRuleValue value associated with a business rule given storeId, eventTypeName, and the businessRuleName.
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        GiftRegistryRuleEntry ruleEntry
      • getRuleEntryByStoreIdByName

        public static GiftRegistryRuleRegistry.GiftRegistryRuleEntry getRuleEntryByStoreIdByName(java.lang.Integer storeId,
                                                                                                 java.lang.Integer ruleName)
        Private method that returns the grRuleValue value associated with a business rule given storeId and the business rule name
        Parameters:
        storeId -
        name -
        Returns:
        GiftRegistryRuleEntry ruleEntry
      • getRuleValueAsString

        public static java.lang.String getRuleValueAsString(java.lang.Integer storeId,
                                                            java.lang.String eventTypeName,
                                                            java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a String given storeId, eventTypeName, and the business rule name
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsString

        public static java.lang.String getRuleValueAsString(java.lang.Integer storeId,
                                                            java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a String given storeId and the business rule name
        Parameters:
        storeId -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsInteger

        public static java.lang.Integer getRuleValueAsInteger(java.lang.Integer storeId,
                                                              java.lang.String eventTypeName,
                                                              java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as an Integer given storeId, eventTypeName, and the business rule name
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsInteger

        public static java.lang.Integer getRuleValueAsInteger(java.lang.Integer storeId,
                                                              java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a String given storeId and the business rule name
        Parameters:
        storeId -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsLong

        public static java.lang.Long getRuleValueAsLong(java.lang.Integer storeId,
                                                        java.lang.String eventTypeName,
                                                        java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a Long given storeId, eventTypeName, and the business rule name
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsLong

        public static java.lang.Long getRuleValueAsLong(java.lang.Integer storeId,
                                                        java.lang.Integer ruleName)
        public method that returns the grRuleValue value associated with a business rule as a Long given storeId and the business rule name
        Parameters:
        storeId -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsDate

        public static java.sql.Date getRuleValueAsDate(java.lang.Integer storeId,
                                                       java.lang.String eventTypeName,
                                                       java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a Date given storeId, eventTypeName, and the business rule name
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsDate

        public static java.sql.Date getRuleValueAsDate(java.lang.Integer storeId,
                                                       java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a Date given storeId, and the business rule name
        Parameters:
        storeId -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsBoolean

        public static boolean getRuleValueAsBoolean(java.lang.Integer storeId,
                                                    java.lang.String eventTypeName,
                                                    java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a boolean given storeId, eventTypeName, and the business rule name returns true if registry value = "1", else returns false.
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string
      • getRuleValueAsBoolean

        public static boolean getRuleValueAsBoolean(java.lang.Integer storeId,
                                                    java.lang.Integer ruleName)
        Public method that returns the grRuleValue value associated with a business rule as a boolean given storeId, and the business rule name returns true if registry value = "1", else returns false.
        Parameters:
        storeId -
        name -
        Returns:
        grRuleVal string