Interface RemoteAttachmentService
- All Known Implementing Classes:
RemoteAttachmentServiceImpl
public interface RemoteAttachmentService
*
AttachmentService implementation that communicates with Confluence remotely using the Confluence REST API.
Provides future returning equivalents for the methods in AttachmentService.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionaddAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads) Add one or more attachments to a piece ofContent.deleteCompletionStage(Content attachmentContent) Removes an Attachment from the system.moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId) Moves an Attachment from a page to new page.moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId, String newName) Moves an Attachment from a page to new page and also rename it.removeAttachmentCompletionStage(ContentId contentId, ContentId attachmentId) Trashes an attachment associated with an attachmentId.removeAttachmentVersionCompletionStage(ContentId contentId, ContentId attachmentId, int version) Removes a specific version of an attachment associated with given content.updateCompletionStage(Content attachment) Updates the non-data parts of an AttachmentContentinstance.updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload) Updates the data part of an AttachmentContentinstance.
-
Method Details
-
addAttachmentsCompletionStage
CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads) throws ServiceException Add one or more attachments to a piece ofContent.- Parameters:
contentId- the id of the content to attach touploads- the attachments being uploaded- Returns:
- the attachments added
- Throws:
ServiceException- Since:
- 9.0
-
addAttachmentsCompletionStage
CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) throws ServiceException - Throws:
ServiceException- Since:
- 9.0
-
addAttachmentsCompletionStage
CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) throws ServiceException - Throws:
ServiceException- Since:
- 9.0
-
find
-
updateCompletionStage
Updates the non-data parts of an AttachmentContentinstance.This method can be used to update the container, filename, media-type and comment of an Attachment.
- Parameters:
attachment- the attachment to update, must include an id- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException- Since:
- 9.0
-
updateDataCompletionStage
CompletionStage<Content> updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload) throws ServiceException Updates the data part of an AttachmentContentinstance.- Parameters:
attachmentId- the id of the attachment to updateupload- the new content of the Attachment- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException- Since:
- 9.0
-
moveAttachmentCompletionStage
CompletionStage<Void> moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId) throws ServiceException Moves an Attachment from a page to new page.- Parameters:
attachmentId- the attachment that should be moved.newContentId- the id of the new page attachment should be on.- Throws:
ServiceException- if the content cannot be found, or cannot be deleted- Since:
- 9.0
-
moveAttachmentCompletionStage
CompletionStage<Void> moveAttachmentCompletionStage(ContentId contentId, ContentId attachmentId, ContentId newContentId, String newName) throws ServiceException Moves an Attachment from a page to new page and also rename it.- Parameters:
attachmentId- the attachment that should be moved.newContentId- the id of the new page attachment should be on.newName- the new name for the attachment if required.- Throws:
ServiceException- if the content cannot be found, or cannot be deleted- Since:
- 9.0
-
deleteCompletionStage
Removes an Attachment from the system.- Parameters:
attachmentContent- the content to remove- Throws:
ServiceException- if the content cannot be found, or cannot be deleted- Since:
- 9.0
-
removeAttachmentCompletionStage
CompletionStage<Void> removeAttachmentCompletionStage(ContentId contentId, ContentId attachmentId) throws ServiceException Trashes an attachment associated with an attachmentId.- Parameters:
contentId- the id of the container/page to which attachment belongsattachmentId- the id of the attachment to trash- Throws:
ServiceException- if the content cannot be found, or cannot be deleted- Since:
- 9.0
-
removeAttachmentVersionCompletionStage
CompletionStage<Void> removeAttachmentVersionCompletionStage(ContentId contentId, ContentId attachmentId, int version) throws ServiceException Removes a specific version of an attachment associated with given content.- Parameters:
contentId- The id of the content to which the attachment belongs.attachmentId- The id of the attachment to be removed.version- The version of the attachment to be removed.- Returns:
- a completion stage that, when completed, signifies that the attachment version has been successfully removed.
- Throws:
ServiceException- if an error occurs during the removal process.- Since:
- 9.0
-