public class StoreRegistry extends AbstractManagedDynamicCacheRegistry
StoreAccessBean
objects.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REGISTRY_NAME
The name of this registry.
|
Constructor and Description |
---|
StoreRegistry()
This is the default constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Integer storeId,
StoreAccessBean bean,
java.util.Hashtable aCache)
Deprecated.
|
java.lang.Object |
createKey(java.lang.String strKey)
This method creates a cache key based on a key string.
|
java.lang.String |
createKeyString(TypedProperty prop)
This method creates a cache key based on input parameters.
|
StoreAccessBean |
find(java.lang.Integer storeId)
This method looks up a
StoreAccessBean object from the store registry. |
com.ibm.commerce.registry.StoreCopy |
find(java.lang.String astrOrganizationDN,
java.lang.String astrStoreName)
This method looks up a
StoreCopy object from the store registry. |
java.util.Collection |
findAllStoresByUserId(java.lang.Long userId)
This method searches all stores that the administrator can manage.
|
StoreAccessBean |
getStore(java.lang.Integer storeId)
This method looks up a
StoreAccessBean object from the store registry. |
int |
getStoreCount()
This method returns a count of all the stores defined.
|
java.util.Enumeration |
getStoreElements()
Deprecated.
|
void |
initialize()
This method initializes the store registry.
|
boolean |
isStoreGroup(java.lang.Integer storeId)
This method determines whether a given integer is a store group id.
|
void |
populate(com.ibm.commerce.registry.LRUDynamicHashtable aCache)
This method populates the cache with store objects from the database.
|
void |
refresh()
This method clears the cache.
|
java.lang.Object |
retrieve(java.lang.Object key)
This method retrieves a store object from the database and adds it to the cache.
|
static StoreRegistry |
singleton()
This method returns a singleton object of the store registry.
|
void |
update(java.lang.String action,
java.lang.Object key)
This method updates a cached element.
|
addElement, findObject, getCache, getCacheSize, getElement, getElementCount, getElements, getEvictions, getHits, getKeys, getMisses, getUsedCacheSize, removeAllElements, removeElement, setCache, setCacheSize, setInitialCapacity, setLoadFactor
public static final java.lang.String REGISTRY_NAME
public StoreRegistry()
public java.lang.String createKeyString(TypedProperty prop) throws java.lang.Exception
createKeyString
in interface ElementUpdate
createKeyString
in class AbstractManagedDynamicCacheRegistry
prop
- The input property.java.lang.Exception
public java.lang.Object createKey(java.lang.String strKey) throws java.lang.Exception
createKey
in interface ElementUpdate
createKey
in class AbstractManagedDynamicCacheRegistry
strKey
- The key as a String
object.java.lang.Exception
public java.lang.Object retrieve(java.lang.Object key) throws java.lang.Exception
retrieve
in class AbstractManagedDynamicCacheRegistry
A
- cache key .java.lang.Exception
public StoreAccessBean find(java.lang.Integer storeId)
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.storeId
- The store id.StoreAccessBean
object or null if store is not defined.public StoreAccessBean getStore(java.lang.Integer storeId)
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.storeId
- The store id.StoreAccessBean
object or null if store is not defined.public int getStoreCount()
public java.util.Enumeration getStoreElements()
StoreAccessBean
objects stored in the store registry.StoreAccessBean
objects.public void initialize() throws java.lang.Exception
WcsApp.storeRegistry
.initialize
in interface Registry
initialize
in class AbstractManagedDynamicCacheRegistry
java.lang.Exception
public void refresh() throws java.lang.Exception
StoreRelationshipCache.instance()
.refresh
in interface Registry
refresh
in class AbstractManagedDynamicCacheRegistry
java.lang.Exception
public void update(java.lang.String action, java.lang.Object key) throws java.lang.Exception
storepath
for
store relationship type ECConstants.EC_STRELTYP_CATALOG
;StoreRelationshipCache.instance()
.update
in interface ElementUpdate
update
in class AbstractManagedDynamicCacheRegistry
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.java.lang.Exception
public void populate(com.ibm.commerce.registry.LRUDynamicHashtable aCache) throws java.lang.Exception
populate
in class AbstractManagedDynamicCacheRegistry
aCache
- The cache to be populated.java.lang.Exception
public static StoreRegistry singleton()
StoreRegistry
object.public void addElement(java.lang.Integer storeId, StoreAccessBean bean, java.util.Hashtable aCache)
StoreAccessBean
object to the given cache.storeId
- The store id.bean
- A StoreAccessBean
object.aCache
- A Hashtable
object.public boolean isStoreGroup(java.lang.Integer storeId)
storeId
- The Integer
to be checked.public com.ibm.commerce.registry.StoreCopy find(java.lang.String astrOrganizationDN, java.lang.String astrStoreName) throws ECException
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.astrOrganizationDN
- The distinguished name of the organization that owns the store.astrStoreName
- The identifier attribute of the store.StoreCopy
object or null if no such store exists.ECException
public java.util.Collection findAllStoresByUserId(java.lang.Long userId) throws ECException
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.userId
- The user id of the administrator that is logged on.Collection
of StoreAccessBean
objects that this user can manage.ECException