com.ibm.commerce.registry
Class UrlRegistry

java.lang.Object
  |
  +--com.ibm.commerce.registry.UrlRegistry
All Implemented Interfaces:
Registry

public class UrlRegistry
extends java.lang.Object
implements Registry

The UrlRegistry is the runtime cache of the URLREG table.


Field Summary
protected  java.util.Hashtable cache
           
protected static UrlRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry. Registry
COPYRIGHT
 
Constructor Summary
UrlRegistry()
          Constructor for UrlRegistry.
 
Method Summary
 void addElement( UrlRegistryEntry regEntry)
          Adds a UrlRegistryEntry to the cache.
 void addElement( UrlRegistryEntry regEntry, java.util.Hashtable aCache)
          Adds a UrlRegistryEntry to the cache.
 java.lang.String createKey(java.lang.String name, java.lang.Integer storeId)
          Creates a search key.
  UrlRegistryEntry find(java.lang.String name, java.lang.Integer storeId)
          Looks up an url registry entry based on the name and store entity id.
 void initialize()
          Initializes the UrlRegistry.
 void refresh()
          Refreshes the url registry cache from the database.
 void removeAllElements()
          Removes all url registry entries from the cache.
 boolean removeElement( UrlRegistryEntry entry)
          Removes an UrlRegistryEntry from the cache.
static  UrlRegistry singleton()
          Returns a singleton url registry object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected java.util.Hashtable cache

singleton

protected static UrlRegistry singleton
Constructor Detail

UrlRegistry

public UrlRegistry()
Constructor for UrlRegistry.
Method Detail

addElement

public void addElement(UrlRegistryEntry regEntry)
Adds a UrlRegistryEntry to the cache.
Parameters:
regEntry - the UrlRegistryEntry to be added to the cache

addElement

public void addElement(UrlRegistryEntry regEntry,
                       java.util.Hashtable aCache)
Adds a UrlRegistryEntry to the cache.
Parameters:
regEntry - the UrlRegistryEntry to be added to the cache
aCache - the cache object

find

public UrlRegistryEntry find(java.lang.String name,
                             java.lang.Integer storeId)
                      throws ECException
Looks up an url registry entry based on the name and store entity id. The store paths associated with this store's URL resource will be used as the search path. If not founds, it will used the ECConstants.EC_NO_STOREID to look for the the url entry.
Parameters:
name - the name of the url request
storeId - reference number of the store
Returns:
the url registry entry
Throws:
ECException

initialize

public void initialize()
                throws java.lang.Exception
Initializes the UrlRegistry. This will include the initialization of the WcsApp with this instance of the registry.
Specified by:
initialize in interface Registry
Throws:
java.lang.Exception

refresh

public void refresh()
             throws java.lang.Exception
Refreshes the url registry cache from the database.
Specified by:
refresh in interface Registry
Throws:
java.lang.Exception

removeAllElements

public void removeAllElements()
Removes all url registry entries from the cache.

removeElement

public boolean removeElement(UrlRegistryEntry entry)
Removes an UrlRegistryEntry from the cache. It does not remove the UrlRegistryEntry from the database.
Parameters:
entry - the UrlRegistryEntry to be removed from the cache
Returns:
true if the UrlRegistryEntry was removed or false otherwise

createKey

public java.lang.String createKey(java.lang.String name,
                                  java.lang.Integer storeId)
Creates a search key.
Parameters:
name - url name
storeId - store Id
Returns:
search key

singleton

public static UrlRegistry singleton()
Returns a singleton url registry object.
Returns:
a singleton url Registry object