com.ibm.commerce.registry
Class ViewRegistry

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

public class ViewRegistry
extends java.lang.Object
implements Registry

This is the ViewRegistry.


Field Summary
protected static ViewRegistry singleton
           
protected static java.util.Hashtable viewByStore
           
 
Fields inherited from interface com.ibm.commerce.registry.Registry
COPYRIGHT
 
Constructor Summary
ViewRegistry()
          ViewRegistry constructor comment.
 
Method Summary
 void addElement(ViewRegistryEntry regEntry)
          Adds a ViewRegistryEntry to the cache.
 void addElement(ViewRegistryEntry regEntry, java.util.Hashtable aCache)
          Adds a ViewRegistryEntry to the given cache.
 java.lang.String createKey(java.lang.String view, java.lang.Integer storeId, java.lang.String deviceId)
          Creates a search key.
 ViewRegistryEntry find(java.lang.String name, java.lang.Integer storeId, java.lang.Integer device)
          This method will lookup a view command based on view name, store id and device id.
 void initialize()
          Initializes the ViewRegistry.
 void refresh()
          This method refresh the view registry from the database.
 void removeAllElements()
          Removes all View Registry entries from the cache.
 boolean removeElement(ViewRegistryEntry entry)
          Removes an ViewRegistryEntry from the cache.
static ViewRegistry singleton()
          This method returns a singleton view registry object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

protected static ViewRegistry singleton

viewByStore

protected static java.util.Hashtable viewByStore
Constructor Detail

ViewRegistry

public ViewRegistry()
ViewRegistry constructor comment.
Method Detail

addElement

public void addElement(ViewRegistryEntry regEntry)
Adds a ViewRegistryEntry to the cache. It does not add the ViewRegistryEntry to the database.
Parameters:
obj - the ViewRegistryEntry to be added to the cache

addElement

public void addElement(ViewRegistryEntry regEntry,
                       java.util.Hashtable aCache)
Adds a ViewRegistryEntry to the given cache.
Parameters:
obj - ViewRegistryEntry - entry to be added to the cache
aCache - Hashtable - the cache to be used

createKey

public java.lang.String createKey(java.lang.String view,
                                  java.lang.Integer storeId,
                                  java.lang.String deviceId)
Creates a search key.
Parameters:
view - java.lang.String - view name
storeId - java.lang.Integer - store Id
deviceId - java.lang.Integer - device format id
Returns:
java.lang.String - search key

find

public ViewRegistryEntry find(java.lang.String name,
                              java.lang.Integer storeId,
                              java.lang.Integer device)
This method will lookup a view command based on view name, store id and device id. If an entry cannot be found, it will return the entry corresponding to store id = ECConstants.EC_NO_STOREID
Parameters:
name - java.lang.String the name of the request
storeId - java.lang.Integer reference number of the store
device - java.lang.String device type id
Returns:
com.ibm.commerce.registry.ViewRegistryEntry

initialize

public void initialize()
                throws java.lang.Exception
Initializes the ViewRegistry. 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
This method refresh the view registry from the database.
Specified by:
refresh in interface Registry
Throws:
java.lang.Exception -  

removeAllElements

public void removeAllElements()
Removes all View Registry entries from the cache.

removeElement

public boolean removeElement(ViewRegistryEntry entry)
Removes an ViewRegistryEntry from the cache.
Parameters:
obj - the ViewRegistryEntry to be removed
Returns:
true if the ViewRegistryEntry was removed or false if it was not

singleton

public static ViewRegistry singleton()
This method returns a singleton view registry object.
Returns:
ViewRegistry - a singleton view Registry object