Interface IPageCacheManager

    • Field Detail

      • PAGE_CACHE_GEN_STATE_ENABLED

        static final int PAGE_CACHE_GEN_STATE_ENABLED
        See Also:
        Constant Field Values
      • PAGE_CACHE_GEN_STATE_DISABLED

        static final int PAGE_CACHE_GEN_STATE_DISABLED
        See Also:
        Constant Field Values
      • CLEAR_CACHE_CHANGE_TYPE_UPDATE

        static final int CLEAR_CACHE_CHANGE_TYPE_UPDATE
        See Also:
        Constant Field Values
      • CLEAR_CACHE_CHANGE_TYPE_DELETE

        static final int CLEAR_CACHE_CHANGE_TYPE_DELETE
        See Also:
        Constant Field Values
    • Method Detail

      • generatePage

        PageCacheConfig generatePage​(String pageCacheId)
                              throws PortalException
        Generates a page cache. If the generation lock could not be obtained, the page is not generated.
        Parameters:
        pageCacheId - the page cache identifier.
        Returns:
        the generated page cache information, or null if the generation lock could not be obtained.
        Throws:
        PortalException
        Since:
        4.1.0
      • clearCacheByPagesIds

        void clearCacheByPagesIds​(SessionConfig sessionConfig,
                                  Collection<String> pagesIds,
                                  Map<String,​String[]> parameters,
                                  Locale locale,
                                  int changeType,
                                  ITransaction transaction)
                           throws PortalException
        Clear the cache of the specified pages. This method clears the specified pages cache after the transaction commits.
        Parameters:
        sessionConfig - the user session information.
        pagesIds - a collection of the pages identifiers.
        parameters - the page parameters. Used to filter which caches are cleared.
        locale - specifies the locale to which the cache clearing is to be applied. May be null to indicate any locale.
        changeType - the cause of the cache clear. Must be one of the CLEAR_CACHE_CHANGE_TYPE_* constants.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        6.0.0
      • clearCacheByChannelIds

        void clearCacheByChannelIds​(SessionConfig sessionConfig,
                                    Collection<String> channelIds,
                                    Map<String,​String[]> parameters,
                                    int changeType,
                                    ITransaction transaction)
                             throws PortalException
        Clear the cache of the pages within the specified channels recursively. This method will clear the specified pages cache after the transaction commits.
        Parameters:
        sessionConfig - the user session information.
        parameters - the page parameters. Used to filter which caches are cleared.
        changeType - the cause of the cache clear. Must be one of the CLEAR_CACHE_CHANGE_TYPE_* constants.
        transaction - the transaction for persistence access.
        pagesIds - a collection of the pages identifiers.
        Throws:
        PortalException
        Since:
        6.0.0
      • clearAllHTMLCache

        void clearAllHTMLCache​(ITransaction transaction)
                        throws PortalException
        Clears all page HTML cache.
        Parameters:
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.1.0
      • clearPageCacheErrors

        void clearPageCacheErrors​(Collection<String> pageCacheIds,
                                  ITransaction transaction)
                           throws PortalException
        Clear page cache errors in the database. It is locked for update before being updated.
        Parameters:
        pageCacheIds - the page cache identifiers.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        5.0.0
      • processHTMLForPageCache

        @Deprecated
        default String processHTMLForPageCache​(String htmlContent,
                                               PageCacheConfig pageCache,
                                               boolean convertGuestOnlyCaches)
                                        throws PortalException
        Deprecated.
        since 10.3.0 replaced by processHTMLForPageCache(String, PageCacheConfig). From the version 10.3.0 on, the parameter convertGuestOnlyCaches is ignored.
        Processes a HTML code for storing for a page cache.
        Parameters:
        htmlContent - HTML code.
        pageCache - the page cache the code will be used in.
        convertGuestOnlyCaches - if true, pages with cache enabled only for guest will also have their dynamic paths converted.
        Returns:
        the processed HTML code.
        Throws:
        PortalException
        Since:
        5.0.0
      • processHTMLForPageCache

        String processHTMLForPageCache​(String htmlContent,
                                       PageCacheConfig pageCache)
                                throws PortalException
        Processes a HTML code for storing for a page cache.
        Parameters:
        htmlContent - HTML code.
        pageCache - the page cache the code will be used in.
        Returns:
        the processed HTML code.
        Throws:
        PortalException
        Since:
        10.3.0
      • isPageCacheGenerationEnabled

        boolean isPageCacheGenerationEnabled()
        Indicates if the page cache generation is globally enabled.
        Returns:
        true if enabled, false otherwise.
        Since:
        5.0.0
      • setPageCacheGenerationState

        void setPageCacheGenerationState​(SessionConfig sessionConfig,
                                         int state,
                                         ITransaction transaction)
                                  throws PortalException
        Sets the page cache generation state
        Parameters:
        sessionConfig -
        state -
        transaction -
        Throws:
        PortalException
        Since:
        4.0.11
      • updateCachedFilesLastModifiedDate

        void updateCachedFilesLastModifiedDate​(SessionConfig sessionConfig,
                                               PageConfig pageConfig,
                                               Locale locale,
                                               Date lastModifiedDate,
                                               ITransaction transaction)
                                        throws PortalException
        Updates the last modified date of the cached files that match the given pageId and locale.
        Parameters:
        sessionConfig - the user session information.
        pageConfig - the portal page.
        locale - locale for which the cached files needs to be modified.
        lastModifiedDate - date to which the matched files must be modified to.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
        Since:
        4.0.11
      • waitForPagesReadyToGenerate

        void waitForPagesReadyToGenerate​(long timeout,
                                         boolean forImmediateUseOnly)
                                  throws PortalException,
                                         InterruptedException
        Waits for new pages to be ready to be generated.
        Parameters:
        timeout - maximum time to wait.
        forImmediateUseOnly - if true, wait until a page for immediate use is ready to generate. If false, wait until any page is ready to generate.
        Throws:
        InterruptedException - if the thread was interrupted.
        PortalException
        Since:
        4.1.0
      • pageCacheMissed

        void pageCacheMissed​(String pageCacheId,
                             boolean forImmediateUse)
                      throws PortalException
        Indicates a miss in the page cache occurred. This provokes an asynchronous page cache generation and causes an increase in its priority due to the interest in accessing it.
        Parameters:
        pageCacheId - the page cache identifier.
        forImmediateUse - if true, indicates that the missed page cache is required for immediate use. This will greater boost the priority to generate the corresponding page cache.
        Throws:
        IllegalStateException - if the specified page cache cannot be generated due to its current state or the page cache framework's state.
        PortalException
        Since:
        4.1.0