public class AttachmentPrefetcher extends Object implements ResourcePrefetcher<AttachmentResourceIdentifier>
Constructor and Description |
---|
AttachmentPrefetcher(AttachmentManager attachmentManager,
com.atlassian.event.api.EventPublisher eventPublisher,
ImageDetailsPrefetchDao imageDetailsPrefetcher) |
Modifier and Type | Method and Description |
---|---|
Class<AttachmentResourceIdentifier> |
getResourceItentifierType() |
void |
prefetch(Set<AttachmentResourceIdentifier> attachmentIdentifiers,
ConversionContext conversionContext)
Fetch the attachments for the given set of identifiers, and store them in the given conversion context.
|
static @NonNull Function<AttachmentResourceIdentifier,Optional<Attachment>> |
prefetchedAttachments(ConversionContext conversionContext) |
public AttachmentPrefetcher(AttachmentManager attachmentManager, com.atlassian.event.api.EventPublisher eventPublisher, ImageDetailsPrefetchDao imageDetailsPrefetcher)
public static @NonNull Function<AttachmentResourceIdentifier,Optional<Attachment>> prefetchedAttachments(ConversionContext conversionContext)
public Class<AttachmentResourceIdentifier> getResourceItentifierType()
getResourceItentifierType
in interface ResourcePrefetcher<AttachmentResourceIdentifier>
public void prefetch(Set<AttachmentResourceIdentifier> attachmentIdentifiers, ConversionContext conversionContext)
It is possible and valid that some of the attachment identifiers refer to attachments on pages other than the page being rendered. However, this is expected to be a relatively unusual case. In the interests of simplicity, and given that this stuff is just an optimization, we only pre-fetch attachments for the current page. Any attachments from other pages will therefore need to be fetched on-demand by the renderer as usual.
prefetch
in interface ResourcePrefetcher<AttachmentResourceIdentifier>
attachmentIdentifiers
- The set of attachment identifiers that should be prefetched if possibleCopyright © 2003–2020 Atlassian. All rights reserved.