com.xpn.xwiki.store
Class VoidAttachmentVersioningStore

java.lang.Object
  extended by com.xpn.xwiki.store.VoidAttachmentVersioningStore
All Implemented Interfaces:
AttachmentVersioningStore

@Component
@Named(value="void")
@Singleton
public class VoidAttachmentVersioningStore
extends Object
implements AttachmentVersioningStore

Void 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: b6477bc60b21639524995b48ca504822f2dea6e6 $

Nested Class Summary
static class VoidAttachmentVersioningStore.VoidAttachmentArchive
          Void realization of AttachmentArchive.
 
Constructor Summary
VoidAttachmentVersioningStore()
          Empty constructor needed for component manager.
VoidAttachmentVersioningStore(XWikiContext context)
          Deprecated. 1.6M1. Use ComponentManager.lookup(AttachmentVersioningStore.class) instead.
 
Method Summary
 void deleteArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)
          Permanently delete attachment archive.
 XWikiAttachmentArchive loadArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)
          Load attachment archive from store.
 void saveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean transaction)
          Save or update attachment archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoidAttachmentVersioningStore

@Deprecated
public VoidAttachmentVersioningStore(XWikiContext context)
Deprecated. 1.6M1. Use ComponentManager.lookup(AttachmentVersioningStore.class) instead.

Constructor used by XWiki during storage initialization.

Parameters:
context - The current context.

VoidAttachmentVersioningStore

public VoidAttachmentVersioningStore()
Empty constructor needed for component manager.

Method Detail

deleteArchive

public void deleteArchive(XWikiAttachment attachment,
                          XWikiContext context,
                          boolean transaction)
                   throws XWikiException
Description copied from interface: AttachmentVersioningStore
Permanently delete attachment archive.

Specified by:
deleteArchive in interface AttachmentVersioningStore
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: AttachmentVersioningStore
Save or update attachment archive.

Specified by:
saveArchive in interface AttachmentVersioningStore
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: AttachmentVersioningStore
Load attachment archive from store.

Specified by:
loadArchive in interface AttachmentVersioningStore
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.


Copyright © 2004–2014 XWiki. All rights reserved.