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
 String add(SessionConfig sessionConfig, PageCacheConfig pageCacheConfig, ITransaction transaction)
          Adds a Page Cache Config object.
 void addOrUpdate(SessionConfig sessionConfig, PageCacheConfig pageCacheConfig, ITransaction transaction)
          If the Page Cache Config exists, it is updated, else it is added.
 void clearAllHTMLCache(ITransaction transaction)
          Clears all page HTML cache.
 void clearCacheByChannelIds(SessionConfig sessionConfig, Collection<String> channelIds, Parameters parameters, int changeType, boolean clearImmediately, ITransaction transaction)
          Clear the cache of the pages within the specified channels recursively.
 void clearCacheByPagesIds(SessionConfig sessionConfig, Collection<String> pagesIds, Parameters parameters, int changeType, boolean clearImmediately, ITransaction transaction)
          Deprecated. Since 4.1.0 replaced by #clearCacheByPagesIds(SessionConfig,Collection,Parameters,Locale,int,boolean,ITransaction).
 void clearCacheByPagesIds(SessionConfig sessionConfig, Collection<String> pagesIds, Parameters parameters, int changeType, ITransaction transaction)
          Deprecated. Since 4.0.11 replaced by #clearCacheByPagesIds(SessionConfig,Collection,Parameters,int,boolean,ITransaction).
 void clearCacheByPagesIds(SessionConfig sessionConfig, Collection<String> pagesIds, Parameters parameters, Locale locale, int changeType, boolean clearImmediately, ITransaction transaction)
          Clear the cache of the specified pages.
 void clearCacheByServiceInterfaceInstances(SessionConfig sessionConfig, Collection<ServiceInterfaceInstanceConfig> serviceInterfaceInstances, Parameters parameters, int changeType, ITransaction transaction)
          Deprecated. Since 4.1.0 removed without replacement. Consider using clearCacheByPagesIds(SessionConfig, Collection, Parameters, Locale, int, boolean, ITransaction) instead.
 void clearCacheByServiceInterfaceInstancesIds(SessionConfig sessionConfig, Collection<String> serviceInterfaceInstanceIds, Parameters parameters, int changeType, ITransaction transaction)
          Deprecated. Since 4.0.11 removed without replacement. Consider using clearCacheByPagesIds(SessionConfig, Collection, Parameters, Locale, int, boolean, ITransaction) instead.
 String convertMainUrl(SessionConfig sessionConfig, String mainUrl, ITransaction transaction)
          Converts a url to main.jsp to a url to the cached page html url.
 void delete(SessionConfig sessionConfig, String pageCacheId, ITransaction transaction)
          Delete a page cache.
 PageCacheConfig generateNextPage(boolean forImmediateUseOnly)
          Generates next outdated page cache, according to its priority.
 PageCacheConfig generatePage(String pageCacheId)
          Generates a page cache.
 PageCacheConfig get(SessionConfig sessionConfig, String pageCacheId, ITransaction transaction)
          Returns a page cache config given its id.
 PageCacheConfig getByCachedPageProperties(SessionConfig sessionConfig, PageCacheConfig cachedPageProperties, ITransaction transaction)
          Given the url and language, this method returns the appropriate page cache config.
 String getCachedPageId(SessionConfig sessionConfig, PageCacheConfig pageCacheConfig)
          Get the Id of the Page's cache.
 int getPageCacheGenerationState(SessionConfig sessionConfig, ITransaction transaction)
          Returns whether page cache generation is enabled or not
 String getPageCacheRelativePath(PageConfig pageConfig, String cachedPageId)
          Returns the path, relative to the web application root, where a page cached HTML is stored.
 String getPageCacheRelativePath(String pageCacheId, ITransaction transaction)
          Returns the path, relative to the web application root, where a page cached HTML is stored.
 String getPageUrl(PageCacheConfig pageCacheConfig, ITransaction transaction)
          Get the Page's URL.
 void pageCacheMissed(String pageCacheId, boolean forImmediateUse)
          Indicates a miss in the page cache occurred.
 String parseHTMLContent(SessionConfig sessionConfig, String htmlContent, String cachedPageId, int cacheType, ITransaction transaction)
          Processes the HTML content correcting relative paths.
 String processHtmlReferencesToCachedPages(SessionConfig sessionConfig, String html, ITransaction transaction)
          Finds in the given html dynamic references to cached pages, adding PageCacheConfig when a proper one does not already exist.
 void setPageCacheGenerationState(SessionConfig sessionConfig, int state, ITransaction transaction)
          Sets the page cache generation state
 void update(SessionConfig sessionConfig, PageCacheConfig pageCacheConfig, ITransaction transaction)
          Updates a Page Cache Config Object.
 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(SessionConfig sessionConfig,
                    String pageCacheId,
                    ITransaction transaction)
                    throws ManagerException,
                           PortalException
Returns a page cache config given its id.

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

add

String add(SessionConfig sessionConfig,
           PageCacheConfig pageCacheConfig,
           ITransaction transaction)
           throws ManagerException,
                  PortalException
