Interface ContentTrashService
-
- All Known Implementing Classes:
ContentTrashServiceImpl
public interface ContentTrashServiceControls trashing, restoring and purgingContentfrom the instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceContentTrashService.ValidatorProvides methods for validating the trash, restore and purge methods.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpurge(Content content)Permanently delete a piece of content.Contentrestore(Content content)Restore a trashed piece of content.voidtrash(Content content)Trash a piece of content.ContentTrashService.Validatorvalidator()Get the validator view of this service.
-
-
-
Method Detail
-
trash
void trash(Content content)
Trash a piece of content.The
purge(Content)method can be used for content that doesn't support trashing. Currently, only content with typesContentType.PAGE,ContentType.BLOG_POSTandContentType.ATTACHMENT(as of Confluence 5.8) support trashing.- Parameters:
content- the content to be trashed- Throws:
NotFoundException- if no current content matches the supplied content. If the supplied content is already trashed, thepurge(Content)should be used instead.BadRequestException- if the supplied content is invalidPermissionException- if the current user is not permitted to trash the content
-
restore
Content restore(Content content)
Restore a trashed piece of content.- Parameters:
content- the content to be restored- Returns:
- the content after being restored
- Throws:
NotFoundException- if no stored content matches the supplied contentBadRequestException- if the supplied content is invalidPermissionException- if the current user is not permitted to restore the content
-
purge
void purge(Content content)
Permanently delete a piece of content.There are two main cases:
- Trashable content (e.g. Pages, BlogPosts) must have status "trashed" to be purged.
- Non-trashable content (e.g. Comments, Attachment) can be purged with status "current".
- Parameters:
content- the content to be purged- Throws:
NotFoundException- if no purgable content matches the supplied content. This can happen if no content matches the id, or if the content found is trashable but not trashed.BadRequestException- if the supplied content is invalidPermissionException- if the current user is not permitted to purge the content
-
validator
ContentTrashService.Validator validator()
Get the validator view of this service.- Returns:
- a Validator that can be used to validate service requests.
-
-