| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| AttachmentVersioningStore | 36 | 0 | - | 0 | 0 |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package com.xpn.xwiki.store; | |
| 21 | ||
| 22 | import org.xwiki.component.annotation.Role; | |
| 23 | ||
| 24 | import com.xpn.xwiki.XWikiContext; | |
| 25 | import com.xpn.xwiki.XWikiException; | |
| 26 | import com.xpn.xwiki.doc.XWikiAttachment; | |
| 27 | import com.xpn.xwiki.doc.XWikiAttachmentArchive; | |
| 28 | ||
| 29 | /** | |
| 30 | * Interface for storing attachment versions. | |
| 31 | * | |
| 32 | * @version $Id: 51e2c569491165142dffa43770948fb8600de662 $ | |
| 33 | * @since 1.4M2 | |
| 34 | */ | |
| 35 | @Role | |
| 36 | public interface AttachmentVersioningStore | |
| 37 | { | |
| 38 | /** | |
| 39 | * Load attachment archive from store. | |
| 40 | * | |
| 41 | * @return attachment archive. not null. return empty archive if it is not exist in store. | |
| 42 | * @param attachment The attachment of archive. | |
| 43 | * @param context The current context. | |
| 44 | * @param bTransaction Should use old transaction (false) or create new (true). | |
| 45 | * @throws XWikiException If an error occurs. | |
| 46 | */ | |
| 47 | XWikiAttachmentArchive loadArchive(XWikiAttachment attachment, XWikiContext context, boolean bTransaction) | |
| 48 | throws XWikiException; | |
| 49 | ||
| 50 | /** | |
| 51 | * Save or update attachment archive. | |
| 52 | * | |
| 53 | * @param archive The attachment archive to save. | |
| 54 | * @param context The current context. | |
| 55 | * @param bTransaction Should use old transaction (false) or create new (true). | |
| 56 | * @throws XWikiException If an error occurs. | |
| 57 | */ | |
| 58 | void saveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean bTransaction) throws XWikiException; | |
| 59 | ||
| 60 | /** | |
| 61 | * Permanently delete attachment archive. | |
| 62 | * | |
| 63 | * @param attachment The attachment to delete. | |
| 64 | * @param context The current context. | |
| 65 | * @param bTransaction Should use old transaction (false) or create new (true). | |
| 66 | * @throws XWikiException If an error occurs. | |
| 67 | */ | |
| 68 | void deleteArchive(XWikiAttachment attachment, XWikiContext context, boolean bTransaction) throws XWikiException; | |
| 69 | } |