Class CachingMapPropertiesManagerImpl

  • All Implemented Interfaces:
    PropertiesManager

    public class CachingMapPropertiesManagerImpl
    extends PropertiesManagerImpl
    implements PropertiesManager
    Faster alternative for CachingPropertiesManagerImpl, based on code donation by Ebrahim Aharpour. To use it, call interface method getProperties(HippoBean baseBean) which is overridden, or use public non-interface method getProperties(HippoBean baseBean, Locale locale) to get cached maps. See https://issues.onehippo.com/browse/HIPPLUG-671
    • Constructor Detail

      • CachingMapPropertiesManagerImpl

        public CachingMapPropertiesManagerImpl()
    • Method Detail

      • invalidate

        public void invalidate​(String canonicalPath)
        Description copied from class: PropertiesManagerImpl
        Invalidate a cached document based on the canonical path of a properties document, or invalidate all if the path is null.
        Specified by:
        invalidate in interface PropertiesManager
        Overrides:
        invalidate in class PropertiesManagerImpl
        Parameters:
        canonicalPath - the path of a properties document, relative to the base bean, or null.
      • getProperties

        public Map<String,​String> getProperties​(org.hippoecm.hst.content.beans.standard.HippoBean baseBean)
        Description copied from class: AbstractPropertiesManager
        Returns a map with String name/value pairs. Get the properties from the document with the default name at the default location.
        Specified by:
        getProperties in interface PropertiesManager
        Overrides:
        getProperties in class AbstractPropertiesManager
        Parameters:
        baseBean - the base bean from where to get the properties location, normally the siteContentBaseBean.
      • getProperties

        public Map<String,​String> getProperties​(org.hippoecm.hst.content.beans.standard.HippoBean baseBean,
                                                      Locale locale)
        getProperties method with a locale (not in PropertiesManager interface)
      • createCanonicalKey

        protected String createCanonicalKey​(org.hippoecm.hst.content.beans.standard.HippoBean location,
                                            String path)
                                     throws javax.jcr.RepositoryException
        Create a key for a location an a relative path of a properties document.
        Throws:
        javax.jcr.RepositoryException
      • getFromCache

        protected Map<String,​String> getFromCache​(String localeKey)
        Get a properties bean from cache.
      • storeInCache

        protected void storeInCache​(String canonicalKey,
                                    String localeKey,
                                    Map<String,​String> propertiesBean)
        Store a properties bean in cache. NB synchronized method: although the caches are synchronized themselves, adding values to cached lists is not.
      • getPropertiesMapByLocale

        protected Map<String,​String> getPropertiesMapByLocale​(org.hippoecm.hst.content.beans.standard.HippoBean location,
                                                                    String path,
                                                                    Locale locale)