ReadThroughCachingAttachmentDao
@Deprecated public class CachingAttachmentDao extends AbstractDelegatingAttachmentDao implements FlushableCachingDao
getLatestAttachment(ContentEntityObject, String)
in an AttachmentCache
. Other methods simply delegate to the underlying DAO.
Because the persistent ID of the latest version of an attachment never changes, there's no need to synchronise the cache when an attachment is modified. However, the cache is updated when attachments are removed through this interface.
If for some reason the cache does get out of sync with the database, the lookup using the cached ID will fail. In this situation, we fall back to using the lookup by content ID + file name. The cache will then be corrected once the right result is retrieved from the database.
AttachmentCache
AttachmentDao.AttachmentCopier, AttachmentDao.AttachmentMigrator
Constructor and Description |
---|
CachingAttachmentDao(AttachmentDaoInternal delegate,
AttachmentCache cache)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Deprecated.
Flush the caches managed by this DAO.
|
Attachment |
getLatestAttachment(ContentEntityObject content,
String fileName)
Deprecated.
Return the latest version of the attachment on the specified content with the given filename.
|
void |
moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
Deprecated.
Moves an Attachment to a new file name or content object
|
void |
removeAttachmentFromServer(Attachment attachment)
Deprecated.
Removes attachment (and all of its versions)
|
void |
removeAttachmentVersionFromServer(Attachment attachment)
Deprecated.
Removes an attachment version
|
afterMigrationFrom, countLatestVersionsOfAttachments, countLatestVersionsOfAttachmentsOnPageSince, countLatestVersionsOfAttachmentsWithAnyStatus, findAll, findAllVersions, findLatestVersionsIterator, getAttachment, getAttachmentData, getAttachmentData, getAttachmentStatistics, getBackingStorageType, getById, getByIds, getCopier, getDataDao, getDelegate, getLastAddedVersionsOf, getLatestVersionsOfAttachments, getLatestVersionsOfAttachments, getLatestVersionsOfAttachmentsForMultipleCeos, getLatestVersionsOfAttachmentsWithAnyStatus, getLatestVersionsOfAttachmentsWithAnyStatusForContainers, getMigrator, getRemappedAttachmentIds, isAttachmentPresent, prepareForMigrationTo, replaceAttachmentData, saveNewAttachment, saveNewAttachmentVersion, updateAttachment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFilteredLatestVersionsOfAttachments
public CachingAttachmentDao(AttachmentDaoInternal delegate, AttachmentCache cache)
public Attachment getLatestAttachment(ContentEntityObject content, String fileName)
AttachmentDao
getLatestAttachment
in interface AttachmentDao
getLatestAttachment
in class AbstractDelegatingAttachmentDao
content
- the content to find the attachment onfileName
- the file name of the attachmentpublic void removeAttachmentFromServer(Attachment attachment)
AttachmentDao
removeAttachmentFromServer
in interface AttachmentDao
removeAttachmentFromServer
in class AbstractDelegatingAttachmentDao
attachment
- the Attachment to be removedpublic void removeAttachmentVersionFromServer(Attachment attachment)
AttachmentDao
removeAttachmentVersionFromServer
in interface AttachmentDao
removeAttachmentVersionFromServer
in class AbstractDelegatingAttachmentDao
attachment
- the Attachment version to be removedpublic void flush()
FlushableCachingDao
flush
in interface FlushableCachingDao
public void moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent)
AttachmentDao
This method assumes that the filename and/or content of the attachment (and its previous versions) have already been updated.
moveAttachment
in interface AttachmentDao
moveAttachment
in class AbstractDelegatingAttachmentDao
attachment
- the Attachment to be movedoldAttachment
- the Attachment before it has been updatednewContent
- the new content attachment belongs toCopyright © 2003–2020 Atlassian. All rights reserved.