Class DatabaseBasedAdaptiveLabelCacheDaoImpl

    • Constructor Detail

      • DatabaseBasedAdaptiveLabelCacheDaoImpl

        public DatabaseBasedAdaptiveLabelCacheDaoImpl​(org.hibernate.SessionFactory sessionFactory,
                                                      SpaceDao spaceDao)
    • Method Detail

      • read

        public LiteSearchResultCacheEntry read​(long spaceId)
        Reads cached record by space id. If cached record is expired, it will be returned anyway
        Specified by:
        read in interface AdaptiveLabelCacheDao
        Parameters:
        spaceId - - space id
        Returns:
        cached data
      • write

        public void write​(long spaceId,
                          LiteSearchResultCacheEntry cacheEntry)
        Writes cached data to the persistent cache A previous record will be overwritten
        Specified by:
        write in interface AdaptiveLabelCacheDao
        Parameters:
        spaceId - - space id
        cacheEntry - - cache entry
      • getSpaceKeyFromSpaceId

        public String getSpaceKeyFromSpaceId​(long spaceId)
        LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their keys Could be removed when LabelManager start supporting finding most used labels by space id
        Specified by:
        getSpaceKeyFromSpaceId in interface AdaptiveLabelCacheDao
        Parameters:
        spaceId - - space id
        Returns:
        space key
        Since:
        7.7.0
      • getSpaceIdByKey

        public long getSpaceIdByKey​(String spaceKey)
        LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their ids Could be removed when LabelManager start supporting finding most used labels by space id
        Specified by:
        getSpaceIdByKey in interface AdaptiveLabelCacheDao
        Parameters:
        spaceKey - - space key
        Returns:
        space key
        Since:
        7.7.0