public class ExternalPriceMemoryCache
extends java.lang.Object
PriceEntry
items from the external CRM system. To get the instance
of this class, call the ExternalPriceMemoryCache.instance()
static method.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
This method clears all objects from the cache.
|
ExternalPriceMemoryCacheKey |
composePriceCacheKey(java.lang.Long aUserId,
java.lang.Integer aStoreId,
java.lang.String aPartNumber,
java.lang.String aCurrency,
java.lang.Double aQuantityValue,
java.lang.String aUom)
This method composes
ExternalPriceMemoryCacheKey using store ID, user ID, part number,
currency, quantity . |
java.lang.String |
composePriceCacheStringKey(java.lang.Long aUserId,
java.lang.Integer aStoreId,
java.lang.String aPartNumber,
java.lang.String aCurrency,
java.lang.Double aQuantityValue,
java.lang.String aUom)
This method composes Cache Key using
store ID, user ID, part number,
currency, quantity . |
com.ibm.commerce.price.facade.datatypes.PriceEntryType |
getCachedPriceEntry(java.lang.Object key)
This method gets a price entry from the
DistributedMap according to specified key. |
static ExternalPriceMemoryCache |
instance()
This method gets the singleton instance of
ExternalPriceMemoryCache , which should be initialized. |
boolean |
isAvailable()
This method gets status of the price memory cache.
|
static void |
shutdown()
Call this method when the WC application is being shut down.
|
void |
updateCachedPriceList(java.lang.Object key,
java.lang.Object value)
This method updates the
PriceEntryType cache when getting an update from external system. |
public static final java.lang.String COPYRIGHT
public static ExternalPriceMemoryCache instance()
ExternalPriceMemoryCache
, which should be initialized.ExternalPriceMemoryCache
instance.public static void shutdown()
public boolean isAvailable()
boolean
value which indicates whether the price cache is available. Possible values
include:
true
: The price memory cache is available.false
: The price memory cache is unavailable.public com.ibm.commerce.price.facade.datatypes.PriceEntryType getCachedPriceEntry(java.lang.Object key)
DistributedMap
according to specified key.key
- The object which is used as a HashMap
key to find cached price entry.DistributedMap
using the specified
ExternalPriceMemoryCacheKey
key.public void updateCachedPriceList(java.lang.Object key, java.lang.Object value)
PriceEntryType
cache when getting an update from external system.key
- The key used to identify the PriceEntry
.value
- The value used to update.public ExternalPriceMemoryCacheKey composePriceCacheKey(java.lang.Long aUserId, java.lang.Integer aStoreId, java.lang.String aPartNumber, java.lang.String aCurrency, java.lang.Double aQuantityValue, java.lang.String aUom)
ExternalPriceMemoryCacheKey
using store ID, user ID, part number,
currency, quantity
.aUserId
- The user ID
.aStoreId
- The store ID
.aPartNumber
- The part number
.aCurrency
- The currency used to compose ExternalPriceMemoryCacheKey
.aQuantityValue
- The quantity used to compose ExternalPriceMemoryCacheKey
.aUom
- The uom
used to compose ExternalPriceMemoryCacheKey
.public java.lang.String composePriceCacheStringKey(java.lang.Long aUserId, java.lang.Integer aStoreId, java.lang.String aPartNumber, java.lang.String aCurrency, java.lang.Double aQuantityValue, java.lang.String aUom)
store ID, user ID, part number,
currency, quantity
.aUserId
- The user ID
.aStoreId
- The store ID
.aPartNumber
- The part number
.aCurrency
- The currency used to compose ExternalPriceMemoryCacheKey
.aQuantityValue
- The quantity used to compose ExternalPriceMemoryCacheKey
.aUom
- The uom
used to compose ExternalPriceMemoryCacheKey
.public void clear()