Package org.apache.wiki.providers
Class CachingProvider
java.lang.Object
org.apache.wiki.providers.CachingProvider
- All Implemented Interfaces:
PageProvider
,WikiProvider
Provides a caching page provider. This class rests on top of a real provider class and provides a cache to speed things up. Only
if the cache copy of the page text has expired, we fetch it from the provider.
This class does not detect if someone has modified the page externally, not through JSPWiki routines.
Heavily based on ideas by Chris Brooking.
Since 2.10 uses the Ehcache library.
- Since:
- 1.6.4
-
Field Summary
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deletePage
(String pageName) void
deleteVersion
(String pageName, int version) getAllChangedSince
(Date date) int
getPageInfo
(String pageName, int version) getPageText
(String pageName, int version) Gets the provider class name, and cache statistics (misscount and hitcount of page cache and history cache).Returns the actual used provider.getVersionHistory
(String pageName) void
initialize
(Engine engine, Properties properties) void
boolean
pageExists
(String pageName) boolean
pageExists
(String pageName, int version) void
putPageText
(Page page, String text)
-
Constructor Details
-
CachingProvider
public CachingProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initialize
in interfaceWikiProvider
- Throws:
NoRequiredPropertyException
IOException
-
pageExists
- Specified by:
pageExists
in interfacePageProvider
-
pageExists
- Specified by:
pageExists
in interfacePageProvider
-
getPageText
- Specified by:
getPageText
in interfacePageProvider
- Throws:
ProviderException
-
putPageText
- Specified by:
putPageText
in interfacePageProvider
- Throws:
ProviderException
-
getAllPages
- Specified by:
getAllPages
in interfacePageProvider
- Throws:
ProviderException
-
getAllChangedSince
- Specified by:
getAllChangedSince
in interfacePageProvider
-
getPageCount
- Specified by:
getPageCount
in interfacePageProvider
- Throws:
ProviderException
-
findPages
- Specified by:
findPages
in interfacePageProvider
-
getPageInfo
- Specified by:
getPageInfo
in interfacePageProvider
- Throws:
ProviderException
-
getVersionHistory
- Specified by:
getVersionHistory
in interfacePageProvider
- Throws:
ProviderException
-
getProviderInfo
Gets the provider class name, and cache statistics (misscount and hitcount of page cache and history cache).- Specified by:
getProviderInfo
in interfaceWikiProvider
- Returns:
- A plain string with all the above-mentioned values.
-
deleteVersion
- Specified by:
deleteVersion
in interfacePageProvider
- Throws:
ProviderException
-
deletePage
- Specified by:
deletePage
in interfacePageProvider
- Throws:
ProviderException
-
movePage
- Specified by:
movePage
in interfacePageProvider
- Throws:
ProviderException
-
getRealProvider
Returns the actual used provider.- Returns:
- The real provider.
- Since:
- 2.0
-