com.ibm.commerce.registry
Class TradingAgreementRegistry

java.lang.Object
  |
  +--com.ibm.commerce.registry.AbstractManagedDynamicCacheRegistry
        |
        +--com.ibm.commerce.registry.TradingAgreementRegistry
All Implemented Interfaces:
ElementUpdate, ManagedDynamicCache, Registry

public class TradingAgreementRegistry
extends AbstractManagedDynamicCacheRegistry

TradingAgreementRegistry is where the trading agreements are cached.


Field Summary
protected static  TradingAgreementRegistry singleton
          A pointer to the trading agreement registry
 
Fields inherited from class com.ibm.commerce.registry. AbstractManagedDynamicCacheRegistry
COPYRIGHT
 
Constructor Summary
TradingAgreementRegistry()
          TradingAgreementRegistry constructor.
 
Method Summary
 void addElement( TradingAgreementAccessBean tradingAgreement)
          Add a TradingAgreement to the list.
 java.lang.Object createKey(java.lang.String strKey)
          Creates a cache key
 java.lang.String createKeyString( TypedProperty prop)
          Creates a cache key
  TradingAgreementAccessBean find(java.lang.String key)
          Returns the TradingAgreementAccessBean with a given id from the cache.
  TradingAgreementAccessBean[] findAll(java.lang.String[] taIdStr)
          Returns all the TradingAgreementAccessBean with the given ids from the cache
  TradingAgreementAccessBean[] getAll()
          Returns all the TradingAgreementAccessBean in the cache
 void initialize()
          Initializes the TradingAgreementRegistry.
 void populate( LRUDynamicHashtable aCache)
          Populates the cache.
 void putAll( TradingAgreementAccessBean[] ta)
          This method will store the give TradingAgreementAccessBean in the registry
 void refresh()
          This method refresh the trading agreement registry from the database.
 void refreshDependentRegistry(java.lang.String astrRegistryName)
          Refreshes a dependent registry.
 java.lang.Object retrieve(java.lang.Object key)
          Retrieves an TradingAgreementAccessBean from the database.
static  TradingAgreementRegistry singleton()
          This method returns a singleton object of the trading agreement registry.
 void update(java.lang.String action, java.lang.Object key)
          Updates a given trading agreement element.
 void updateDependentRegistry(java.lang.String astrRegistryName, java.lang.String astrAction, java.lang.Object aKey)
          Updates a dependent registry.
 
Methods inherited from class com.ibm.commerce.registry. AbstractManagedDynamicCacheRegistry
addElement, findObject, getCache, getCacheSize, getElement, getElementCount, getElements, getEvictions, getHits, getKeys, getMisses, getUsedCacheSize, removeAllElements, removeElement, setCache, setCacheSize, setInitialCapacity, setLoadFactor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

protected static TradingAgreementRegistry singleton
A pointer to the trading agreement registry
Constructor Detail

TradingAgreementRegistry

public TradingAgreementRegistry()
TradingAgreementRegistry constructor.
Method Detail

addElement

public void addElement(TradingAgreementAccessBean tradingAgreement)
Add a TradingAgreement to the list.
Parameters:
tradingAgreement - the TradingAgreementAccessBean to be added to the list

find

public TradingAgreementAccessBean find(java.lang.String key)
                                throws java.lang.Exception
Returns the TradingAgreementAccessBean with a given id from the cache.
Parameters:
key - The trading agreement identifier
Returns:
A trading agreement access bean
Throws:
java.lang.Exception

findAll

public TradingAgreementAccessBean[] findAll(java.lang.String[] taIdStr)
                                     throws java.lang.Exception
Returns all the TradingAgreementAccessBean with the given ids from the cache
Parameters:
taIdStr - The list of trading agreement identifiers
Returns:
An array of trading agreement access beans
Throws:
java.lang.Exception

getAll

public TradingAgreementAccessBean[] getAll()
Returns all the TradingAgreementAccessBean in the cache
Returns:
An array of trading agreement access beans

initialize

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

putAll

public void putAll(TradingAgreementAccessBean[] ta)
This method will store the give TradingAgreementAccessBean in the registry
Parameters:
ta - An array of trading agreement access beans

updateDependentRegistry

public void updateDependentRegistry(java.lang.String astrRegistryName,
                                    java.lang.String astrAction,
                                    java.lang.Object aKey)
Updates a dependent registry.
Parameters:
astrRegistryName - the registry name.
astrAction - the action.
aKey - the key.
Throws:
java.lang.Exception

refreshDependentRegistry

public void refreshDependentRegistry(java.lang.String astrRegistryName)
Refreshes a dependent registry.
Parameters:
astrRegistryName - the registry name.
Throws:
java.lang.Exception

refresh

public void refresh()
             throws java.lang.Exception
This method refresh the trading agreement registry from the database.
Specified by:
refresh in interface Registry
Overrides:
refresh in class AbstractManagedDynamicCacheRegistry
Throws:
java.lang.Exception

singleton

public static TradingAgreementRegistry singleton()
This method returns a singleton object of the trading agreement registry.
Returns:
A singleton TradingAgreementRegistry object

update

public void update(java.lang.String action,
                   java.lang.Object key)
            throws java.lang.Exception
Updates a given trading agreement element.
Specified by:
update in interface ElementUpdate
Overrides:
update in class AbstractManagedDynamicCacheRegistry
Parameters:
action - The valid actions are 'add', 'delete' and 'update'
key - The key that identifies a particular element
Throws:
java.lang.Exception

retrieve

public java.lang.Object retrieve(java.lang.Object key)
                          throws java.lang.Exception
Retrieves an TradingAgreementAccessBean from the database.
Specified by:
retrieve in class AbstractManagedDynamicCacheRegistry
Parameters:
key - The key used to locate the object from the database
Returns:
The TradingAgreementAccessBean found from the given key
Throws:
java.lang.Exception

populate

public void populate(LRUDynamicHashtable aCache)
              throws java.lang.Exception
Populates the cache.
Specified by:
populate in class AbstractManagedDynamicCacheRegistry
Parameters:
aCache - The hashtable table to be populated
Returns:
the object associated with the key
Throws:
java.lang.Exception

createKeyString

public java.lang.String createKeyString(TypedProperty prop)
                                 throws java.lang.Exception
Creates a cache key
Specified by:
createKeyString in interface ElementUpdate
Specified by:
createKeyString in class AbstractManagedDynamicCacheRegistry
Parameters:
prop - The input properties
Returns:
a cache key
Throws:
java.lang.Exception

createKey

public java.lang.Object createKey(java.lang.String strKey)
                           throws java.lang.Exception
Creates a cache key
Specified by:
createKey in interface ElementUpdate
Specified by:
createKey in class AbstractManagedDynamicCacheRegistry
Parameters:
strKey - The string representation of the cache key.
Returns:
a cache key
Throws:
java.lang.Exception