Adds a Page Cache Config object.

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

update

void update(SessionConfig sessionConfig,
            PageCacheConfig pageCacheConfig,
            ITransaction transaction)
            throws ManagerException,
                   PortalException
Updates a Page Cache Config Object.

Parameters:
sessionConfig -
pageCacheConfig -
transaction -
Throws:
ManagerException
PortalException
Since:
4.0.11

addOrUpdate

void addOrUpdate(SessionConfig sessionConfig,
                 PageCacheConfig pageCacheConfig,
                 ITransaction transaction)
                 throws ManagerException,
                        PortalException
If the Page Cache Config exists, it is updated, else it is added.

Parameters:
sessionConfig -
pageCacheConfig -
transaction -
Throws:
ManagerException
PortalException
Since:
4.0.11

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

generateNextPage

PageCacheConfig generateNextPage(boolean forImmediateUseOnly)
                                 throws PortalException
Generates next outdated page cache, according to its priority. If the generation lock could not be obtained, the page is not generated.

Parameters:
forImmediateUseOnly - if true, only pages whose priority is higher than PageCacheConfig.MAX_INITIAL_PRIORITY are taken in account.
Returns:
the generated page cache information, or null if the generation lock could not be obtained or if there is no outdated page (as specified in the parameters).
Throws:
PortalException
Since:
4.1.0

getPageUrl

String getPageUrl(PageCacheConfig pageCacheConfig,
                  ITransaction transaction)
                  throws ManagerException,
                         PortalException
Get the Page's URL.

Parameters:
pageCacheConfig -
transaction -
Returns:
a String.
Throws:
ManagerException
PortalException

getCachedPageId

String getCachedPageId(SessionConfig sessionConfig,
                       PageCacheConfig pageCacheConfig)
                       throws ManagerException,
                              PortalException
Get the Id of the Page's cache.

Parameters:
sessionConfig - TODO
pageCacheConfig -
Returns:
a String.
Throws:
ManagerException
PortalException

clearCacheByServiceInterfaceInstancesIds

@Deprecated
void clearCacheByServiceInterfaceInstancesIds(SessionConfig sessionConfig,
                                                         Collection<String> serviceInterfaceInstanceIds,
                                                         Parameters parameters,
                                                         int changeType,
                                                         ITransaction transaction)
                                              throws ManagerException,
                                                     PortalException
Deprecated. Since 4.0.11 removed without replacement. Consider using clearCacheByPagesIds(SessionConfig, Collection, Parameters, Locale, int, boolean, ITransaction) instead.

Clear the cache given the Id of the Service's Interface's Instance.

Parameters:
sessionConfig -
serviceInterfaceInstanceIds -
parameters -
changeType -
transaction -
Throws:
ManagerException
PortalException

clearCacheByServiceInterfaceInstances

@Deprecated
void clearCacheByServiceInterfaceInstances(SessionConfig sessionConfig,
                                                      Collection<ServiceInterfaceInstanceConfig> serviceInterfaceInstances,
                                                      Parameters parameters,
                                                      int changeType,
                                                      ITransaction transaction)
                                           throws ManagerException,
                                                  PortalException
Deprecated. Since 4.1.0 removed without replacement. Consider using clearCacheByPagesIds(SessionConfig, Collection, Parameters, Locale, int, boolean, ITransaction) instead.

Clear the page cache given a list Service Interface Instances.

Parameters:
sessionConfig -
serviceInterfaceInstances -
parameters -
changeType -
transaction -
Throws:
ManagerException
PortalException

clearCacheByPagesIds

@Deprecated
void clearCacheByPagesIds(SessionConfig sessionConfig,
                                     Collection<String> pagesIds,
                                     Parameters parameters,
                                     int changeType,
                                     ITransaction transaction)
                          throws ManagerException,
                                 PortalException
Deprecated. Since 4.0.11 replaced by #clearCacheByPagesIds(SessionConfig,Collection,Parameters,int,boolean,ITransaction).

Clear the cache given the Ids of the Pages.

Parameters:
sessionConfig -
pagesIds -
parameters -
changeType -
transaction -
Throws:
ManagerException
PortalException

clearCacheByPagesIds

@Deprecated
void clearCacheByPagesIds(SessionConfig sessionConfig,
                                     Collection<String> pagesIds,
                                     Parameters parameters,
                                     int changeType,
                                     boolean clearImmediately,
                                     ITransaction transaction)
                          throws PortalException
Deprecated. Since 4.1.0 replaced by #clearCacheByPagesIds(SessionConfig,Collection,Parameters,Locale,int,boolean,ITransaction).

Clear the cache of the specified pages. This method always clears the specified pages cache after the transaction commits. If clearImmediately is set to true, it will also clear the specified pages cache immediately, synchronously.

