public class CachingProvider extends Object implements PageProvider
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.
| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_NAME
Name of the regular page cache.
|
static int |
DEFAULT_CACHECAPACITY |
static int |
DEFAULT_CACHETIMETOIDLESECONDS |
static int |
DEFAULT_CACHETIMETOLIVESECONDS |
static String |
HISTORYCACHE_NAME
Name of the page history cache.
|
static String |
TEXTCACHE_NAME
Name of the page text cache.
|
LATEST_VERSION| Constructor and Description |
|---|
CachingProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
deletePage(String pageName) |
void |
deleteVersion(String pageName,
int version) |
Collection<SearchResult> |
findPages(QueryItem[] query) |
Collection<Page> |
getAllChangedSince(Date date) |
Collection<Page> |
getAllPages() |
int |
getPageCount() |
Page |
getPageInfo(String pageName,
int version) |
String |
getPageText(String pageName,
int version) |
String |
getProviderInfo()
Gets the provider class name, and cache statistics (misscount and hitcount of page cache and history cache).
|
PageProvider |
getRealProvider()
Returns the actual used provider.
|
List<Page> |
getVersionHistory(String pageName) |
void |
initialize(Engine engine,
Properties properties) |
void |
movePage(String from,
String to) |
boolean |
pageExists(String pageName) |
boolean |
pageExists(String pageName,
int version) |
void |
putPageText(Page page,
String text) |
public static final String CACHE_NAME
public static final String TEXTCACHE_NAME
public static final String HISTORYCACHE_NAME
public static final int DEFAULT_CACHECAPACITY
public static final int DEFAULT_CACHETIMETOLIVESECONDS
public static final int DEFAULT_CACHETIMETOIDLESECONDS
public CachingProvider()
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException
initialize in interface WikiProviderNoRequiredPropertyExceptionIOExceptionpublic boolean pageExists(String pageName, int version)
pageExists in interface PageProviderpublic boolean pageExists(String pageName)
pageExists in interface PageProviderpublic String getPageText(String pageName, int version) throws ProviderException
getPageText in interface PageProviderProviderExceptionpublic void putPageText(Page page, String text) throws ProviderException
putPageText in interface PageProviderProviderExceptionpublic Collection<Page> getAllPages() throws ProviderException
getAllPages in interface PageProviderProviderExceptionpublic Collection<Page> getAllChangedSince(Date date)
getAllChangedSince in interface PageProviderpublic int getPageCount() throws ProviderException
getPageCount in interface PageProviderProviderExceptionpublic Collection<SearchResult> findPages(QueryItem[] query)
findPages in interface PageProviderpublic Page getPageInfo(String pageName, int version) throws ProviderException
getPageInfo in interface PageProviderProviderExceptionpublic List<Page> getVersionHistory(String pageName) throws ProviderException
getVersionHistory in interface PageProviderProviderExceptionpublic String getProviderInfo()
getProviderInfo in interface WikiProviderpublic void deleteVersion(String pageName, int version) throws ProviderException
deleteVersion in interface PageProviderProviderExceptionpublic void deletePage(String pageName) throws ProviderException
deletePage in interface PageProviderProviderExceptionpublic void movePage(String from, String to) throws ProviderException
movePage in interface PageProviderProviderExceptionpublic PageProvider getRealProvider()
Copyright © 2001-2020 The Apache Software Foundation. All rights reserved.