Class RemoteAttachmentServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.rest.client.AbstractRemoteService<AttachmentService>
-
- com.atlassian.confluence.rest.client.RemoteAttachmentServiceImpl
-
- All Implemented Interfaces:
RemoteAttachmentService
public class RemoteAttachmentServiceImpl extends AbstractRemoteService<AttachmentService> implements RemoteAttachmentService
AttachmentService implementation that communicates with Confluence remotely using the Confluence REST api
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRemoteAttachmentServiceImpl.RemoteAttachmentFinderImpl-
Nested classes/interfaces inherited from interface com.atlassian.confluence.rest.client.RemoteAttachmentService
RemoteAttachmentService.RemoteAttachmentFinder
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider
-
-
Constructor Summary
Constructors Constructor Description RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.atlassian.util.concurrent.Promise<PageResponse<Content>>addAttachments(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads)Deprecated.since 7.0.1.com.atlassian.util.concurrent.Promise<PageResponse<Content>>addAttachments(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions)Deprecated.since 7.0.1.com.atlassian.util.concurrent.Promise<PageResponse<Content>>addAttachments(ContentId contentId, Collection<AttachmentUpload> uploads)Deprecated.since 7.0.1.CompletionStage<PageResponse<Content>>addAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads)CompletionStage<PageResponse<Content>>addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions)CompletionStage<PageResponse<Content>>addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads)Add one or more attachments to a piece ofContent.com.atlassian.util.concurrent.Promise<Void>delete(Content attachmentContent)Deprecated.since 7.0.1.CompletionStage<Void>deleteCompletionStage(Content attachmentContent)Removes an Attachment from the system.RemoteAttachmentService.RemoteAttachmentFinderfind(Expansion... expansions)com.atlassian.util.concurrent.Promise<Content>update(Content attachment)Deprecated.since 7.0.1.CompletionStage<Content>updateCompletionStage(Content attachment)Updates the non-data parts of an AttachmentContentinstance.com.atlassian.util.concurrent.Promise<Content>updateData(ContentId attachmentId, AttachmentUpload upload)Deprecated.since 7.0.1.CompletionStage<Content>updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload)Updates the data part of an AttachmentContentinstance.AttachmentService.Validatorvalidator()Remote validation not supported-
Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, deleteFuture, deleteFuture, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, getFuture, getFutureGenericCollection, getFutureMap, getFutureMapOfPageResponses, getFutureOption, getFuturePageResponseList, newExperimentalRestWebResource, newRestWebResource, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postFuture, postFuture, postFuture, postFutureToPageResponse, putCompletionStage, putFuture
-
-
-
-
Constructor Detail
-
RemoteAttachmentServiceImpl
public RemoteAttachmentServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
-
Method Detail
-
addAttachments
@Deprecated public com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId contentId, Collection<AttachmentUpload> uploads) throws ServiceException
Deprecated.since 7.0.1. UseaddAttachmentsCompletionStage(ContentId, Collection)instead.- Specified by:
addAttachmentsin interfaceRemoteAttachmentService- Throws:
ServiceException
-
addAttachments
@Deprecated public com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) throws ServiceException
Deprecated.since 7.0.1. UseaddAttachmentsCompletionStage(ContentId, ContentStatus, Collection)instead.- Specified by:
addAttachmentsin interfaceRemoteAttachmentService- Throws:
ServiceException
-
addAttachments
@Deprecated public com.atlassian.util.concurrent.Promise<PageResponse<Content>> addAttachments(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) throws ServiceException
Deprecated.since 7.0.1. UseaddAttachmentsCompletionStage(ContentId, ContentStatus, Collection, boolean, Expansions)instead.- Specified by:
addAttachmentsin interfaceRemoteAttachmentService- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, Collection<AttachmentUpload> uploads) throws ServiceException
Description copied from interface:RemoteAttachmentServiceAdd one or more attachments to a piece ofContent.- Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Parameters:
contentId- the id of the content to attach touploads- the attachments being uploaded- Returns:
- the attachments added
- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId contentId, ContentStatus status, Collection<AttachmentUpload> uploads) throws ServiceException
- Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Throws:
ServiceException
-
addAttachmentsCompletionStage
public CompletionStage<PageResponse<Content>> addAttachmentsCompletionStage(ContentId containerId, ContentStatus containerStatus, Collection<AttachmentUpload> uploads, boolean allowDuplicated, Expansions expansions) throws ServiceException
- Specified by:
addAttachmentsCompletionStagein interfaceRemoteAttachmentService- Throws:
ServiceException
-
find
public RemoteAttachmentService.RemoteAttachmentFinder find(Expansion... expansions)
- Specified by:
findin interfaceRemoteAttachmentService
-
update
@Deprecated public com.atlassian.util.concurrent.Promise<Content> update(Content attachment) throws ServiceException
Deprecated.since 7.0.1. UseupdateCompletionStage(Content)instead.Description copied from interface:RemoteAttachmentServiceUpdates the non-data parts of an AttachmentContentinstance.This method can be used to update the container, filename, media-type and comment of an Attachment.
- Specified by:
updatein interfaceRemoteAttachmentService- Parameters:
attachment- the attachment to update, must include an id- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException
-
updateData
@Deprecated public com.atlassian.util.concurrent.Promise<Content> updateData(ContentId attachmentId, AttachmentUpload upload) throws ServiceException
Deprecated.since 7.0.1. UseupdateDataCompletionStage(ContentId, AttachmentUpload)instead.Description copied from interface:RemoteAttachmentServiceUpdates the data part of an AttachmentContentinstance.- Specified by:
updateDatain interfaceRemoteAttachmentService- 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
-
delete
@Deprecated public com.atlassian.util.concurrent.Promise<Void> delete(Content attachmentContent) throws ServiceException
Deprecated.since 7.0.1. UsedeleteCompletionStage(Content)instead.Description copied from interface:RemoteAttachmentServiceRemoves an Attachment from the system.- Specified by:
deletein interfaceRemoteAttachmentService- Parameters:
attachmentContent- the content to remove- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
updateCompletionStage
public CompletionStage<Content> updateCompletionStage(Content attachment) throws ServiceException
Description copied from interface:RemoteAttachmentServiceUpdates the non-data parts of an AttachmentContentinstance.This method can be used to update the container, filename, media-type and comment of an Attachment.
- Specified by:
updateCompletionStagein interfaceRemoteAttachmentService- Parameters:
attachment- the attachment to update, must include an id- Returns:
- the updated attachment as stored in the database
- Throws:
ServiceException
-
updateDataCompletionStage
public CompletionStage<Content> updateDataCompletionStage(ContentId attachmentId, AttachmentUpload upload) throws ServiceException
Description copied from interface:RemoteAttachmentServiceUpdates the data part of an AttachmentContentinstance.- Specified by:
updateDataCompletionStagein interfaceRemoteAttachmentService- 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
-
deleteCompletionStage
public CompletionStage<Void> deleteCompletionStage(Content attachmentContent) throws ServiceException
Description copied from interface:RemoteAttachmentServiceRemoves an Attachment from the system.- Specified by:
deleteCompletionStagein interfaceRemoteAttachmentService- Parameters:
attachmentContent- the content to remove- Throws:
ServiceException- if the content cannot be found, or cannot be deleted
-
validator
public AttachmentService.Validator validator()
Remote validation not supported- Throws:
UnsupportedOperationException
-
-