Package com.xpn.xwiki.store
Class VoidAttachmentVersioningStore
- java.lang.Object
-
- com.xpn.xwiki.store.VoidAttachmentVersioningStore
-
- All Implemented Interfaces:
AttachmentVersioningStore
@Component @Named("void") @Singleton public class VoidAttachmentVersioningStore extends Object implements AttachmentVersioningStoreVoid store for attachment versioning when it is disabled. ("xwiki.store.attachment.versioning=0" parameter is set in xwiki.cfg) It says what there is only one version of attachment - latest. It doesn't store anything. It is safe to use with any stores.- Since:
- 1.4M2
- Version:
- $Id: 971adb2818c92d15f1b50f8d580b686e4f60e6c4 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVoidAttachmentVersioningStore.VoidAttachmentArchiveVoid realization of AttachmentArchive.
-
Constructor Summary
Constructors Constructor Description VoidAttachmentVersioningStore()Empty constructor needed for component manager.VoidAttachmentVersioningStore(XWikiContext context)Deprecated.1.6M1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)Permanently delete attachment archive.StringgetHint()XWikiAttachmentArchiveloadArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)Load attachment archive from store.voidsaveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean transaction)Save or update attachment archive.
-
-
-
Constructor Detail
-
VoidAttachmentVersioningStore
@Deprecated public VoidAttachmentVersioningStore(XWikiContext context)
Deprecated.1.6M1. Use ComponentManager.lookup(AttachmentVersioningStore.class) instead.Constructor used byXWikiduring storage initialization.- Parameters:
context- The current context.
-
VoidAttachmentVersioningStore
public VoidAttachmentVersioningStore()
Empty constructor needed for component manager.
-
-
Method Detail
-
getHint
public String getHint()
- Specified by:
getHintin interfaceAttachmentVersioningStore- Returns:
- the role hint of the component
-
deleteArchive
public void deleteArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStorePermanently delete attachment archive.- Specified by:
deleteArchivein interfaceAttachmentVersioningStore- Parameters:
attachment- The attachment to delete.context- The current context.transaction- Should use old transaction (false) or create new (true).- Throws:
XWikiException- If an error occurs.
-
saveArchive
public void saveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStoreSave or update attachment archive.- Specified by:
saveArchivein interfaceAttachmentVersioningStore- Parameters:
archive- The attachment archive to save.context- The current context.transaction- Should use old transaction (false) or create new (true).- Throws:
XWikiException- If an error occurs.
-
loadArchive
public XWikiAttachmentArchive loadArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStoreLoad attachment archive from store.- Specified by:
loadArchivein interfaceAttachmentVersioningStore- Parameters:
attachment- The attachment of archive.context- The current context.transaction- Should use old transaction (false) or create new (true).- Returns:
- attachment archive. not null. return empty archive if it is not exist in store.
- Throws:
XWikiException- If an error occurs.
-
-