@ParametersAreNonnullByDefault public interface StreamAttachmentStore extends AttachmentHealth
AttachmentStore
and is dedicated to replace it.Modifier and Type | Interface and Description |
---|---|
static interface |
StreamAttachmentStore.Factory |
Modifier and Type | Method and Description |
---|---|
com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> |
copyAttachment(AttachmentKey sourceAttachmentKey,
AttachmentKey newAttachmentKey)
Copies attachment identified by
oldAttachmentKey to be identified also by newAttachmentKey . |
com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> |
deleteAttachment(AttachmentKey attachmentKey)
Delete the attachment identified by provided attachmentKey.
|
com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> |
deleteTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId)
Deletes temporary attachment created previously by
putTemporaryAttachment(java.io.InputStream, long) . |
com.atlassian.util.concurrent.Promise<Boolean> |
exists(AttachmentKey attachmentKey)
Checks if attachment exists.
|
<A> com.atlassian.util.concurrent.Promise<A> |
getAttachment(AttachmentKey attachmentKey,
com.atlassian.util.concurrent.Function<InputStream,A> inputStreamProcessor)
Retrieve data for a given attachment.
|
<A> com.atlassian.util.concurrent.Promise<A> |
getAttachmentData(AttachmentKey attachmentKey,
com.atlassian.util.concurrent.Function<AttachmentGetData,A> attachmentGetDataProcessor)
Retrieve data for a given attachment.
|
com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> |
moveAttachment(AttachmentKey oldAttachmentKey,
AttachmentKey newAttachmentKey)
Move attachment identified by
oldAttachmentKey to be identified by newAttachmentKey and will be not
reachable under oldAttachmentKey anymore. |
com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> |
moveTemporaryToAttachment(TemporaryAttachmentId temporaryAttachmentId,
AttachmentKey destinationKey)
Moving temporary attachment created by
putTemporaryAttachment(java.io.InputStream, long) to real attachment. |
com.atlassian.util.concurrent.Promise<StoreAttachmentResult> |
putAttachment(StoreAttachmentBean storeAttachmentBean)
Store attachment data for a given attachment.
|
com.atlassian.util.concurrent.Promise<TemporaryAttachmentId> |
putTemporaryAttachment(InputStream inputStream,
long size)
Creates temporaryAttachment in store which can be later moved to attachment via
moveTemporaryToAttachment(TemporaryAttachmentId, AttachmentKey) |
errors
com.atlassian.util.concurrent.Promise<StoreAttachmentResult> putAttachment(StoreAttachmentBean storeAttachmentBean)
storeAttachmentBean
- attachment metadata, used to determine the logical key under which to store the
attachment dataAttachmentRuntimeException
in case of error.<A> com.atlassian.util.concurrent.Promise<A> getAttachment(AttachmentKey attachmentKey, com.atlassian.util.concurrent.Function<InputStream,A> inputStreamProcessor)
A
- The class that the inputStreamProcessor returns when run.attachmentKey
- The key of attachment used to identify attachment datainputStreamProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.<A> com.atlassian.util.concurrent.Promise<A> getAttachmentData(AttachmentKey attachmentKey, com.atlassian.util.concurrent.Function<AttachmentGetData,A> attachmentGetDataProcessor)
A
- The class that the attachmentGetDataProcessor returns when run.attachmentKey
- The key of attachment used to identify attachment dataattachmentGetDataProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> moveAttachment(AttachmentKey oldAttachmentKey, AttachmentKey newAttachmentKey)
oldAttachmentKey
to be identified by newAttachmentKey
and will be not
reachable under oldAttachmentKey
anymore.oldAttachmentKey
- the old AttachmentKeynewAttachmentKey
- the new AttachmentKeycom.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> copyAttachment(AttachmentKey sourceAttachmentKey, AttachmentKey newAttachmentKey)
oldAttachmentKey
to be identified also by newAttachmentKey
.sourceAttachmentKey
- attachmentKey of existing attachment which should be copiednewAttachmentKey
- attachmentKey under which copiedcom.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> deleteAttachment(AttachmentKey attachmentKey)
com.atlassian.util.concurrent.Promise<TemporaryAttachmentId> putTemporaryAttachment(InputStream inputStream, long size)
moveTemporaryToAttachment(TemporaryAttachmentId, AttachmentKey)
inputStream
- stream to temporary attachment datasize
- the size of provided streamcom.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> moveTemporaryToAttachment(TemporaryAttachmentId temporaryAttachmentId, AttachmentKey destinationKey)
putTemporaryAttachment(java.io.InputStream, long)
to real attachment.temporaryAttachmentId
- id of temporary attachment, returned by putTemporaryAttachment(java.io.InputStream, long)
destinationKey
- destination key of under which attachment will be identifiedcom.atlassian.util.concurrent.Promise<com.atlassian.fugue.Unit> deleteTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId)
putTemporaryAttachment(java.io.InputStream, long)
.temporaryAttachmentId
- id of temporary attachmentcom.atlassian.util.concurrent.Promise<Boolean> exists(AttachmentKey attachmentKey)
attachmentKey
- key of attachment to check for existencePromise
to boolean result, true if attachment exists and false
otherwiseCopyright © 2002-2017 Atlassian. All Rights Reserved.