Package org.apache.wiki.providers
Class CachingAttachmentProvider
java.lang.Object
org.apache.wiki.providers.CachingAttachmentProvider
- All Implemented Interfaces:
AttachmentProvider,WikiProvider
Provides a caching attachment provider. This class rests on top of a real provider class and provides a cache to speed things up.
Only the Attachment objects are cached; the actual attachment contents are fetched always from the provider.
- Since:
- 2.1.64.
-
Field Summary
Fields inherited from interface org.apache.wiki.api.providers.AttachmentProvider
PROP_STORAGEDIRFields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteVersion(Attachment att) findAttachments(QueryItem[] query) getAttachmentInfo(Page page, String name, int version) Gets the provider class name, and cache statistics (misscount and hitcount of the attachment cache).Returns the WikiAttachmentProvider that this caching provider delegates to.voidinitialize(Engine engine, Properties properties) listAllChanged(Date timestamp) listAttachments(Page page) voidmoveAttachmentsForPage(String oldParent, String newParent) voidputAttachmentData(Attachment att, InputStream data)
-
Constructor Details
-
CachingAttachmentProvider
public CachingAttachmentProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initializein interfaceWikiProvider- Throws:
NoRequiredPropertyExceptionIOException
-
putAttachmentData
public void putAttachmentData(Attachment att, InputStream data) throws ProviderException, IOException - Specified by:
putAttachmentDatain interfaceAttachmentProvider- Throws:
ProviderExceptionIOException
-
getAttachmentData
- Specified by:
getAttachmentDatain interfaceAttachmentProvider- Throws:
ProviderExceptionIOException
-
listAttachments
- Specified by:
listAttachmentsin interfaceAttachmentProvider- Throws:
ProviderException
-
findAttachments
- Specified by:
findAttachmentsin interfaceAttachmentProvider
-
listAllChanged
- Specified by:
listAllChangedin interfaceAttachmentProvider- Throws:
ProviderException
-
getAttachmentInfo
- Specified by:
getAttachmentInfoin interfaceAttachmentProvider- Throws:
ProviderException
-
getVersionHistory
- Specified by:
getVersionHistoryin interfaceAttachmentProvider
-
deleteVersion
- Specified by:
deleteVersionin interfaceAttachmentProvider- Throws:
ProviderException
-
deleteAttachment
- Specified by:
deleteAttachmentin interfaceAttachmentProvider- Throws:
ProviderException
-
getProviderInfo
Gets the provider class name, and cache statistics (misscount and hitcount of the attachment cache).- Specified by:
getProviderInfoin interfaceWikiProvider- Returns:
- A plain string with all the above-mentioned values.
-
getRealProvider
Returns the WikiAttachmentProvider that this caching provider delegates to.- Returns:
- The real provider underneath this one.
-
moveAttachmentsForPage
- Specified by:
moveAttachmentsForPagein interfaceAttachmentProvider- Throws:
ProviderException
-