com.ibm.commerce.registry
Class TradingAgreementRegistry

java.lang.Object
  |
  +--com.ibm.commerce.registry.TradingAgreementRegistry
All Implemented Interfaces:
ItemUpdate, Protectable, Registry

public class TradingAgreementRegistry
extends java.lang.Object
implements Registry, ItemUpdate, Protectable

TradingAgreementRegistry is where the trading agreements are cached.


Field Summary
protected static java.util.Hashtable cache
           
protected static TradingAgreementRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry.Registry
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.registry.ItemUpdate
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.security.Protectable
COPYRIGHT
 
Constructor Summary
TradingAgreementRegistry()
          TradingAgreementRegistry constructor.
 
Method Summary
 void addElement(TradingAgreementAccessBean tradingAgreement)
          Adds a TradingAgreement to the list.
 TradingAgreementAccessBean find(java.lang.String key)
          This method will return the TradingAgreementAccessBean with a given id.
 TradingAgreementAccessBean[] findAll(java.lang.String[] taIdStr)
          This method will return all the TradingAgreementAccessBean with the given ids
 boolean fulfills(java.lang.Long member, java.lang.String relationship)
          Determine if a given user fulfills a given relationship with the resource.
 TradingAgreementAccessBean[] getAll()
          This method will return all the TradingAgreementAccessBean in the cache
 java.lang.Long getOwner()
          Returns the owner of a the TradingAgreementRegistry as a resource.
 void initialize()
          Initializes the TradingAgreementRegistry.
 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 removeAllElements()
          Removes all TradingAgreementAccessBean from the cache.
 boolean removeElement(java.lang.String key)
          Removes a TradingAgreemntAccessBean from the cache.
 boolean removeElement(TradingAgreementAccessBean ta)
          Removes a TradingAgreemntAccessBean from the cache.
static TradingAgreementRegistry singleton()
          This method returns a singleton object of the trading agreement registry.
 void update(java.lang.String action, java.lang.String key)
          Updates a given trading agreement element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static java.util.Hashtable cache

singleton

protected static TradingAgreementRegistry singleton
Constructor Detail

TradingAgreementRegistry

public TradingAgreementRegistry()
TradingAgreementRegistry constructor.
Method Detail

addElement

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

find

public TradingAgreementAccessBean find(java.lang.String key)
                                throws java.lang.Exception
This method will return the TradingAgreementAccessBean with a given id.
Parameters:
key - String - trading agreement id
Returns:
TradingAgreementAccessBean

findAll

public TradingAgreementAccessBean[] findAll(java.lang.String[] taIdStr)
                                     throws java.lang.Exception
This method will return all the TradingAgreementAccessBean with the given ids
Parameters:
tradingAgreement - String[]
Returns:
TradingAgreementAccessBean[]

fulfills

public boolean fulfills(java.lang.Long member,
                        java.lang.String relationship)
                 throws java.rmi.RemoteException,
                        java.lang.Exception
Determine if a given user fulfills a given relationship with the resource.

Specified by:
fulfills in interface Protectable
Parameters:
member - Long
relationship - java.lang.String
Returns:
boolean

getAll

public TradingAgreementAccessBean[] getAll()
This method will return all the TradingAgreementAccessBean in the cache
Returns:
TradingAgreementAccessBean[]

getOwner

public java.lang.Long getOwner()
                        throws ECException
Returns the owner of a the TradingAgreementRegistry as a resource.

Specified by:
getOwner in interface Protectable
Returns:
java.lang.Long
Throws:
ECException. -  

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
Throws:
java.lang.Exception -  

putAll

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

refresh

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

removeAllElements

public void removeAllElements()
Removes all TradingAgreementAccessBean from the cache.

removeElement

public boolean removeElement(java.lang.String key)
Removes a TradingAgreemntAccessBean from the cache.
Parameters:
key - String - trading agreement id
Returns:
true if the corresponding trading agreement access bean was removed successfully.

removeElement

public boolean removeElement(TradingAgreementAccessBean ta)
Removes a TradingAgreemntAccessBean from the cache.
Parameters:
obj - TradingAgreementAccessBean - trading agreement access bean
Returns:
true if the corresponding trading agreement access bean was removed successfully.

singleton

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

update

public void update(java.lang.String action,
                   java.lang.String key)
            throws java.lang.Exception
Updates a given trading agreement element.

Specified by:
update in interface ItemUpdate
Parameters:
action - java.lang.String - the valid actions are 'add', 'delete' and 'update'
key - java.lang.String - the key that identifies a particular element
Throws:
java.lang.Exception -