com.ibm.commerce.price.facade.server.util

Class ExternalPriceMemoryCache

  • java.lang.Object
    • com.ibm.commerce.price.facade.server.util.ExternalPriceMemoryCache


  • public class ExternalPriceMemoryCache
    extends java.lang.Object
    This class caches the PriceEntry items from the external CRM system. To get the instance of this class, call the ExternalPriceMemoryCache.instance() static method.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • instance

        public static ExternalPriceMemoryCache instance()
        This method gets the singleton instance of ExternalPriceMemoryCache, which should be initialized.
        Returns:
        Reference of class ExternalPriceMemoryCache instance.
      • shutdown

        public static void shutdown()
        Call this method when the WC application is being shut down.
      • isAvailable

        public boolean isAvailable()
        This method gets status of the price memory cache.
        Returns:
        An 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.
      • getCachedPriceEntry

        public 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.
        Parameters:
        key - The object which is used as a HashMap key to find cached price entry.
        Returns:
        A retrieved from DistributedMap using the specified ExternalPriceMemoryCacheKey key.
      • updateCachedPriceList

        public void updateCachedPriceList(java.lang.Object key,
                                          java.lang.Object value)
        This method updates the PriceEntryType cache when getting an update from external system.
        Parameters:
        key - The key used to identify the PriceEntry.
        value - The value used to update.
      • composePriceCacheKey

        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)
        This method composes ExternalPriceMemoryCacheKey using store ID, user ID, part number, currency, quantity.
        Parameters:
        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.
        Returns:
        An which is used as key to get value from price memory cache.
      • composePriceCacheStringKey

        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)
        This method composes Cache Key using store ID, user ID, part number, currency, quantity.
        Parameters:
        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.
        Returns:
        A cache key which is used to get value from price memory cache.
      • clear

        public void clear()
        This method clears all objects from the cache.