com.ibm.commerce.giftregistry.registry

Class GiftRegistryRuleRegistry

  • java.lang.Object
    • com.ibm.commerce.giftregistry.registry.GiftRegistryRuleRegistry
  • All Implemented Interfaces:
    Registry


    public class GiftRegistryRuleRegistry
    extends java.lang.Object
    implements Registry
    When activated, will query the database table GRREGRULE and will create a GiftRegistryRuleEntry for each rule defined into a hashtable that will used in the creation of an instance of the GiftRegistryRuleRegistry. This registry will be managed by the WebSphere Commerce RegistryManager.

    To enable the gift registry's rule registry caching, the following entry needs to be included in the WebSphere Commerce configuration XML file:

      
        name="GiftRegistryRuleRegistry" regClassName="com.ibm.commerce.giftregistry.registry.GiftRegistryRuleRegistry" />
      
     
    The WebSphere Commerce RegistryManager upon invocation will return a singleton of the GiftRegistryRuleRegistry.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      GiftRegistryRuleRegistry()
      Constructor for GiftRegistryRuleRegistry.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addElement(GiftRegistryRuleAccessBean regEntry, java.util.Hashtable aCacheHash, GiftRegistryRuleRegistry.GiftRegistryRuleEntry grRuleEntry)
      Adds GiftRegistryRuleEntry to the given cache.
      java.lang.String createKey(GiftRegistryRuleAccessBean regEntry)
      Creates a search key for the cache.
      java.lang.String createKey(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
      Creates a search key for the cache.
      GiftRegistryRuleRegistry.GiftRegistryRuleEntry find(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
      Finds a GiftRegistryRule object from the rule object.
      java.lang.String getGrRuleVal(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
      Returns the grRuleValue string associated with a business rule
      void initialize()
      Initializes the GiftRegistryRuleRegistry.
      void refresh()
      Refreshes the local cache of gift registry rule objects by retrieving them from the database.
      void removeAllElements()
      Removes all GiftRegistryRuleEntries from the gift registry rules cache.
      void removeElement(java.lang.Integer storeId, java.lang.String eventTypeName, java.lang.Integer name)
      Removes a GiftRegistryRuleEntry from the local cache.
      static GiftRegistryRuleRegistry singleton()
      Returns a singleton Rule Registry object for IBM Gift Center
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

      • GiftRegistryRuleRegistry

        public GiftRegistryRuleRegistry()
        Constructor for GiftRegistryRuleRegistry.
    • Method Detail

      • initialize

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

        public void refresh()
                     throws java.lang.Exception
        Refreshes the local cache of gift registry rule objects by retrieving them from the database.
        Specified by:
        refresh in interface Registry
        Throws:
        java.lang.Exception
      • find

        public GiftRegistryRuleRegistry.GiftRegistryRuleEntry find(java.lang.Integer storeId,
                                                                   java.lang.String eventTypeName,
                                                                   java.lang.Integer name)
        Finds a GiftRegistryRule object from the rule object.
        Parameters:
        storeId - store ID
        eventTypeName - event type name
        name - name of business rule
        Returns:
        the GiftRegistryRuleAccessBean object
      • createKey

        public java.lang.String createKey(java.lang.Integer storeId,
                                          java.lang.String eventTypeName,
                                          java.lang.Integer name)
        Creates a search key for the cache.
        Parameters:
        storeId - store ID
        eventTypeName - event type name
        name - name of business rule
        Returns:
        search key
      • removeAllElements

        public void removeAllElements()
        Removes all GiftRegistryRuleEntries from the gift registry rules cache.
      • removeElement

        public void removeElement(java.lang.Integer storeId,
                                  java.lang.String eventTypeName,
                                  java.lang.Integer name)
        Removes a GiftRegistryRuleEntry from the local cache.
        Parameters:
        storeId - the store ID associated with the GiftRegistryRuleEntry
        eventTypeName - the event type name associated with the GiftRegistryRuleEntry
        name - the name associated with the GiftRegistryRuleEntry
      • singleton

        public static GiftRegistryRuleRegistry singleton()
        Returns a singleton Rule Registry object for IBM Gift Center

        Returns:
        singleton GiftRegistryRuleRegistry object
      • getGrRuleVal

        public java.lang.String getGrRuleVal(java.lang.Integer storeId,
                                             java.lang.String eventTypeName,
                                             java.lang.Integer name)
        Returns the grRuleValue string associated with a business rule
        Parameters:
        storeId -
        eventTypeName -
        name -
        Returns:
        grRuleVal string