lumis.portal.page.cache
Interface IPageCacheManager

Package class diagram package IPageCacheManager
All Known Implementing Classes:
PageCacheManager

public interface IPageCacheManager

Provides page cache operations.

Since:
4.0.0
See Also:
lumis.portal.page.cache

Nested Class Summary
static class IPageCacheManager.GenerationOutcome
          Indicates the outcome of a page generation.
 
Field Summary
static int CLEAR_CACHE_CHANGE_TYPE_DELETE
           
static int CLEAR_CACHE_CHANGE_TYPE_UPDATE
           
static int PAGE_CACHE_GEN_STATE_DISABLED
           
static int PAGE_CACHE_GEN_STATE_ENABLED
           
 
Method Summary
 void clearAllHTMLCache(ITransaction transaction)
          Clears all page HTML cache.
 void clearCacheByChannelIds(SessionConfig sessionConfig, Collection<String> channelIds, Map<String,String[]> parameters, int changeType, ITransaction transaction)
          Clear the cache of the pages within the specified channels recursively.
 void clearCacheByPagesIds(SessionConfig sessionConfig, Collection<String> pagesIds, Map<String,String[]> parameters, Locale locale, int changeType, ITransaction transaction)
          Clear the cache of the specified pages.
 void clearPageCacheErrors(Collection<String> pageCacheIds, ITransaction transaction)
          Clear page cache errors in the database.
 void delete(SessionConfig sessionConfig, String pageCacheId, ITransaction transaction)
          Delete a page cache.
 void expirePageCache(PageCacheConfig pageCacheConfig)
          Expires a single PageCacheConfig.
 PageCacheConfig generatePage(String pageCacheId)
          Generates a page cache.
 PageCacheConfig get(String pageCacheId)
          Returns a page cache given its identifier.
 int getPageCacheGenerationState(SessionConfig sessionConfig, ITransaction transaction)
          Deprecated. Since 5.0.0, replaced by isPageCacheGenerationEnabled() for better performance and easier use.
 boolean isPageCacheGenerationEnabled()
          Indicates if the page cache generation is globally enabled.
 void pageCacheMissed(String pageCacheId, boolean forImmediateUse)
          Indicates a miss in the page cache occurred.
 String processHTMLForPageCache(String htmlContent, PageCacheConfig pageCache, boolean convertGuestOnlyCaches)
          Processes a HTML code for storing for a page cache.
 void setPageCacheGenerationState(SessionConfig sessionConfig, int state, ITransaction transaction)
          Sets the page cache generation state
 void updateCachedFilesLastModifiedDate(SessionConfig sessionConfig, PageConfig pageConfig, Locale locale, Date lastModifiedDate, ITransaction transaction)
          Updates the last modified date of the cached files that match the given pageId and locale.
 String waitForGeneration(String pageCacheId, long timeout)
          Waits for the generation of a page cache.
 void waitForPagesReadyToGenerate(long timeout, boolean forImmediateUseOnly)
          Waits for new pages to be ready to be generated.
 

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

get

PageCacheConfig get(String pageCacheId)
                    throws PortalException
Returns a page cache given its identifier.

Parameters:
pageCacheId - the page cache identifier.
Returns:
the persistent page cache instance.
Throws:
PortalObjectNotFoundException - if no page cache with the given identifier was found.
PortalException
Since:
5.0.0

delete

void delete(SessionConfig sessionConfig,
            String pageCacheId,
            ITransaction transaction)
            throws ManagerException,
                   PortalException
Delete a page cache.

Parameters:
sessionConfig -
pageCacheId -
transaction -
Throws:
ManagerException
PortalException

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

String processHTMLForPageCache(String htmlContent,
                               PageCacheConfig pageCache,
                               boolean convertGuestOnlyCaches)
                               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.
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

expirePageCache

void expirePageCache(PageCacheConfig pageCacheConfig)
                     throws PortalException
Expires a single PageCacheConfig.

Parameters:
pageCacheConfig - the page cache to expired.
Throws:
PortalException
Since:
6.1.0

getPageCacheGenerationState

@Deprecated
int getPageCacheGenerationState(SessionConfig sessionConfig,
                                           ITransaction transaction)
                                throws PortalException
Deprecated. Since 5.0.0, replaced by isPageCacheGenerationEnabled() for better performance and easier use.

Returns whether page cache generation is enabled or not

Parameters:
sessionConfig -
transaction -
Returns:
Throws:
PortalException
Since:
4.0.11

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

waitForGeneration

String waitForGeneration(String pageCacheId,
                         long timeout)
                         throws PortalException,
                                InterruptedException
Waits for the generation of a page cache.

Parameters:
pageCacheId - the page cache identifier.
timeout - maximum time to wait.
Returns:
the generated page content.
Throws:
InterruptedException - if the thread was interrupted.
PortalException
Since:
4.1.0

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


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.