Parameters:
sessionConfig - the user session information.
pagesIds - a collection of the pages identifiers.
parameters - the page parameters.
changeType - the cause of the cache clear. Must be one of the CLEAR_CACHE_CHANGE_TYPE_* constants.
clearImmediately - if the cache clearing is also to be executed immediately.
transaction - the transaction for persistence access.
Throws:
PortalException
Since:
4.0.11

clearCacheByPagesIds

void clearCacheByPagesIds(SessionConfig sessionConfig,
                          Collection<String> pagesIds,
                          Parameters parameters,
                          Locale locale,
                          int changeType,
                          boolean clearImmediately,
                          ITransaction transaction)
                          throws PortalException
Clear the cache of the specified pages. This method always clears the specified pages cache after the transaction commits. If clearImmediately is set to true, it will also clear the specified pages cache immediately, synchronously.

Parameters:
sessionConfig - the user session information.
pagesIds - a collection of the pages identifiers.
parameters - the page parameters.
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.
clearImmediately - if the cache clearing is also to be executed immediately.
transaction - the transaction for persistence access.
Throws:
PortalException
Since:
4.1.0

clearCacheByChannelIds

void clearCacheByChannelIds(SessionConfig sessionConfig,
                            Collection<String> channelIds,
                            Parameters parameters,
                            int changeType,
                            boolean clearImmediately,
                            ITransaction transaction)
                            throws PortalException
Clear the cache of the pages within the specified channels recursively. This method always clears the specified pages cache after the transaction commits. If clearImmediately is set to true, it will also clear the specified pages cache immediately, synchronously.

Parameters:
sessionConfig - the user session information.
pagesIds - a collection of the pages identifiers.
parameters - the page parameters.
changeType - the cause of the cache clear. Must be one of the CLEAR_CACHE_CHANGE_TYPE_* constants.
clearImmediately - if the cache clearing is also to be executed immediately.
transaction - the transaction for persistence access.
Throws:
PortalException
Since:
4.0.11

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

parseHTMLContent

String parseHTMLContent(SessionConfig sessionConfig,
                        String htmlContent,
                        String cachedPageId,
                        int cacheType,
                        ITransaction transaction)
                        throws ManagerException,
                               PortalException
Processes the HTML content correcting relative paths.

Parameters:
sessionConfig -
htmlContent -
cachedPageId -
cacheType -
transaction -
Returns:
Throws:
ManagerException
PortalException
Since:
4.0.7

getPageCacheGenerationState

int getPageCacheGenerationState(SessionConfig sessionConfig,
                                ITransaction transaction)
                                throws PortalException
Returns whether page cache generation is enabled or not

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

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

getByCachedPageProperties

PageCacheConfig getByCachedPageProperties(SessionConfig sessionConfig,
                                          PageCacheConfig cachedPageProperties,
                                          ITransaction transaction)
                                          throws ManagerException,
                                                 PortalException
Given the url and language, this method returns the appropriate page cache config.

If no config is found, a PortalObjectNotFound exception is thrown.

Parameters:
sessionConfig -
cachedPageProperties -
transaction -
Returns:
Throws:
ManagerException
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

getPageCacheRelativePath

String getPageCacheRelativePath(PageConfig pageConfig,
                                String cachedPageId)
                                throws PortalException
Returns the path, relative to the web application root, where a page cached HTML is stored.

Parameters:
pageConfig - the page that is cached.
pageCacheId - the page cache identifier.
Returns:
the cache file path, relative to the web application root.
Throws:
PortalException
Since:
4.1.0

getPageCacheRelativePath

String getPageCacheRelativePath(String pageCacheId,
                                ITransaction transaction)
                                throws PortalException
Returns the path, relative to the web application root, where a page cached HTML is stored.

This method may access the database. Consider using getPageCacheRelativePath(PageConfig, String) for better performance if the corresponding PageConfig is already available.

Parameters:
pageCacheId - the page cache identifier.
transaction - the transaction for persistence access.
Returns:
the cache file path, relative to the web application root.
Throws:
PortalException
Since:
4.1.0

processHtmlReferencesToCachedPages

String processHtmlReferencesToCachedPages(SessionConfig sessionConfig,
                                          String html,
                                          ITransaction transaction)
                                          throws PortalException
Finds in the given html dynamic references to cached pages, adding PageCacheConfig when a proper one does not already exist. The dynamic references are replaced by static references.

Parameters:
sessionConfig - user session information.
html - the html.
transaction - transaction for persistence access.
Returns:
the html, with dynamic references replaced by static references.
Throws:
PortalException
Since:
4.1.0

convertMainUrl

String convertMainUrl(SessionConfig sessionConfig,
                      String mainUrl,
                      ITransaction transaction)
                      throws PortalException
Converts a url to main.jsp to a url to the cached page html url. Creates the PageCacheConfig if necessary and appropriated.

Parameters:
sessionConfig - the user session information.
mainUrl - the url to main.jsp. Must start with main.jsp.
transaction - the transaction for persistence access.
Returns:
the converted url, or the original url if a conversion is not appropriated (cache is disabled for that page, for example).
Throws:
PortalException
Since:
4.1.0


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.