|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.providers.CachingProvider
public class CachingProvider
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 also detects if someone has modified the page externally, not through JSPWiki routines, and throws the proper RepositoryModifiedException.
Heavily based on ideas by Chris Brooking.
Since 2.1.52 uses the OSCache library from OpenSymphony.
RepositoryModifiedException
Field Summary | |
---|---|
static String |
PROP_CACHECAPACITY
|
static String |
PROP_CACHECHECKINTERVAL
Defines, in seconds, the amount of time a text will live in the cache at most before requiring a refresh. |
Fields inherited from interface com.ecyrd.jspwiki.WikiProvider |
---|
LATEST_VERSION |
Constructor Summary | |
---|---|
CachingProvider()
|
Method Summary | |
---|---|
void |
deletePage(String pageName)
Removes an entire page from the repository. |
void |
deleteVersion(String pageName,
int version)
Removes a specific version from the repository. |
Collection |
findPages(QueryItem[] query)
Finds pages based on the query. |
Collection |
getAllChangedSince(Date date)
Gets a list of recent changes. |
Collection |
getAllPages()
Returns all pages. |
int |
getPageCount()
Gets the number of pages. |
WikiPage |
getPageInfo(String pageName,
int version)
Returns info about the page. |
String |
getPageText(String pageName,
int version)
Gets a specific version out of the repository. |
String |
getProviderInfo()
Return a valid HTML string for information. |
WikiPageProvider |
getRealProvider()
Returns the actual used provider. |
List |
getVersionHistory(String pageName)
Returns version history. |
void |
initialize(WikiEngine engine,
Properties properties)
Initializes the page provider. |
void |
movePage(String from,
String to)
Move a page |
boolean |
pageExists(String pageName)
Return true, if page exists. |
boolean |
pageExists(String pageName,
int version)
Return true, if page with a particular version exists. |
void |
putPageText(WikiPage page,
String text)
Attempts to save the page text for page "page". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_CACHECHECKINTERVAL
public static final String PROP_CACHECAPACITY
Constructor Detail |
---|
public CachingProvider()
Method Detail |
---|
public void initialize(WikiEngine engine, Properties properties) throws NoRequiredPropertyException, IOException
WikiProvider
initialize
in interface WikiProvider
NoRequiredPropertyException
IOException
public boolean pageExists(String pageName, int version)
VersioningProvider
pageExists
in interface VersioningProvider
public boolean pageExists(String pageName)
WikiPageProvider
pageExists
in interface WikiPageProvider
public String getPageText(String pageName, int version) throws ProviderException, RepositoryModifiedException
WikiPageProvider
getPageText
in interface WikiPageProvider
pageName
- Name of the page to fetch.version
- Version of the page to fetch.
RepositoryModifiedException
- If the page has been externally modified.
ProviderException
public void putPageText(WikiPage page, String text) throws ProviderException
WikiPageProvider
putPageText
in interface WikiPageProvider
ProviderException
public Collection getAllPages() throws ProviderException
WikiPageProvider
getAllPages
in interface WikiPageProvider
ProviderException
public Collection getAllChangedSince(Date date)
WikiPageProvider
getAllChangedSince
in interface WikiPageProvider
public int getPageCount() throws ProviderException
WikiPageProvider
getPageCount
in interface WikiPageProvider
ProviderException
public Collection findPages(QueryItem[] query)
WikiPageProvider
findPages
in interface WikiPageProvider
public WikiPage getPageInfo(String pageName, int version) throws ProviderException, RepositoryModifiedException
WikiPageProvider
getPageInfo
in interface WikiPageProvider
ProviderException
RepositoryModifiedException
public List getVersionHistory(String pageName) throws ProviderException
WikiPageProvider
getVersionHistory
in interface WikiPageProvider
ProviderException
public String getProviderInfo()
WikiProvider
getProviderInfo
in interface WikiProvider
public void deleteVersion(String pageName, int version) throws ProviderException
WikiPageProvider
deleteVersion
in interface WikiPageProvider
pageName
- Name of the page to be removed.version
- Version of the page to be removed. May be LATEST_VERSION.
ProviderException
- If the page cannot be removed for some reason.public void deletePage(String pageName) throws ProviderException
WikiPageProvider
The reason why this is named differently from deleteVersion() (logically, this method should be an overloaded version) is that I want to be absolutely sure I don't accidentally use the wrong method. With overloading something like that happens sometimes...
deletePage
in interface WikiPageProvider
pageName
- Name of the page to be removed completely.
ProviderException
- If the page could not be removed for some reason.public void movePage(String from, String to) throws ProviderException
WikiPageProvider
movePage
in interface WikiPageProvider
from
- Name of the page to move.to
- New name of the page.
ProviderException
- If the page could not be moved for some reason.public WikiPageProvider getRealProvider()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |