com.ibm.commerce.registry

Class StoreRegistry

    • Field Detail

      • REGISTRY_NAME

        public static final java.lang.String REGISTRY_NAME
        The name of this registry.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StoreRegistry

        public StoreRegistry()
        This is the default constructor of this class. It calls the constructor from the superclass.
    • Method Detail

      • createKey

        public java.lang.Object createKey(java.lang.String strKey)
                                   throws java.lang.Exception
        This method creates a cache key based on a key string.
        Specified by:
        createKey in interface ElementUpdate
        Specified by:
        createKey in class AbstractManagedDynamicCacheRegistry
        Parameters:
        strKey - The key as a String object.
        Returns:
        A cache key.
        Throws:
        java.lang.Exception
      • retrieve

        public java.lang.Object retrieve(java.lang.Object key)
                                  throws java.lang.Exception
        This method retrieves a store object from the database and adds it to the cache.
        Specified by:
        retrieve in class AbstractManagedDynamicCacheRegistry
        Parameters:
        A - cache key .
        Returns:
        A store object.
        Throws:
        java.lang.Exception
      • find

        public StoreAccessBean find(java.lang.Integer storeId)
        This method looks up a StoreAccessBean object from the store registry. It will first check in the runtime cache. If the object cannot be found, it will retrieve it from the database. This method returns null if the specified storeId is zero.
        Parameters:
        storeId - The store id.
        Returns:
        A StoreAccessBean object or null if store is not defined.
      • getStore

        public StoreAccessBean getStore(java.lang.Integer storeId)
        This method looks up a StoreAccessBean object from the store registry. It will first check in the runtime cache. If the object cannot be found, it will retrieve it from the database.
        Parameters:
        storeId - The store id.
        Returns:
        A StoreAccessBean object or null if store is not defined.
      • getStoreCount

        public int getStoreCount()
        This method returns a count of all the stores defined.
        Returns:
        The store count.
      • getStoreElements

        public java.util.Enumeration getStoreElements()
        Deprecated. 
        This method returns an enumeration of all StoreAccessBean objects stored in the store registry.
        Returns:
        An enumeration of all StoreAccessBean objects.
      • initialize

        public void initialize()
                        throws java.lang.Exception
        This method initializes the store registry. It sets the singleton instance to this instance. It also registers this instance in WcsApp.storeRegistry.
        Specified by:
        initialize in interface Registry
        Overrides:
        initialize in class AbstractManagedDynamicCacheRegistry
        Throws:
        java.lang.Exception
      • refresh

        public void refresh()
                     throws java.lang.Exception
        This method clears the cache. If this instance is the singleton instance then it also clears StoreRelationshipCache.instance().
        Specified by:
        refresh in interface Registry
        Overrides:
        refresh in class AbstractManagedDynamicCacheRegistry
        Throws:
        java.lang.Exception
      • update

        public void update(java.lang.String action,
                           java.lang.Object key)
                    throws java.lang.Exception
        This method updates a cached element. If this instance is the singleton instance, then it also:
        1. Removes stores from the store registry that include the specified store in their storepath for store relationship type ECConstants.EC_STRELTYP_CATALOG;
        2. and
        3. Removes information about the specified store from StoreRelationshipCache.instance().
        Specified by:
        update in interface ElementUpdate
        Overrides:
        update in class AbstractManagedDynamicCacheRegistry
        Parameters:
        action - The action performed on the registry. For example, ECConstants.EC_REGISTRY_ELEMENT_UPDATE, ECConstants.EC_REGISTRY_ELEMENT_ADD, or ECConstants.EC_REGISTRY_ELEMENT_DELETE.
        key - The Integer store identifier.
        Throws:
        java.lang.Exception
      • populate

        public void populate(com.ibm.commerce.registry.LRUDynamicHashtable aCache)
                      throws java.lang.Exception
        This method populates the cache with store objects from the database.
        Specified by:
        populate in class AbstractManagedDynamicCacheRegistry
        Parameters:
        aCache - The cache to be populated.
        Throws:
        java.lang.Exception
      • singleton

        public static StoreRegistry singleton()
        This method returns a singleton object of the store registry.
        Returns:
        A singleton StoreRegistry object.
      • addElement

        public void addElement(java.lang.Integer storeId,
                               StoreAccessBean bean,
                               java.util.Hashtable aCache)
        Deprecated. 
        This method adds a StoreAccessBean object to the given cache.
        Parameters:
        storeId - The store id.
        bean - A StoreAccessBean object.
        aCache - A Hashtable object.
      • isStoreGroup

        public boolean isStoreGroup(java.lang.Integer storeId)
        This method determines whether a given integer is a store group id.
        Parameters:
        storeId - The Integer to be checked.
      • find

        public com.ibm.commerce.registry.StoreCopy find(java.lang.String astrOrganizationDN,
                                                        java.lang.String astrStoreName)
                                                 throws ECException
        This method looks up a StoreCopy object from the store registry. It will first check the runtime cache. If the object is not found, it will retrieve it from the database.
        Parameters:
        astrOrganizationDN - The distinguished name of the organization that owns the store.
        astrStoreName - The identifier attribute of the store.
        Returns:
        The StoreCopy object or null if no such store exists.
        Throws:
        ECException
      • findAllStoresByUserId

        public java.util.Collection findAllStoresByUserId(java.lang.Long userId)
                                                   throws ECException
        This method searches all stores that the administrator can manage. It looks up a StoreCopy object from the store registry. It will first check in the runtime cache. If the object is not found, it will retrieve it from the database.
        Parameters:
        userId - The user id of the administrator that is logged on.
        Returns:
        A Collection of StoreAccessBean objects that this user can manage.
        Throws:
        ECException