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_STORAGEDIR
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
deleteVersion
(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.void
initialize
(Engine engine, Properties properties) listAllChanged
(Date timestamp) listAttachments
(Page page) void
moveAttachmentsForPage
(String oldParent, String newParent) void
putAttachmentData
(Attachment att, InputStream data)
-
Constructor Details
-
CachingAttachmentProvider
public CachingAttachmentProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initialize
in interfaceWikiProvider
- Throws:
NoRequiredPropertyException
IOException
-
putAttachmentData
public void putAttachmentData(Attachment att, InputStream data) throws ProviderException, IOException - Specified by:
putAttachmentData
in interfaceAttachmentProvider
- Throws:
ProviderException
IOException
-
getAttachmentData
- Specified by:
getAttachmentData
in interfaceAttachmentProvider
- Throws:
ProviderException
IOException
-
listAttachments
- Specified by:
listAttachments
in interfaceAttachmentProvider
- Throws:
ProviderException
-
findAttachments
- Specified by:
findAttachments
in interfaceAttachmentProvider
-
listAllChanged
- Specified by:
listAllChanged
in interfaceAttachmentProvider
- Throws:
ProviderException
-
getAttachmentInfo
- Specified by:
getAttachmentInfo
in interfaceAttachmentProvider
- Throws:
ProviderException
-
getVersionHistory
- Specified by:
getVersionHistory
in interfaceAttachmentProvider
-
deleteVersion
- Specified by:
deleteVersion
in interfaceAttachmentProvider
- Throws:
ProviderException
-
deleteAttachment
- Specified by:
deleteAttachment
in interfaceAttachmentProvider
- Throws:
ProviderException
-
getProviderInfo
Gets the provider class name, and cache statistics (misscount and hitcount of the attachment cache).- Specified by:
getProviderInfo
in 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:
moveAttachmentsForPage
in interfaceAttachmentProvider
- Throws:
ProviderException
-