Class AbstractCacheAdapter<V>

java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<V>
All Implemented Interfaces:
ICache<String,V>, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, IWithParameters, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
EhCache

public abstract class AbstractCacheAdapter<V> extends Object implements ICache<String,V>, FrankElement, IWithParameters
Baseclass for caching. Provides key transformation functionality.
Since:
4.11
Author:
Gerrit van Brakel
Specific parameters
key provides the key., value provides the value.
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
    • parameterList

      protected @NonNull ParameterList parameterList
  • Constructor Details

    • AbstractCacheAdapter

      public AbstractCacheAdapter()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • getElement

      protected abstract V getElement(String key)
    • putElement

      protected abstract void putElement(String key, V value)
    • removeElement

      protected abstract boolean removeElement(Object key)
    • toValue

      protected abstract V toValue(Message value)
    • transformKey

      public String transformKey(String input, PipeLineSession session)
      Description copied from interface: ICache
      Transform the current request message to a key in the cache-map. Allows for instance XPath translations.
      Specified by:
      transformKey in interface ICache<String,V>
    • transformValue

      public V transformValue(Message value, PipeLineSession session)
      Description copied from interface: ICache
      Transform the current response message to a value in the cache-map. Allows for instance XPath translations.
      Specified by:
      transformValue in interface ICache<String,V>
    • get

      public V get(String key)
      Description copied from interface: ICache
      Obtain a potentially cached value, set by put().
      Specified by:
      get in interface ICache<String,V>
    • put

      public void put(String key, V value)
      Description copied from interface: ICache
      store a value in the cache, that can be retrieved later using get().
      Specified by:
      put in interface ICache<String,V>
    • remove

      public boolean remove(String key)
    • setName

      @Optional public void setName(String name)
      Name of the cache, will be lowercased
      Specified by:
      setName in interface NameAware
      Default value
      <ownerName>_cache
    • getLogPrefix

      public String getLogPrefix()
    • setKeyXPath

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyXPath(String keyXPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      xpath expression to extract cache key from request message
    • setKeyXPathOutputType

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyXPathOutputType(TransformerPool.OutputType keyXPathOutputType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      output type of xpath expression to extract cache key from request message
      Default value
      text
    • setKeyNamespaceDefs

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyNamespaceDefs(String keyNamespaceDefs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      namespace definitions for keyxpath. must be in the form of a comma or space separated list of prefix=namespaceuri definitions
    • setKeyStyleSheet

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyStyleSheet(String keyStyleSheet)
      Deprecated, for removal: This API element is subject to removal in a future version.
      stylesheet to extract cache key from request message. Use in combination with cacheEmptyKeys to inhibit caching for certain groups of request messages
    • setKeyInputSessionKey

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyInputSessionKey(String keyInputSessionKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      session key to use as input for transformation of request message to key by keyxpath or keystylesheet
    • setCacheEmptyKeys

      public void setCacheEmptyKeys(boolean cacheEmptyKeys)
      controls whether empty keys are used for caching. when set true, cache entries with empty keys can exist.
      Default value
      false
    • setValueXPath

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueXPath(String valueXPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      xpath expression to extract value to be cached key from response message. Use in combination with cacheEmptyValues to inhibit caching for certain groups of response messages
    • setValueXPathOutputType

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueXPathOutputType(TransformerPool.OutputType valueXPathOutputType)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setValueNamespaceDefs

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueNamespaceDefs(String valueNamespaceDefs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      namespace definitions for valuexpath. must be in the form of a comma or space separated list of prefix=namespaceuri definitions
    • setValueStyleSheet

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueStyleSheet(String valueStyleSheet)
      Deprecated, for removal: This API element is subject to removal in a future version.
      stylesheet to extract value to be cached from response message
    • setValueInputSessionKey

      @Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueInputSessionKey(String valueInputSessionKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      session key to use as input for transformation of response message to cached value by valuexpath or valuestylesheet
    • setCacheEmptyValues

      public void setCacheEmptyValues(boolean cacheEmptyValues)
      controls whether empty values will be cached. when set true, empty cache entries can exist for any key.
      Default value
      false
    • addParameter

      public void addParameter(IParameter p)
      Specified by:
      addParameter in interface IWithParameters
    • getParameterList

      public @NonNull ParameterList getParameterList()
      Specified by:
      getParameterList in interface IWithParameters